mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
chore: update CLI to use npm package for Common, adjust TypeScript config, and add CI workflow
- Changed dependency for Common in CLI package.json to use npm package @oneuptime/common@latest. - Updated tsconfig.json to exclude Tests, build, node_modules, and jest.config.json. - Modified PublishAllPackages.sh to replace Common dependency with the pinned version during publish. - Added GitHub Actions workflow for testing CLI on pull requests and pushes.
This commit is contained in:
19
.github/workflows/compile.yml
vendored
19
.github/workflows/compile.yml
vendored
@@ -420,4 +420,21 @@ jobs:
|
||||
with:
|
||||
timeout_minutes: 30
|
||||
max_attempts: 3
|
||||
command: cd AIAgent && npm install && npm run compile && npm run dep-check
|
||||
command: cd AIAgent && npm install && npm run compile && npm run dep-check
|
||||
|
||||
compile-cli:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- name: Compile CLI
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_minutes: 30
|
||||
max_attempts: 3
|
||||
command: cd CLI && npm install && npm run compile && npm run dep-check
|
||||
21
.github/workflows/test.cli.yaml
vendored
Normal file
21
.github/workflows/test.cli.yaml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: CLI Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*' # excludes hotfix branches
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd CLI && npm install && npm run test
|
||||
13468
CLI/package-lock.json
generated
13468
CLI/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,7 @@
|
||||
"author": "OneUptime <hello@oneuptime.com> (https://oneuptime.com/)",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"Common": "file:../Common",
|
||||
"Common": "npm:@oneuptime/common@latest",
|
||||
"commander": "^12.1.0",
|
||||
"chalk": "^4.1.2",
|
||||
"cli-table3": "^0.6.5",
|
||||
|
||||
@@ -39,5 +39,6 @@
|
||||
"noPropertyAccessFromIndexSignature": true,
|
||||
"skipLibCheck": true,
|
||||
"resolveJsonModule": true
|
||||
}
|
||||
},
|
||||
"exclude": ["Tests", "build", "node_modules", "jest.config.json"]
|
||||
}
|
||||
|
||||
@@ -35,8 +35,9 @@ publish_to_npm() {
|
||||
|
||||
npm version $package_version
|
||||
|
||||
# Before npm install, replace "Common": "file:../Common" with "@oneuptime/common": "$package_version" in package.json
|
||||
# Replace any Common dependency with the pinned version being published
|
||||
sed -i "s/\"Common\": \"file:..\/Common\"/\"Common\": \"npm:@oneuptime\/common@$package_version\"/g" package.json
|
||||
sed -i "s/\"Common\": \"npm:@oneuptime\/common@latest\"/\"Common\": \"npm:@oneuptime\/common@$package_version\"/g" package.json
|
||||
|
||||
npm install
|
||||
npm run compile
|
||||
@@ -46,4 +47,8 @@ publish_to_npm() {
|
||||
}
|
||||
|
||||
|
||||
# Publish Common first - other packages depend on it
|
||||
publish_to_npm "Common"
|
||||
|
||||
# Publish packages that depend on Common (after Common is available on npm)
|
||||
publish_to_npm "CLI"
|
||||
|
||||
Reference in New Issue
Block a user