Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions apps/cli/node-sea.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"main": "dist/apps/cli/main.cjs",
"assets": {
"main.js.map": "dist/apps/cli/main.cjs.map"
},
"output": "sea-prep.blob",
"disableExperimentalSEAWarning": true
}
46 changes: 22 additions & 24 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,41 @@
"@types/express": "^5.0.3",
"@types/js-yaml": "^4.0.9",
"@types/lodash-es": "catalog:",
"@types/supertest": "^7.2.0",
"@types/pluralize": "^0.0.33",
"@types/qs": "^6.9.15",
"@types/signale": "^1.4.7",
"@types/semver": "catalog:",
"@types/signale": "^1.4.7",
"@types/supertest": "^7.2.0",
"@types/source-map-support": "^0.5.10",
"semver": "catalog:",
"supertest": "^7.1.4",
"vitest": "catalog:",
"semver": "catalog:"
"vitest": "catalog:"
},
"dependencies": {
"@api7/adc-sdk": "workspace:*",
"@api7/adc-backend-api7": "workspace:*",
"@api7/adc-backend-apisix": "workspace:*",
"@api7/adc-backend-apisix-standalone": "workspace:*",
"@api7/adc-converter-openapi": "workspace:*",
"@api7/adc-differ": "workspace:*",
"express": "^5.1.0",
"winston": "^3.17.0",
"@api7/adc-sdk": "workspace:*",
"agentkeepalive": "^4.6.0",
"axios": "catalog:",
"rxjs": "catalog:",
"lodash-es": "catalog:",
"zod": "catalog:",
"pluralize": "^8.0.0",
"listr2": "catalog:",
"commander": "^14.0.3",
"chalk": "^5.6.2",
"commander": "^14.0.3",
"dotenv": "^17.3.1",
"express": "^5.1.0",
"glob": "^13.0.0",
"js-yaml": "catalog:",
"listr2": "catalog:",
"lodash-es": "catalog:",
"parse-duration": "^2.1.5",
"pluralize": "^8.0.0",
"qs": "^6.14.1",
"dotenv": "^17.3.1",
"agentkeepalive": "^4.6.0",
"rxjs": "catalog:",
"signale": "^1.4.0",
"glob": "^13.0.0",
"js-yaml": "catalog:"
"source-map-support": "catalog:",
"winston": "^3.17.0",
"zod": "catalog:"
},
"nx": {
"name": "cli",
Expand All @@ -65,15 +67,11 @@
"declarationRootDir": "apps/cli/src",
"bundle": true,
"thirdParty": true,
"sourcemap": "inline"
"sourcemap": "linked"
},
"configurations": {
"development": {
"minify": false
},
"production": {
"minify": true
}
"development": {},
"production": {}
Comment thread
bzp2010 marked this conversation as resolved.
}
},
"lint": {
Expand Down
29 changes: 29 additions & 0 deletions apps/cli/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
import { getAsset, isSea } from 'node:sea';
import sourceMapSupport from 'source-map-support';

import { setupCommands, setupIngressCommands } from './command';

function setupSourceMap() {
if (!isSea()) {
sourceMapSupport.install();
return;
Comment thread
bzp2010 marked this conversation as resolved.
}

try {
const sourceMapFile = getAsset('main.js.map', 'utf-8');
const map = JSON.parse(sourceMapFile);
sourceMapSupport.install({
environment: 'node',
retrieveSourceMap: (source) => {
if (source.startsWith('node:') || source.startsWith('internal'))
return null;
return { url: source, map };
},
});
} catch (err) {
console.warn(
`Failed to load source map for SEA: ${err instanceof Error ? err.message : String(err)}`,
);
}
}
Comment thread
bzp2010 marked this conversation as resolved.

async function bootstrap() {
setupSourceMap();
Comment thread
bzp2010 marked this conversation as resolved.

await (
process.env.ADC_RUNNING_MODE === 'ingress'
? setupIngressCommands()
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"@nx/eslint-plugin": "22.6.3",
"@nx/js": "22.6.3",
"@nx/vitest": "22.6.3",
"@nx/web": "22.6.3",
"@nx/workspace": "22.6.3",
"@swc-node/register": "1.11.1",
Comment thread
bzp2010 marked this conversation as resolved.
"@swc/core": "1.15.8",
Expand Down
Loading
Loading