Skip to content

Commit

Permalink
feat: standalone CLI [SDK-2554] (#1893)
Browse files Browse the repository at this point in the history
* feat: standalone CLI [NONE]

* fix: e2e tests [NONE]

* fix: axios dependency [NONE]
  • Loading branch information
marcolink committed Mar 14, 2023
1 parent 04ed2b8 commit 3bb857a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 8 deletions.
28 changes: 28 additions & 0 deletions .circleci/config.yml
Expand Up @@ -30,6 +30,30 @@ jobs:
- run:
command: npm run test:integration:ci
no_output_timeout: 20m
linux:
docker:
- image: cimg/node:lts
steps:
- run: node --version
- run: npm --version
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run: npm ci
- run: npm run build:standalone
- run: npm run test:e2e
osx:
macos:
xcode: 12.5.1
steps:
- run: node --version
- run: npm --version
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run: npm ci
- run: npm run build:standalone
- run: npm run test:e2e
release:
docker:
- image: cimg/node:lts
Expand Down Expand Up @@ -78,12 +102,16 @@ workflows:
jobs:
- unit
- integration
- linux
- osx
- audit
- release:
context: vault
requires:
- unit
- integration
- linux
- osx
- audit
filters:
branches:
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions package.json
Expand Up @@ -14,6 +14,8 @@
"license": "MIT",
"scripts": {
"audit": "resolve-audit",
"build:standalone": "npm run tsc && pkg .",
"build:package": "npm run build:standalone && script/package",
"lint": "eslint bin lib test",
"test": "npm run test:coverage",
"test:coverage": "nyc npm run test:unit",
Expand Down Expand Up @@ -64,7 +66,7 @@
"lint-staged": "^13.0.0",
"nixt": "^0.5.1",
"nyc": "^15.0.0",
"pkg": "^5.0.0",
"pkg": "^5.8.1",
"rimraf": "^3.0.2",
"semantic-release": "^20.1.1",
"stream-buffers": "^3.0.2",
Expand Down Expand Up @@ -139,11 +141,18 @@
}
},
"pkg": {
"targets": [
"node18-macos-x64",
"node18-linux-x64",
"node18-win-x64"
],
"outputPath": "build",
"scripts": [
"./output/**/*.js"
"./dist/**/*.js"
],
"assets": [
"./node_modules/figlet/fonts/Standard.flf"
"./node_modules/figlet/fonts/Standard.flf",
"./node_modules/axios/dist/node/axios.cjs"
]
},
"lint-staged": {
Expand Down
16 changes: 12 additions & 4 deletions test/e2e/__snapshots__/basics.test.js.snap
Expand Up @@ -8,16 +8,18 @@ Commands:
config Manage and list your configs
content-type Manage and list your space content types [aliases: ct]
extension Manage and list your extensions
init Get started with Contentful
login Login to Contentful
logout Logout from Contentful
merge A CLI version of the merge app
organization Manage and list your organizations
space Manage and list your spaces
Options:
-h, --help Show help [boolean]
-v, --version Show current version [boolean]
Copyright 2013 Contentful"
Copyright 2023 Contentful"
`;
exports[`should print help message on shortcut 1`] = `
Expand All @@ -28,16 +30,18 @@ Commands:
config Manage and list your configs
content-type Manage and list your space content types [aliases: ct]
extension Manage and list your extensions
init Get started with Contentful
login Login to Contentful
logout Logout from Contentful
merge A CLI version of the merge app
organization Manage and list your organizations
space Manage and list your spaces
Options:
-h, --help Show help [boolean]
-v, --version Show current version [boolean]
Copyright 2013 Contentful"
Copyright 2023 Contentful"
`;
exports[`should print help message on wrong subcommand 1`] = `
Expand All @@ -48,16 +52,18 @@ Commands:
config Manage and list your configs
content-type Manage and list your space content types [aliases: ct]
extension Manage and list your extensions
init Get started with Contentful
login Login to Contentful
logout Logout from Contentful
merge A CLI version of the merge app
organization Manage and list your organizations
space Manage and list your spaces
Options:
-h, --help Show help [boolean]
-v, --version Show current version [boolean]
Copyright 2013 Contentful
Copyright 2023 Contentful
Please specify a command."
`;
Expand All @@ -69,15 +75,17 @@ Commands:
config Manage and list your configs
content-type Manage and list your space content types [aliases: ct]
extension Manage and list your extensions
init Get started with Contentful
login Login to Contentful
logout Logout from Contentful
merge A CLI version of the merge app
organization Manage and list your organizations
space Manage and list your spaces
Options:
-h, --help Show help [boolean]
-v, --version Show current version [boolean]
Copyright 2013 Contentful
Copyright 2023 Contentful
Please specify a command."
`;

0 comments on commit 3bb857a

Please sign in to comment.