@coze-arch/cli 0.1.5 → 0.1.8-alpha.2ee669
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/README.md +18 -0
- package/docs/deploy.md +12 -1
- package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +3 -3
- package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +11 -3
- package/lib/__templates__/expo/.cozeproj/scripts/prepare-node-modules.sh +380 -0
- package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +3 -3
- package/lib/__templates__/expo/client/components/Screen.tsx +65 -25
- package/lib/__templates__/expo/client/heroui/components/toast/toast.tsx +6 -2
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-controllable-state.ts +1 -1
- package/lib/__templates__/native-static/.coze +2 -2
- package/lib/__templates__/nextjs/.coze +1 -1
- package/lib/__templates__/nextjs/README.md +18 -0
- package/lib/__templates__/nextjs/eslint.config.mjs +11 -5
- package/lib/__templates__/nextjs/next.config.ts +10 -0
- package/lib/__templates__/nextjs/package.json +2 -5
- package/lib/__templates__/nextjs/pnpm-lock.yaml +14 -945
- package/lib/__templates__/nextjs/scripts/build.ps1 +1 -1
- package/lib/__templates__/nextjs/scripts/build.sh +1 -1
- package/lib/__templates__/nextjs/scripts/dev.ps1 +2 -2
- package/lib/__templates__/nextjs/scripts/dev.sh +70 -12
- package/lib/__templates__/nextjs/scripts/local-workspace.cjs +302 -0
- package/lib/__templates__/nextjs/scripts/prepare-node-modules.sh +380 -0
- package/lib/__templates__/nextjs/scripts/prepare.sh +9 -4
- package/lib/__templates__/nextjs/scripts/validate.sh +11 -1
- package/lib/__templates__/nextjs/src/app/layout.tsx +0 -4
- package/lib/__templates__/nextjs/src/server.ts +1 -1
- package/lib/__templates__/nextjs/template.config.js +20 -6
- package/lib/__templates__/nextjs/tsconfig.json +0 -1
- package/lib/__templates__/nuxt-vue/.coze +1 -1
- package/lib/__templates__/nuxt-vue/README.md +20 -2
- package/lib/__templates__/nuxt-vue/scripts/dev.sh +21 -7
- package/lib/__templates__/nuxt-vue/scripts/local-workspace.cjs +302 -0
- package/lib/__templates__/nuxt-vue/scripts/prepare-node-modules.sh +380 -0
- package/lib/__templates__/nuxt-vue/scripts/prepare.sh +9 -4
- package/lib/__templates__/nuxt-vue/scripts/validate.sh +11 -1
- package/lib/__templates__/taro/.coze +2 -2
- package/lib/__templates__/taro/.cozeproj/scripts/deploy_build.sh +10 -1
- package/lib/__templates__/taro/.cozeproj/scripts/deploy_run.sh +4 -0
- package/lib/__templates__/taro/.cozeproj/scripts/dev_build.sh +12 -0
- package/lib/__templates__/taro/.cozeproj/scripts/dev_run.ps1 +4 -2
- package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +84 -10
- package/lib/__templates__/taro/.cozeproj/scripts/init_env.sh +4 -0
- package/lib/__templates__/taro/.cozeproj/scripts/local-workspace.cjs +351 -0
- package/lib/__templates__/taro/.cozeproj/scripts/pack.ps1 +3 -1
- package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +24 -6
- package/lib/__templates__/taro/.cozeproj/scripts/prepare-node-modules.sh +380 -0
- package/lib/__templates__/taro/.cozeproj/scripts/taro-build.cjs +66 -0
- package/lib/__templates__/taro/.cozeproj/scripts/validate.ps1 +3 -1
- package/lib/__templates__/taro/.cozeproj/scripts/validate.sh +7 -0
- package/lib/__templates__/taro/_gitignore +1 -0
- package/lib/__templates__/taro/package.json +5 -5
- package/lib/__templates__/vite/.coze +1 -1
- package/lib/__templates__/vite/README.md +20 -0
- package/lib/__templates__/vite/scripts/dev.ps1 +2 -2
- package/lib/__templates__/vite/scripts/dev.sh +21 -7
- package/lib/__templates__/vite/scripts/local-workspace.cjs +302 -0
- package/lib/__templates__/vite/scripts/prepare-node-modules.sh +380 -0
- package/lib/__templates__/vite/scripts/prepare.sh +9 -4
- package/lib/__templates__/vite/scripts/validate.sh +7 -1
- package/lib/__templates__/vite/template.config.js +20 -6
- package/lib/cli.js +511 -199
- package/package.json +3 -2
- package/lib/__templates__/nextjs/.babelrc +0 -15
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
set -Eeuo pipefail
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
# Resolve the source project from this script, then let the Web runner choose its local mirror.
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
6
|
+
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd -P)"
|
|
7
|
+
if [[ "${COZE_WEB_LOCAL_ACTIVE:-}" != "${PROJECT_ROOT}" ]]; then
|
|
8
|
+
exec node "${SCRIPT_DIR}/local-workspace.cjs" prepare "$@"
|
|
9
|
+
fi
|
|
10
|
+
COZE_WORKSPACE_PATH="${PROJECT_ROOT}"
|
|
5
11
|
|
|
6
12
|
cd "${COZE_WORKSPACE_PATH}"
|
|
7
13
|
|
|
8
14
|
echo "Installing dependencies..."
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
coze-dev check-bins --fix
|
|
15
|
+
if [[ "${COZE_WEB_LOCAL_MIRROR:-}" != "1" ]]; then
|
|
16
|
+
bash "$COZE_WORKSPACE_PATH/scripts/prepare-node-modules.sh" --prefer-frozen-lockfile --prefer-offline --loglevel debug --reporter=append-only
|
|
12
17
|
fi
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
set -Eeuo pipefail
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
# Resolve the source project from this script, then let the Web runner choose its local mirror.
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
6
|
+
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd -P)"
|
|
7
|
+
if [[ "${COZE_WEB_LOCAL_ACTIVE:-}" != "${PROJECT_ROOT}" ]]; then
|
|
8
|
+
exec node "${SCRIPT_DIR}/local-workspace.cjs" validate "$@"
|
|
9
|
+
fi
|
|
10
|
+
COZE_WORKSPACE_PATH="${PROJECT_ROOT}"
|
|
5
11
|
|
|
6
12
|
cd "${COZE_WORKSPACE_PATH}"
|
|
7
13
|
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
import { spawn } from 'child_process';
|
|
3
|
-
import { resolve, join, basename } from 'path';
|
|
4
|
-
import {
|
|
3
|
+
import { resolve, join, basename, sep } from 'path';
|
|
4
|
+
import {
|
|
5
|
+
appendFileSync,
|
|
6
|
+
openSync,
|
|
7
|
+
closeSync,
|
|
8
|
+
mkdirSync,
|
|
9
|
+
existsSync,
|
|
10
|
+
realpathSync,
|
|
11
|
+
} from 'fs';
|
|
5
12
|
import { homedir } from 'os';
|
|
6
13
|
|
|
7
14
|
|
|
@@ -74,12 +81,19 @@ const config = {
|
|
|
74
81
|
|
|
75
82
|
const cmd = 'pnpm';
|
|
76
83
|
const args = ['update', 'coze-coding-dev-sdk@^0.7.28'];
|
|
77
|
-
console.log(
|
|
78
|
-
`\nTriggering: ${cmd} ${args.join(' ')} (running in background)`,
|
|
79
|
-
);
|
|
80
84
|
|
|
81
85
|
try {
|
|
82
|
-
const projectRoot =
|
|
86
|
+
const projectRoot = realpathSync(outputPath);
|
|
87
|
+
const drivePath = resolve(process.env.COZE_DRIVE_ROOT || '/Coze/Drive');
|
|
88
|
+
const driveRoot = existsSync(drivePath) ? realpathSync(drivePath) : drivePath;
|
|
89
|
+
if (projectRoot === driveRoot || projectRoot.startsWith(`${driveRoot}${sep}`)) {
|
|
90
|
+
// Cloud projects install through prepare.sh in the local development mirror.
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
console.log(
|
|
95
|
+
`\nTriggering: ${cmd} ${args.join(' ')} (running in background)`,
|
|
96
|
+
);
|
|
83
97
|
|
|
84
98
|
// Determine log directory
|
|
85
99
|
const cozeHome = process.env.COZE_HOME || join(homedir(), '.coze');
|