Skip to content

Commit 7c8667e

Browse files
authored
Merge pull request #92 from launchcodedev/cli-package
Adds @app-config/cli package for ergonomics
2 parents 7db3c11 + 8b5a623 commit 7c8667e

File tree

8 files changed

+81
-0
lines changed

8 files changed

+81
-0
lines changed

app-config-cli/.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@lcdev/eslint-config/cwd')(__dirname);

app-config-cli/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## App Config CLI
2+
3+
This is a package for the CLI portion of App Config. It's also accesible through the main package.
4+
5+
```shell
6+
# these two are essentially the same thing
7+
8+
npx @app-config/cli
9+
10+
npx @lcdev/app-config
11+
```

app-config-cli/package.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "@app-config/cli",
3+
"description": "CLI for @lcdev/app-config",
4+
"version": "2.0.2",
5+
"license": "MPL-2.0",
6+
"author": {
7+
"name": "Launchcode",
8+
"email": "[email protected]",
9+
"url": "https://lc.dev"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "https://github.com/launchcodedev/app-config.git"
14+
},
15+
"main": "dist/index.js",
16+
"module": "dist/es/index.js",
17+
"types": "dist/index.d.ts",
18+
"files": [
19+
"/dist",
20+
"!*.tsbuildinfo",
21+
"!*.test.*"
22+
],
23+
"bin": {
24+
"app-config": "dist/index.js"
25+
},
26+
"scripts": {
27+
"build": "tsc -b",
28+
"build:es": "tsc -b tsconfig.es.json",
29+
"clean": "rm -rf dist *.tsbuildinfo",
30+
"lint": "eslint src",
31+
"fix": "eslint --fix src",
32+
"test": "jest --passWithNoTests",
33+
"prepublishOnly": "yarn clean && yarn build && yarn build:es"
34+
},
35+
"dependencies": {
36+
"@lcdev/app-config": "2"
37+
},
38+
"devDependencies": {},
39+
"prettier": "@lcdev/prettier",
40+
"jest": {
41+
"preset": "@lcdev/jest"
42+
}
43+
}

app-config-cli/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env node
2+
3+
import { cli } from '@lcdev/app-config/dist/cli';
4+
5+
cli.parse();

app-config-cli/tsconfig.es.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"target": "es2020",
5+
"module": "es2020",
6+
"outDir": "./dist/es"
7+
}
8+
}

app-config-cli/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "@lcdev/tsconfig",
3+
"compilerOptions": {
4+
"rootDir": "./src",
5+
"outDir": "./dist"
6+
},
7+
"include": ["src/**/*"],
8+
"exclude": ["node_modules"]
9+
}

new-version.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ replace_version_references() {
3535
sed -i "s#[\"]@lcdev\\/app-config[\"]: [\"]2 || $PREV_VERSION[\"]#\"@lcdev\\/app-config\": \"2 || $VERSION\"#g" $@
3636
sed -i "s#[\"]@lcdev\\/app-config[\"]: [\"]1 || 2 || $PREV_VERSION[\"]#\"@lcdev\\/app-config\": \"1 || 2 || $VERSION\"#g" $@
3737

38+
sed -i "s#[\"]@lcdev\\/app-config-cli[\"]: [\"]$PREV_VERSION[\"]#\"@lcdev\\/app-config-cli\": \"$VERSION\"#g" $@
3839
sed -i "s#[\"]@lcdev\\/app-config-webpack-plugin[\"]: [\"]$PREV_VERSION[\"]#\"@lcdev\\/app-config-webpack-plugin\": \"$VERSION\"#g" $@
3940
sed -i "s#[\"]@lcdev\\/app-config-inject[\"]: [\"]$PREV_VERSION[\"]#\"@lcdev\\/app-config-inject\": \"$VERSION\"#g" $@
4041
sed -i "s#[\"]@lcdev\\/app-config-vault[\"]: [\"]$PREV_VERSION[\"]#\"@lcdev\\/app-config-vault\": \"$VERSION\"#g" $@
@@ -44,11 +45,13 @@ replace_version_references() {
4445
}
4546

4647
new_version ./app-config
48+
new_version ./app-config-cli
4749
new_version ./app-config-webpack-plugin
4850
new_version ./app-config-inject
4951
new_version ./app-config-vault
5052
new_version ./app-config-react-native-transformer
5153

54+
replace_version_references ./app-config-cli/package.json
5255
replace_version_references ./app-config-webpack-plugin/package.json
5356
replace_version_references ./app-config-inject/package.json
5457
replace_version_references ./app-config-react-native-transformer/package.json

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"workspaces": {
66
"packages": [
77
"app-config",
8+
"app-config-cli",
89
"app-config-webpack-plugin",
910
"app-config-inject",
1011
"app-config-react-native-transformer",

0 commit comments

Comments
 (0)