Skip to content
Draft
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 --frozen-lockfile
- run: pnpm -r --sort --workspace-concurrency=1 run build
- run: pnpm run lint
55 changes: 21 additions & 34 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,35 @@
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
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.28.0 # or your local pnpm version

- name: Set up Node.js
uses: actions/setup-node@v4
version: 10.28.0
- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'pnpm' # optional but recommended

# - name: Temporarily disable contentstack package
# run: mv packages/contentstack/package.json packages/contentstack/package.json.disabled || true

- name: Install Dependencies (Excluding Contentstack)
run: pnpm install --no-frozen-lockfile

- name: Build all plugins (Excluding Contentstack)
run: |
NODE_ENV=PREPACK_MODE pnpm -r --sort run build

# - name: Restore contentstack package
# run: mv packages/contentstack/package.json.disabled packages/contentstack/package.json || true

- name: Run tests for Contentstack Command
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm -r --sort --workspace-concurrency=1 run build
- name: Test contentstack
working-directory: ./packages/contentstack
run: pnpm test
- name: Test contentstack-command
working-directory: ./packages/contentstack-command
run: npm run test:unit

- name: Run tests for Contentstack Config
run: pnpm test
- name: Test contentstack-config
working-directory: ./packages/contentstack-config
run: npm run test:unit

- name: Run tests for Contentstack Auth
run: pnpm test
- name: Test contentstack-auth
working-directory: ./packages/contentstack-auth
run: NODE_ENV=PREPACK_MODE npm run test:unit
run: pnpm test
- name: Test contentstack-utilities
working-directory: ./packages/contentstack-utilities
run: pnpm test
10 changes: 0 additions & 10 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
fileignoreconfig:
- filename: packages/contentstack-bootstrap/src/bootstrap/utils.ts
checksum: 6e6fb00bb11b03141e5ad27eeaa4af9718dc30520c3e73970bc208cc0ba2a7d2
- filename: .github/workflows/release.yml
checksum: 73807361b1a862dc882846ac75fefca49e3c734db032e9aa80158f2a686bea13
- filename: pnpm-lock.yaml
checksum: 45b77e385a0b13c82ba125dcdc82d27a360132ff6edda801cd8b75943996c310
- filename: packages/contentstack-auth/src/commands/auth/logout.ts
checksum: 20ff708d5a0ee56eb8786b19df07b49dacaddfa1deafe99c0397716c7865726d
version: '1.0'
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"clean:packages": "pnpm -r --filter './packages/*' run clean",
"build": "pnpm -r --filter './packages/*' run build",
"test": "pnpm -r --filter './packages/*' run test",
"lint": "pnpm -r --filter './packages/*' run lint",
"prepack": "pnpm -r --filter './packages/*' run prepack",
"bootstrap": "pnpm install",
"clean:modules": "rm -rf node_modules packages/**/node_modules",
Expand Down
12 changes: 6 additions & 6 deletions packages/contentstack-auth/.mocharc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"require": [
"test/helpers/init.js",
"ts-node/register",
"ts-node/register/transpile-only",
"source-map-support/register"
],
"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"
]
}
2 changes: 1 addition & 1 deletion packages/contentstack-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-auth
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-auth/1.8.0-beta.0 darwin-arm64 node-v22.13.1
@contentstack/cli-auth/1.8.0-beta.0 darwin-arm64 node-v24.13.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
11 changes: 2 additions & 9 deletions packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,8 @@
"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": "~1.8.0-beta.0",
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman

if (!isDelivery && !isManagement && !Boolean(environment)) {
log.debug('No token type specified, requesting user input', this.contextDetails);
let tokenType = await askTokenType();
const tokenType = await askTokenType();
isDelivery = tokenType === 'delivery';
isManagement = tokenType === 'management';
log.debug(`Token type selected: ${tokenType}`, this.contextDetails);
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/src/utils/auth-handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cliux, log, handleAndLogError, messageHandler } from '@contentstack/cli-utilities';
import { cliux, log, messageHandler } from '@contentstack/cli-utilities';
import { User } from '../interfaces';
import { askOTPChannel, askOTP } from './interactive';

Expand Down
3 changes: 1 addition & 2 deletions packages/contentstack-auth/src/utils/mfa-handler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { cliux, configHandler, NodeCrypto, log, handleAndLogError, messageHandler } from '@contentstack/cli-utilities';
import { cliux, NodeCrypto, log } from '@contentstack/cli-utilities';
import { authenticator } from 'otplib';
import { askOTP } from './interactive';

/**
* @class
Expand Down
155 changes: 0 additions & 155 deletions packages/contentstack-auth/test/integration/auth.test.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/contentstack-auth/test/integration/config.json

This file was deleted.

Loading
Loading