@coze-arch/cli 0.0.1-alpha.912cd5 → 0.0.1-alpha.9f719c

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 (38) hide show
  1. package/lib/__templates__/expo/.coze +5 -0
  2. package/lib/__templates__/expo/.cozeproj/scripts/deploy_build.sh +25 -25
  3. package/lib/__templates__/expo/.cozeproj/scripts/deploy_run.sh +31 -56
  4. package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +47 -0
  5. package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +35 -0
  6. package/lib/__templates__/expo/_npmrc +1 -1
  7. package/lib/__templates__/expo/babel.config.js +10 -0
  8. package/lib/__templates__/expo/client/constants/theme.ts +10 -0
  9. package/lib/__templates__/expo/client/contexts/AuthContext.tsx +14 -107
  10. package/lib/__templates__/expo/client/hooks/useTheme.ts +1 -1
  11. package/lib/__templates__/expo/client/screens/home/index.tsx +1 -4
  12. package/lib/__templates__/expo/client/screens/home/styles.ts +1 -273
  13. package/lib/__templates__/expo/client/utils/index.ts +1 -2
  14. package/lib/__templates__/expo/metro.config.js +3 -5
  15. package/lib/__templates__/expo/package.json +8 -2
  16. package/lib/__templates__/expo/pnpm-lock.yaml +87 -5
  17. package/lib/__templates__/expo/src/index.ts +2 -2
  18. package/lib/__templates__/expo/template.config.js +1 -1
  19. package/lib/__templates__/nextjs/.coze +3 -3
  20. package/lib/__templates__/nextjs/_npmrc +1 -1
  21. package/lib/__templates__/nextjs/package.json +9 -3
  22. package/lib/__templates__/nextjs/pnpm-lock.yaml +2501 -1120
  23. package/lib/__templates__/nextjs/scripts/dev.sh +8 -27
  24. package/lib/__templates__/nextjs/src/app/layout.tsx +18 -22
  25. package/lib/__templates__/nextjs/template.config.js +1 -1
  26. package/lib/__templates__/templates.json +7 -0
  27. package/lib/__templates__/vite/.coze +3 -3
  28. package/lib/__templates__/vite/README.md +204 -26
  29. package/lib/__templates__/vite/_npmrc +1 -1
  30. package/lib/__templates__/vite/package.json +1 -1
  31. package/lib/__templates__/vite/pnpm-lock.yaml +120 -120
  32. package/lib/__templates__/vite/scripts/dev.sh +7 -26
  33. package/lib/__templates__/vite/template.config.js +10 -1
  34. package/lib/__templates__/vite/vite.config.ts +3 -3
  35. package/lib/cli.js +408 -248
  36. package/package.json +3 -2
  37. package/lib/__templates__/nextjs/.babelrc +0 -15
  38. package/lib/__templates__/nextjs/server.mjs +0 -50
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coze-arch/cli",
3
- "version": "0.0.1-alpha.912cd5",
3
+ "version": "0.0.1-alpha.9f719c",
4
4
  "private": false,
5
5
  "description": "coze coding devtools cli",
6
6
  "license": "MIT",
@@ -19,7 +19,6 @@
19
19
  "scripts": {
20
20
  "prebuild": "tsx scripts/prebuild.ts",
21
21
  "build": "tsx scripts/build.ts",
22
- "generate-templates": "tsx scripts/generate-templates-config.ts",
23
22
  "lint": "eslint ./ --cache",
24
23
  "postpublish": "bash scripts/sync-npmmirror.sh",
25
24
  "test": "vitest --run --passWithNoTests",
@@ -38,6 +37,7 @@
38
37
  "commander": "~12.1.0",
39
38
  "ejs": "^3.1.10",
40
39
  "js-yaml": "^4.1.0",
40
+ "minimist": "^1.2.5",
41
41
  "shelljs": "^0.10.0"
42
42
  },
43
43
  "devDependencies": {
@@ -51,6 +51,7 @@
51
51
  "@types/ejs": "^3.1.5",
52
52
  "@types/iarna__toml": "^2.0.5",
53
53
  "@types/js-yaml": "^4.0.9",
54
+ "@types/minimist": "^1.2.5",
54
55
  "@types/node": "^24",
55
56
  "@types/shelljs": "^0.10.0",
56
57
  "@vitest/coverage-v8": "~4.0.16",
@@ -1,15 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "next/babel",
5
- {
6
- "preset-react": {
7
- "development": true
8
- }
9
- }
10
- ]
11
- ],
12
- "plugins": [
13
- "@react-dev-inspector/babel-plugin"
14
- ]
15
- }
@@ -1,50 +0,0 @@
1
- import { createServer } from 'node:http';
2
- import next from 'next';
3
- import { launchEditorMiddleware } from '@react-dev-inspector/middleware';
4
-
5
- const dev = process.env.NODE_ENV !== 'production';
6
- const hostname = process.env.HOSTNAME || 'localhost';
7
- const port = parseInt(process.env.PORT || '3000', 10);
8
-
9
- const app = next({ dev, hostname, port });
10
- const handle = app.getRequestHandler();
11
-
12
- app.prepare().then(() => {
13
- createServer((req, res) => {
14
- /**
15
- * Middlewares, from top to bottom
16
- */
17
- const middlewares = [
18
- /**
19
- * react-dev-inspector middleware for launching editor
20
- * Only active in development mode
21
- */
22
- ...(dev ? [launchEditorMiddleware] : []),
23
-
24
- /**
25
- * Next.js default app handler
26
- */
27
- (req, res) => handle(req, res),
28
- ];
29
-
30
- /**
31
- * Build middleware pipeline using reduceRight
32
- * Executes middlewares from top to bottom
33
- */
34
- const middlewarePipeline = middlewares.reduceRight(
35
- (next, middleware) => () => {
36
- middleware(req, res, next);
37
- },
38
- () => {},
39
- );
40
-
41
- middlewarePipeline();
42
- })
43
- .once('error', (err) => {
44
- console.error(err);
45
- process.exit(1);
46
- })
47
- .listen(port, () => {
48
- console.log(`> Ready on http://${hostname}:${port}`);
49
- });
50
- });