feat: Implement draft version of CLI package
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
059c039a8b
commit
c732780672
11
packages/cli/.editorconfig
Normal file
11
packages/cli/.editorconfig
Normal file
@@ -0,0 +1,11 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
1
packages/cli/.eslintignore
Normal file
1
packages/cli/.eslintignore
Normal file
@@ -0,0 +1 @@
|
||||
/dist
|
0
packages/cli/.eslintrc
Normal file
0
packages/cli/.eslintrc
Normal file
16
packages/cli/.github/dependabot.yml
vendored
Normal file
16
packages/cli/.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "npm"
|
||||
versioning-strategy: increase
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
labels:
|
||||
- "dependencies"
|
||||
open-pull-requests-limit: 100
|
||||
pull-request-branch-name:
|
||||
separator: "-"
|
||||
ignore:
|
||||
- dependency-name: "fs-extra"
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
9
packages/cli/.gitignore
vendored
Normal file
9
packages/cli/.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
*-debug.log
|
||||
*-error.log
|
||||
/.nyc_output
|
||||
/dist
|
||||
/lib
|
||||
/package-lock.json
|
||||
/tmp
|
||||
node_modules
|
||||
oclif.manifest.json
|
@@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
const packageJson = require('../package');
|
||||
const version = packageJson.version;
|
||||
|
||||
console.log(`Automatisch@${version} CLI tool`);
|
||||
process.exit(0);
|
||||
const oclif = require('@oclif/core')
|
||||
|
||||
oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'))
|
||||
|
3
packages/cli/bin/automatisch.cmd
Normal file
3
packages/cli/bin/automatisch.cmd
Normal file
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
|
||||
node "%~dp0\automatisch" %*
|
17
packages/cli/bin/dev
Executable file
17
packages/cli/bin/dev
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const oclif = require('@oclif/core')
|
||||
|
||||
const path = require('path')
|
||||
const project = path.join(__dirname, '..', 'tsconfig.json')
|
||||
|
||||
// In dev mode -> use ts-node and dev plugins
|
||||
process.env.NODE_ENV = 'development'
|
||||
|
||||
require('ts-node').register({project})
|
||||
|
||||
// In dev mode, always show stack traces
|
||||
oclif.settings.debug = true;
|
||||
|
||||
// Start the CLI
|
||||
oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
|
3
packages/cli/bin/dev.cmd
Normal file
3
packages/cli/bin/dev.cmd
Normal file
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
|
||||
node "%~dp0\dev" %*
|
@@ -9,28 +9,59 @@
|
||||
}
|
||||
],
|
||||
"homepage": "https://github.com/automatisch/automatisch#readme",
|
||||
"main": "src/cli.js",
|
||||
"directories": {
|
||||
"bin": "bin",
|
||||
"src": "src",
|
||||
"test": "__tests__"
|
||||
"main": "dist/index.js",
|
||||
"bin": {
|
||||
"automatisch": "./bin/automatisch"
|
||||
},
|
||||
"files": [
|
||||
"src",
|
||||
"bin"
|
||||
"/bin",
|
||||
"/dist",
|
||||
"oclif.manifest.json"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/automatisch/automatisch.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint . --ignore-path ../../.eslintignore",
|
||||
"test": "echo \"Error: run tests from root\" && exit 1"
|
||||
"build": "shx rm -rf dist && tsc -b",
|
||||
"lint": "eslint . --ext .ts --config .eslintrc",
|
||||
"postpack": "shx rm -f oclif.manifest.json",
|
||||
"posttest": "yarn lint",
|
||||
"prepack": "yarn build && oclif manifest && oclif readme",
|
||||
"version": "oclif readme && git add README.md"
|
||||
},
|
||||
"dependencies": {
|
||||
"@oclif/core": "^1",
|
||||
"@oclif/plugin-help": "^5",
|
||||
"@oclif/plugin-plugins": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@oclif/test": "^2",
|
||||
"@types/node": "^16.9.4",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-oclif": "^4",
|
||||
"eslint-config-oclif-typescript": "^1.0.2",
|
||||
"globby": "^11",
|
||||
"oclif": "^2",
|
||||
"shx": "^0.3.3",
|
||||
"ts-node": "^10.2.1",
|
||||
"tslib": "^2.3.1",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
"oclif": {
|
||||
"bin": "automatisch",
|
||||
"dirname": "automatisch",
|
||||
"commands": "./dist/commands",
|
||||
"plugins": [
|
||||
"@oclif/plugin-help",
|
||||
"@oclif/plugin-plugins"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/automatisch/automatisch/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "8.7.0"
|
||||
}
|
||||
"types": "dist/index.d.ts"
|
||||
}
|
||||
|
@@ -1,8 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
module.exports = cli;
|
||||
|
||||
function cli() {
|
||||
// TODO
|
||||
}
|
9
packages/cli/src/commands/start.ts
Normal file
9
packages/cli/src/commands/start.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Command } from '@oclif/core';
|
||||
|
||||
export default class Start extends Command {
|
||||
static description = 'Say hello world';
|
||||
|
||||
async run(): Promise<void> {
|
||||
this.log('hello world from start script');
|
||||
}
|
||||
}
|
1
packages/cli/src/index.ts
Normal file
1
packages/cli/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export {run} from '@oclif/core'
|
13
packages/cli/tsconfig.json
Normal file
13
packages/cli/tsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"importHelpers": true,
|
||||
"module": "commonjs",
|
||||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"strict": true,
|
||||
"target": "es2019",
|
||||
"typeRoots": ["node_modules/@types", "./src/types"]
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
5484
packages/cli/yarn.lock
Normal file
5484
packages/cli/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user