@kmlckj/licos-ai-cli 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__templates__/expo/_npmrc +1 -1
- package/lib/__templates__/expo/_pnpmrc +1 -1
- package/lib/__templates__/expo/client/package.json +0 -1
- package/lib/__templates__/nextjs/_npmrc +1 -1
- package/lib/__templates__/nextjs/_pnpmrc +1 -1
- package/lib/__templates__/nuxt-vue/_npmrc +1 -1
- package/lib/__templates__/nuxt-vue/_pnpmrc +1 -1
- package/lib/__templates__/nuxt-vue/nuxt.config.ts +1 -1
- package/lib/__templates__/nuxt-vue/scripts/dev.sh +1 -1
- package/lib/__templates__/nuxt-vue/scripts/start.sh +1 -1
- package/lib/__templates__/taro/_npmrc +1 -1
- package/lib/__templates__/taro/_pnpmrc +1 -1
- package/lib/__templates__/vite/_npmrc +1 -1
- package/lib/__templates__/vite/_pnpmrc +1 -1
- package/lib/cli.js +96 -2
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
registry=https://registry.npmmirror.com/
|
|
2
|
-
@kmlckj:registry=https://registry.
|
|
2
|
+
@kmlckj:registry=https://registry.npmmirror.com/
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
"private": true,
|
|
6
6
|
"scripts": {
|
|
7
7
|
"check-deps": "npx depcheck",
|
|
8
|
-
"postinstall": "npm run install-missing",
|
|
9
8
|
"install-missing": "node ./scripts/install-missing-deps.js",
|
|
10
9
|
"lint": "tsc --noEmit; eslint ./ -f ./scripts/formatter.mjs --quiet",
|
|
11
10
|
"start": "expo start --web --clear",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
registry=https://registry.npmmirror.com/
|
|
2
|
-
@kmlckj:registry=https://registry.
|
|
2
|
+
@kmlckj:registry=https://registry.npmmirror.com/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
registry=https://registry.npmmirror.com/
|
|
2
|
-
@kmlckj:registry=https://registry.
|
|
2
|
+
@kmlckj:registry=https://registry.npmmirror.com/
|
|
@@ -67,7 +67,7 @@ export default defineNuxtConfig({
|
|
|
67
67
|
// Development server configuration
|
|
68
68
|
devServer: {
|
|
69
69
|
port: parseInt(process.env.PORT || '<%= port %>', 10),
|
|
70
|
-
host: process.env.
|
|
70
|
+
host: process.env.HOST || '0.0.0.0',
|
|
71
71
|
},
|
|
72
72
|
|
|
73
73
|
// TypeScript configuration
|
|
@@ -14,7 +14,7 @@ DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-$PORT}"
|
|
|
14
14
|
start_service() {
|
|
15
15
|
cd "${PROJECT_DIR}"
|
|
16
16
|
echo "Starting Nuxt.js service on port ${DEPLOY_RUN_PORT} for production..."
|
|
17
|
-
PORT=${DEPLOY_RUN_PORT} node .output/server/index.mjs
|
|
17
|
+
HOST=0.0.0.0 PORT=${DEPLOY_RUN_PORT} node .output/server/index.mjs
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
echo "Starting Nuxt.js service on port ${DEPLOY_RUN_PORT} for production..."
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
registry=https://registry.npmmirror.com/
|
|
2
|
-
@kmlckj:registry=https://registry.
|
|
2
|
+
@kmlckj:registry=https://registry.npmmirror.com/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
registry=https://registry.npmmirror.com/
|
|
2
|
-
@kmlckj:registry=https://registry.
|
|
2
|
+
@kmlckj:registry=https://registry.npmmirror.com/
|
package/lib/cli.js
CHANGED
|
@@ -2107,7 +2107,7 @@ const EventBuilder = {
|
|
|
2107
2107
|
};
|
|
2108
2108
|
|
|
2109
2109
|
var name = "@kmlckj/licos-ai-cli";
|
|
2110
|
-
var version = "0.0.
|
|
2110
|
+
var version = "0.0.21";
|
|
2111
2111
|
var description = "LICOS AI coding workspace CLI - project template engine and dev tools";
|
|
2112
2112
|
var license = "MIT";
|
|
2113
2113
|
var author = "kmlckj";
|
|
@@ -5811,6 +5811,10 @@ const loadLicosConfig = async (
|
|
|
5811
5811
|
try {
|
|
5812
5812
|
content = await fs$1.readFile(licosConfigPath, 'utf-8');
|
|
5813
5813
|
} catch (error) {
|
|
5814
|
+
const recoveredConfig = await recoverLicosConfig(projectPath);
|
|
5815
|
+
if (recoveredConfig) {
|
|
5816
|
+
return recoveredConfig;
|
|
5817
|
+
}
|
|
5814
5818
|
throw new Error(
|
|
5815
5819
|
`.licos config file not found in ${projectPath}\n` +
|
|
5816
5820
|
'Please ensure you are in a project directory initialized with licos-coding.\n' +
|
|
@@ -5968,6 +5972,96 @@ const detectTemplateKey = async (
|
|
|
5968
5972
|
}
|
|
5969
5973
|
};
|
|
5970
5974
|
|
|
5975
|
+
const resolveProjectScriptCommand = (
|
|
5976
|
+
projectPath,
|
|
5977
|
+
scriptPath,
|
|
5978
|
+
fallback,
|
|
5979
|
+
) => {
|
|
5980
|
+
if (fs.existsSync(path.join(projectPath, scriptPath))) {
|
|
5981
|
+
return ['bash', `./${scriptPath.replace(/\\/g, '/')}`];
|
|
5982
|
+
}
|
|
5983
|
+
|
|
5984
|
+
return fallback;
|
|
5985
|
+
};
|
|
5986
|
+
|
|
5987
|
+
const createFallbackLicosConfig = async (
|
|
5988
|
+
projectPath,
|
|
5989
|
+
) => {
|
|
5990
|
+
const template = await detectTemplateKey(projectPath);
|
|
5991
|
+
if (!template) {
|
|
5992
|
+
return null;
|
|
5993
|
+
}
|
|
5994
|
+
|
|
5995
|
+
const common = {
|
|
5996
|
+
project: {
|
|
5997
|
+
requires: ['nodejs-24'],
|
|
5998
|
+
template,
|
|
5999
|
+
version: packageJson.version,
|
|
6000
|
+
appliedPatches: [],
|
|
6001
|
+
},
|
|
6002
|
+
};
|
|
6003
|
+
|
|
6004
|
+
if (template === 'expo') {
|
|
6005
|
+
return {
|
|
6006
|
+
...common,
|
|
6007
|
+
dev: {
|
|
6008
|
+
build: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/dev_build.sh', ['pnpm', 'install']),
|
|
6009
|
+
run: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/dev_run.sh', ['pnpm', 'dev']),
|
|
6010
|
+
},
|
|
6011
|
+
deploy: {
|
|
6012
|
+
build: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/prod_build.sh', ['pnpm', 'build']),
|
|
6013
|
+
run: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/prod_run.sh', ['pnpm', 'start']),
|
|
6014
|
+
},
|
|
6015
|
+
};
|
|
6016
|
+
}
|
|
6017
|
+
|
|
6018
|
+
if (template === 'taro') {
|
|
6019
|
+
return {
|
|
6020
|
+
...common,
|
|
6021
|
+
dev: {
|
|
6022
|
+
build: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/dev_build.sh', ['pnpm', 'install']),
|
|
6023
|
+
run: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/dev_run.sh', ['pnpm', 'dev']),
|
|
6024
|
+
},
|
|
6025
|
+
deploy: {
|
|
6026
|
+
build: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/deploy_build.sh', ['pnpm', 'build']),
|
|
6027
|
+
run: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/deploy_run.sh', ['pnpm', 'start']),
|
|
6028
|
+
},
|
|
6029
|
+
};
|
|
6030
|
+
}
|
|
6031
|
+
|
|
6032
|
+
const fallbackDevRun =
|
|
6033
|
+
template === 'nextjs'
|
|
6034
|
+
? ['pnpm', 'dev', '--hostname', '0.0.0.0', '-p', '${LICOS_RUN_PORT:-5000}']
|
|
6035
|
+
: ['pnpm', 'dev', '--', '--host', '0.0.0.0'];
|
|
6036
|
+
|
|
6037
|
+
return {
|
|
6038
|
+
...common,
|
|
6039
|
+
dev: {
|
|
6040
|
+
build: resolveProjectScriptCommand(projectPath, 'scripts/prepare.sh', ['pnpm', 'install']),
|
|
6041
|
+
run: resolveProjectScriptCommand(projectPath, 'scripts/dev.sh', fallbackDevRun),
|
|
6042
|
+
},
|
|
6043
|
+
deploy: {
|
|
6044
|
+
build: resolveProjectScriptCommand(projectPath, 'scripts/build.sh', ['pnpm', 'build']),
|
|
6045
|
+
run: resolveProjectScriptCommand(projectPath, 'scripts/start.sh', ['pnpm', 'start']),
|
|
6046
|
+
},
|
|
6047
|
+
};
|
|
6048
|
+
};
|
|
6049
|
+
|
|
6050
|
+
const recoverLicosConfig = async (
|
|
6051
|
+
projectPath,
|
|
6052
|
+
) => {
|
|
6053
|
+
const config = await createFallbackLicosConfig(projectPath);
|
|
6054
|
+
if (!config) {
|
|
6055
|
+
return null;
|
|
6056
|
+
}
|
|
6057
|
+
|
|
6058
|
+
logger.warn(
|
|
6059
|
+
`.licos config file not found in ${projectPath}; recovered config for ${config.project.template}`,
|
|
6060
|
+
);
|
|
6061
|
+
await saveTomlLicosConfig(config, projectPath);
|
|
6062
|
+
return config;
|
|
6063
|
+
};
|
|
6064
|
+
|
|
5971
6065
|
const PATCH_FG_ENDPOINT =
|
|
5972
6066
|
'about:blank';
|
|
5973
6067
|
const PATCH_FG_TIMEOUT_MS = 2000;
|
|
@@ -6579,7 +6673,7 @@ const loadExistingTomlConfig = async (
|
|
|
6579
6673
|
try {
|
|
6580
6674
|
await fs$1.access(path.resolve(projectFolder, '.licos'));
|
|
6581
6675
|
} catch (e) {
|
|
6582
|
-
return
|
|
6676
|
+
return recoverLicosConfig(projectFolder);
|
|
6583
6677
|
}
|
|
6584
6678
|
|
|
6585
6679
|
return loadTomlLicosConfig(projectFolder);
|