@coze-arch/cli 0.0.1-alpha.a3fb1a → 0.0.1-alpha.d5effa
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/.cozeproj/scripts/deploy_build.sh +4 -3
- package/lib/__templates__/expo/.cozeproj/scripts/deploy_run.sh +8 -40
- package/lib/__templates__/expo/_npmrc +1 -1
- package/lib/__templates__/expo/client/contexts/AuthContext.tsx +14 -107
- package/lib/__templates__/expo/client/screens/home/index.tsx +1 -4
- package/lib/__templates__/expo/client/screens/home/styles.ts +1 -273
- package/lib/__templates__/expo/client/utils/index.ts +1 -2
- package/lib/__templates__/expo/package.json +1 -1
- package/lib/__templates__/expo/pnpm-lock.yaml +5 -5
- package/lib/__templates__/expo/src/index.ts +2 -2
- package/lib/__templates__/expo/template.config.js +1 -1
- package/lib/__templates__/nextjs/_npmrc +1 -1
- package/lib/__templates__/nextjs/package.json +1 -4
- package/lib/__templates__/nextjs/pnpm-lock.yaml +5 -1025
- package/lib/__templates__/nextjs/scripts/dev.sh +8 -27
- package/lib/__templates__/nextjs/src/app/layout.tsx +18 -22
- package/lib/__templates__/nextjs/template.config.js +1 -1
- package/lib/__templates__/templates.json +7 -0
- package/lib/__templates__/vite/_npmrc +1 -1
- package/lib/__templates__/vite/scripts/dev.sh +7 -26
- package/lib/__templates__/vite/template.config.js +11 -2
- package/lib/__templates__/vite/vite.config.ts +4 -3
- package/lib/cli.js +385 -242
- package/package.json +1 -2
- package/lib/__templates__/nextjs/.babelrc +0 -15
- 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.
|
|
3
|
+
"version": "0.0.1-alpha.d5effa",
|
|
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",
|
|
@@ -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
|
-
});
|