@coze-arch/cli 0.1.5 → 0.1.8-alpha.6e99f9

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.
Files changed (45) hide show
  1. package/docs/deploy.md +12 -1
  2. package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +3 -3
  3. package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +11 -3
  4. package/lib/__templates__/expo/.cozeproj/scripts/prepare-node-modules.sh +382 -0
  5. package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +3 -3
  6. package/lib/__templates__/expo/client/components/Screen.tsx +65 -25
  7. package/lib/__templates__/expo/client/heroui/components/toast/toast.tsx +6 -2
  8. package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-controllable-state.ts +1 -1
  9. package/lib/__templates__/nextjs/eslint.config.mjs +11 -5
  10. package/lib/__templates__/nextjs/next.config.ts +10 -0
  11. package/lib/__templates__/nextjs/package.json +2 -5
  12. package/lib/__templates__/nextjs/pnpm-lock.yaml +14 -945
  13. package/lib/__templates__/nextjs/scripts/build.ps1 +1 -1
  14. package/lib/__templates__/nextjs/scripts/build.sh +2 -2
  15. package/lib/__templates__/nextjs/scripts/dev.ps1 +2 -2
  16. package/lib/__templates__/nextjs/scripts/dev.sh +93 -10
  17. package/lib/__templates__/nextjs/scripts/prepare-next-dev-output.sh +122 -0
  18. package/lib/__templates__/nextjs/scripts/prepare-node-modules.sh +382 -0
  19. package/lib/__templates__/nextjs/scripts/prepare.sh +1 -4
  20. package/lib/__templates__/nextjs/src/app/layout.tsx +0 -4
  21. package/lib/__templates__/nextjs/src/server.ts +1 -1
  22. package/lib/__templates__/nuxt-vue/scripts/build.sh +1 -1
  23. package/lib/__templates__/nuxt-vue/scripts/dev.sh +11 -3
  24. package/lib/__templates__/nuxt-vue/scripts/prepare-node-modules.sh +382 -0
  25. package/lib/__templates__/nuxt-vue/scripts/prepare.sh +1 -4
  26. package/lib/__templates__/taro/.cozeproj/scripts/deploy_build.sh +5 -1
  27. package/lib/__templates__/taro/.cozeproj/scripts/deploy_run.sh +4 -0
  28. package/lib/__templates__/taro/.cozeproj/scripts/dev_build.sh +3 -0
  29. package/lib/__templates__/taro/.cozeproj/scripts/dev_run.ps1 +4 -2
  30. package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +29 -7
  31. package/lib/__templates__/taro/.cozeproj/scripts/init_env.sh +4 -0
  32. package/lib/__templates__/taro/.cozeproj/scripts/pack.ps1 +3 -1
  33. package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +8 -0
  34. package/lib/__templates__/taro/.cozeproj/scripts/prepare-node-modules.sh +382 -0
  35. package/lib/__templates__/taro/.cozeproj/scripts/validate.ps1 +3 -1
  36. package/lib/__templates__/taro/.cozeproj/scripts/validate.sh +4 -0
  37. package/lib/__templates__/taro/_gitignore +1 -0
  38. package/lib/__templates__/vite/scripts/build.sh +1 -1
  39. package/lib/__templates__/vite/scripts/dev.ps1 +2 -2
  40. package/lib/__templates__/vite/scripts/dev.sh +11 -3
  41. package/lib/__templates__/vite/scripts/prepare-node-modules.sh +382 -0
  42. package/lib/__templates__/vite/scripts/prepare.sh +1 -4
  43. package/lib/cli.js +147 -16
  44. package/package.json +2 -2
  45. package/lib/__templates__/nextjs/.babelrc +0 -15
@@ -23,6 +23,11 @@ const eslintConfig = defineConfig([
23
23
  ...nextVitals,
24
24
  ...nextTs,
25
25
  {
26
+ settings: {
27
+ // node_modules 里的 barrel 包(lucide-react 等)不参与 ExportMap 构建,
28
+ // import/no-cycle 只需要项目源码的依赖图。
29
+ 'import/ignore': ['/node_modules/'],
30
+ },
26
31
  rules: {
27
32
  'import/no-cycle': ['error', { ignoreExternal: true }],
28
33
  'react-hooks/set-state-in-effect': 'off',
@@ -37,14 +42,15 @@ const eslintConfig = defineConfig([
37
42
  },
38
43
  // Override default ignores of eslint-config-next.
39
44
  globalIgnores([
40
- // Default ignores of eslint-config-next:
41
- '.next/**',
42
- 'out/**',
43
- 'build/**',
45
+ // Default ignores of eslint-config-next (trailing slash prunes the whole
46
+ // directory instead of walking into it):
47
+ '.next/',
48
+ 'out/',
49
+ 'build/',
44
50
  'next-env.d.ts',
45
51
  // Build artifacts:
46
52
  'server.js',
47
- 'dist/**',
53
+ 'dist/',
48
54
  // Script files (CommonJS):
49
55
  'scripts/**/*.js',
50
56
  ]),
@@ -1,8 +1,18 @@
1
1
  import type { NextConfig } from 'next';
2
+ import path from 'path';
2
3
 
3
4
  const nextConfig: NextConfig = {
4
5
  // outputFileTracingRoot: path.resolve(__dirname, '../../'), // Uncomment and add 'import path from "path"' if needed
5
6
  /* config options here */
7
+ serverExternalPackages: ['coze-coding-dev-sdk'],
8
+ webpack: (config, { dev }) => {
9
+ if (dev && config.cache && config.cache.type === 'filesystem') {
10
+ config.cache.cacheDirectory = path.resolve(
11
+ 'node_modules/.cache/next-webpack',
12
+ );
13
+ }
14
+ return config;
15
+ },
6
16
  allowedDevOrigins: ['*.dev.coze.site'],
7
17
  images: {
8
18
  remotePatterns: [
@@ -6,7 +6,7 @@
6
6
  "build": "bash ./scripts/build.sh",
7
7
  "dev": "bash ./scripts/dev.sh",
8
8
  "preinstall": "npx only-allow pnpm",
9
- "lint": "eslint",
9
+ "lint": "eslint --cache --cache-location node_modules/.cache/eslint/",
10
10
  "lint:build": "eslint . --quiet",
11
11
  "lint:style": "stylelint \"src/**/*.css\"",
12
12
  "start": "bash ./scripts/start.sh",
@@ -73,17 +73,14 @@
73
73
  "zod": "^4.3.5"
74
74
  },
75
75
  "devDependencies": {
76
- "@react-dev-inspector/babel-plugin": "^2.0.1",
77
- "@react-dev-inspector/middleware": "^2.0.1",
78
76
  "@tailwindcss/postcss": "^4",
79
77
  "@types/node": "^20",
80
78
  "@types/pg": "^8.16.0",
81
79
  "@types/react": "^19",
82
80
  "@types/react-dom": "^19",
83
81
  "eslint": "^9",
84
- "eslint-config-next": "16.3.3",
82
+ "eslint-config-next": "16.1.1",
85
83
  "only-allow": "^1.2.2",
86
- "react-dev-inspector": "^2.0.1",
87
84
  "shadcn": "latest",
88
85
  "stylelint": "^16.4.0",
89
86
  "stylelint-config-standard": "^38.0.0",