Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lint

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.28.0
- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'pnpm'
- run: pnpm install --no-frozen-lockfile
- run: pnpm -r --sort --workspace-concurrency=1 run build
- run: pnpm run lint
2 changes: 1 addition & 1 deletion .github/workflows/policy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
if [ "$license_file_found" = false ]; then
echo "No license file found. Please add a license file to the repository."
exit 1
fi
fi
61 changes: 61 additions & 0 deletions .github/workflows/release-production-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release CLI Core (Production)

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.28.0
- uses: actions/setup-node@v4
with:
node-version: '22.x'

- name: Enable Corepack
run: corepack enable

- name: Install pnpm
run: corepack prepare pnpm@10.28.0 --activate

- name: Clean the repository
run: pnpm run clean:all

- name: Install root dependencies
run: pnpm install --no-frozen-lockfile

- name: Build all packages
run: pnpm -r --sort run build

- name: Reading Configuration
id: release_config
uses: rgarcia-phi/json-to-variables@v1.1.0
with:
filename: .github/config/release.json
prefix: release

- name: Publishing core (Production)
id: publish-core
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack/package.json
tag: latest

- name: Create Core Production Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.publish-core.outputs.version }}
run: |
TAG="core@v${VERSION}"
if gh release view "$TAG" &>/dev/null; then
echo "Release $TAG already exists — skipping."
else
gh release create "$TAG" \
--title "Core Production $VERSION" \
--generate-notes
fi
16 changes: 16 additions & 0 deletions .github/workflows/release-production-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CLI Production Release Pipeline

on:
push:
branches: [main]
workflow_dispatch: # This enables manual triggering

jobs:
plugins:
uses: ./.github/workflows/release-production-platform-plugins.yml
secrets: inherit

core:
needs: plugins
uses: ./.github/workflows/release-production-core.yml
secrets: inherit
70 changes: 70 additions & 0 deletions .github/workflows/release-production-platform-plugins.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release CLI Platform Plugins

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.28.0
- uses: actions/setup-node@v4
with:
node-version: '22.x'

- name: Enable Corepack
run: corepack enable

- name: Install pnpm
run: corepack prepare pnpm@10.28.0 --activate

- name: Clean the repository
run: pnpm run clean:all

- name: Install root dependencies
run: pnpm install --no-frozen-lockfile

- name: Build all plugins
run: pnpm -r --sort run build

- name: Reading Configuration
id: release_config
uses: rgarcia-phi/json-to-variables@v1.1.0
with:
filename: .github/config/release.json
prefix: release

# Utilities
- name: Publishing utilities (Production)
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-utilities/package.json
tag: latest

# Command
- name: Publishing command (Production)
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-command/package.json
tag: latest

# Config
- name: Publishing config (Production)
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-config/package.json
tag: latest

# Auth
- name: Publishing auth (Production)
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/contentstack-auth/package.json
tag: latest
2 changes: 1 addition & 1 deletion .github/workflows/sca-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
args: --fail-on=all --all-projects
json: true
continue-on-error: true
- uses: contentstack/sca-policy@main
- uses: contentstack/sca-policy@main
4 changes: 2 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Run Unit Tests
name: Unit Tests

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
run-tests:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
12 changes: 11 additions & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
fileignoreconfig:
- filename: .github/workflows/release-production-pipeline.yml
checksum: 4aef94feea3ea0538162a9454cfd30457ec85e3123672f0933713e3d113d4504
- filename: packages/contentstack-utilities/src/proxy-helper.ts
checksum: 2169f25563bca3a0fe54edd00c73646ed56d36aa7e8effe904de26b0c1633759
- filename: packages/contentstack-config/test/unit/commands/proxy.test.ts
checksum: b92210826693683300728e7e82e6789f0ad697b17e6b99a8a004c9a041bced00
- filename: packages/contentstack/test/unit/context-handler.test.ts
checksum: 6ef78899d3089685271bd16c156d057c807fd9b8560189387ae44e9576d23095
- filename: packages/contentstack/README.md
checksum: cdd03f1f11ef3ecf04f71ed0a468501633ce92f0d487ee097312644578cb3cdc
- filename: pnpm-lock.yaml
checksum: 840d10a9ef1d60aeb0edd46a5cf8ae8306c9eee321aff72a9bb0e1a7e5031159
checksum: 503b7df2c37c07135396c6013941e3a155c351e0cd14fe62ac65cedf6ff43bbd
version: '1.0'
10 changes: 5 additions & 5 deletions packages/contentstack-auth/.mocharc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"source-map-support/register",
"test/helpers/mocha-root-hooks.js"
],
"watch-extensions": [
"ts"
],
"watch-extensions": ["ts"],
"recursive": true,
"timeout": 5000
}
"reporter": "spec",
"timeout": 10000,
"exit": true
}
2 changes: 1 addition & 1 deletion packages/contentstack-auth/.nycrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"inlcude": [
"include": [
"lib/**/*.js"
]
}
20 changes: 9 additions & 11 deletions packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,21 @@
"postpack": "rm -f oclif.manifest.json",
"prepack": "pnpm compile && oclif manifest && oclif readme",
"version": "oclif readme && git add README.md",
"test:report": "tsc -p test && nyc --reporter=lcov --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
"pretest": "tsc -p test",
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
"posttest": "npm run lint",
"lint": "eslint src/**/*.ts",
"format": "eslint src/**/*.ts --fix",
"test:integration": "mocha --forbid-only \"test/integration/*.test.ts\"",
"test:unit": "mocha --forbid-only \"test/unit/**/*.test.ts\"",
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
"test": "mocha \"test/unit/**/*.test.ts\"",
"lint": "eslint src/**/*.ts"
},
"dependencies": {
"@contentstack/cli-command": "~2.0.0-beta.5",
"@contentstack/cli-utilities": "~2.0.0-beta.5",
"@oclif/core": "^4.3.0",
"@oclif/core": "^4.8.3",
"@oclif/plugin-help": "^6.2.28",
"otplib": "^12.0.1"
},
"overrides": {
"@oclif/core": {
"picomatch": "^4.0.4"
}
},
"devDependencies": {
"@fancy-test/nock": "^0.1.1",
"@oclif/plugin-help": "^6.2.28",
Expand Down Expand Up @@ -81,4 +79,4 @@
}
},
"repository": "contentstack/cli"
}
}
2 changes: 0 additions & 2 deletions packages/contentstack-auth/src/base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import {
configHandler,
createLogContext,
Flags,
getAuthenticationMethod,
Interfaces,
log,
} from '@contentstack/cli-utilities';
import { Context } from './interfaces';

Expand Down
1 change: 0 additions & 1 deletion packages/contentstack-auth/src/commands/auth/login.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
cliux,
CLIError,
authHandler as oauthHandler,
flags,
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface InquirePayload {
name: string;
message: string;
choices?: Array<any>;
transformer?: Function;
transformer?: (value: any) => any;
}

export interface User {
Expand Down
Loading
Loading