Merge pull request #1403 from spotify/mob/techdocs-cli

techdocs: cli skeleton
This commit is contained in:
Emma Indal
2020-06-22 20:39:09 +02:00
committed by GitHub
6 changed files with 104 additions and 2 deletions
+3 -2
View File
@@ -4,5 +4,6 @@
# The last matching pattern takes precedence.
# https://help.github.com/articles/about-codeowners/
* @spotify/backstage-core
/plugins/techdocs @spotify/techdocs-core
* @spotify/backstage-core
/plugins/techdocs @spotify/techdocs-core
/packages/techdocs-cli @spotify/techdocs-core
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
extends: [require.resolve('@backstage/cli/config/eslint')],
};
+5
View File
@@ -0,0 +1,5 @@
# TechDocs CLI
Check out the [TechDocs README](https://github.com/spotify/backstage/blob/master/plugins/techdocs/README.md) to learn more.
**WIP: This cli is a work in progress. It is not ready for use yet. Follow our progress on [the Backstage Discord](https://discord.gg/MUpMjP2) under #docs-like-code or on [our GitHub Milestone](https://github.com/spotify/backstage/milestone/15).**
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env node
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const path = require('path');
// Figure out whether we're running inside the backstage repo or as an installed dependency
const isLocal = require('fs').existsSync(path.resolve(__dirname, '../src'));
if (!isLocal) {
require('..');
} else {
require('ts-node').register({
transpileOnly: true,
compilerOptions: {
module: 'CommonJS',
},
});
require('../src');
}
+42
View File
@@ -0,0 +1,42 @@
{
"name": "@backstage/techdocs-cli",
"description": "CLI for running TechDocs locally.",
"version": "0.1.1-alpha.9",
"private": true,
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/spotify/backstage",
"directory": "packages/techdocs-cli"
},
"keywords": [
"backstage",
"techdocs"
],
"license": "Apache-2.0",
"main": "dist/index.cjs.js",
"scripts": {
"build": "backstage-cli build --outputs cjs",
"lint": "backstage-cli lint",
"test": "backstage-cli test --passWithNoTests",
"clean": "backstage-cli clean",
"start": "nodemon --"
},
"bin": {
"techdocs": "bin/techdocs-cli"
},
"devDependencies": {
"@backstage/cli": "^0.1.1-alpha.9"
},
"files": [
"bin",
"dist/**/*.js"
],
"nodemonConfig": {
"watch": "./src",
"exec": "bin/techdocs-cli",
"ext": "ts"
}
}
+17
View File
@@ -0,0 +1,17 @@
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const techDocsCli = () => {};