@coze-arch/cli 0.0.1-alpha.ecba20 → 0.0.1-alpha.f37dff

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 (41) hide show
  1. package/lib/__templates__/expo/.coze +1 -1
  2. package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +19 -82
  3. package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +62 -81
  4. package/lib/__templates__/expo/README.md +22 -14
  5. package/lib/__templates__/expo/client/app/index.tsx +1 -0
  6. package/lib/__templates__/expo/client/app.config.ts +64 -60
  7. package/lib/__templates__/expo/client/assets/images/coze-logo.png +0 -0
  8. package/lib/__templates__/expo/client/constants/theme.ts +12 -12
  9. package/lib/__templates__/expo/client/hooks/useColorScheme.ts +34 -1
  10. package/lib/__templates__/expo/client/package.json +1 -0
  11. package/lib/__templates__/expo/client/screens/home/index.tsx +8 -37
  12. package/lib/__templates__/expo/client/screens/home/styles.ts +16 -52
  13. package/lib/__templates__/expo/pnpm-lock.yaml +22 -0
  14. package/lib/__templates__/expo/server/package.json +1 -0
  15. package/lib/__templates__/expo/server/src/index.ts +8 -2
  16. package/lib/__templates__/expo/template.config.js +1 -0
  17. package/lib/__templates__/nextjs/.coze +1 -0
  18. package/lib/__templates__/nextjs/next.config.ts +9 -0
  19. package/lib/__templates__/nextjs/package.json +2 -4
  20. package/lib/__templates__/nextjs/pnpm-lock.yaml +0 -1020
  21. package/lib/__templates__/nextjs/scripts/dev.sh +1 -1
  22. package/lib/__templates__/nextjs/scripts/prepare.sh +9 -0
  23. package/lib/__templates__/nextjs/src/app/layout.tsx +0 -4
  24. package/lib/__templates__/nextjs/src/app/page.tsx +2 -3
  25. package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +29 -22
  26. package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +228 -230
  27. package/lib/__templates__/nextjs/template.config.js +24 -0
  28. package/lib/__templates__/templates.json +61 -70
  29. package/lib/__templates__/vite/.coze +1 -0
  30. package/lib/__templates__/vite/eslint.config.mjs +9 -0
  31. package/lib/__templates__/vite/package.json +5 -2
  32. package/lib/__templates__/vite/pnpm-lock.yaml +841 -0
  33. package/lib/__templates__/vite/scripts/prepare.sh +9 -0
  34. package/lib/__templates__/vite/template.config.js +4 -0
  35. package/lib/cli.js +1 -1
  36. package/package.json +1 -1
  37. package/lib/__templates__/nextjs/.babelrc +0 -15
  38. package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
  39. package/lib/__templates__/nextjs/server.mjs +0 -50
  40. package/lib/__templates__/vite/.vscode/settings.json +0 -7
  41. /package/lib/__templates__/expo/client/app/{index.ts → home.tsx} +0 -0
@@ -30,4 +30,4 @@ echo "Clearing port ${PORT} before start."
30
30
  kill_port_if_listening
31
31
  echo "Starting HTTP service on port ${PORT} for dev..."
32
32
 
33
- PORT=$PORT node server.mjs
33
+ npx next dev --webpack --port $PORT
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+ set -Eeuo pipefail
3
+
4
+ COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
5
+
6
+ cd "${COZE_WORKSPACE_PATH}"
7
+
8
+ echo "Installing dependencies..."
9
+ pnpm install --prefer-frozen-lockfile --prefer-offline --loglevel debug --reporter=append-only
@@ -1,6 +1,5 @@
1
1
  import type { Metadata } from 'next';
2
2
  import { Geist, Geist_Mono } from 'next/font/google';
3
- import { Inspector } from 'react-dev-inspector';
4
3
  import './globals.css';
5
4
 
6
5
  const geistSans = Geist({
@@ -72,14 +71,11 @@ export default function RootLayout({
72
71
  }: Readonly<{
73
72
  children: React.ReactNode;
74
73
  }>) {
75
- const isDev = process.env.NODE_ENV === 'development';
76
-
77
74
  return (
78
75
  <html lang="en">
79
76
  <body
80
77
  className={`${geistSans.variable} ${geistMono.variable} antialiased`}
81
78
  >
82
- {isDev && <Inspector />}
83
79
  {children}
84
80
  </body>
85
81
  </html>
@@ -1,4 +1,5 @@
1
1
  import type { Metadata } from 'next';
2
+ import Image from 'next/image';
2
3
 
3
4
  export const metadata: Metadata = {
4
5
  title: '扣子编程 - AI 开发伙伴',
@@ -12,14 +13,12 @@ export default function Home() {
12
13
  <main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between px-16 py-32 sm:items-start">
13
14
  {/* 头部:Logo 和 产品名称 */}
14
15
  <div className="flex items-center gap-3">
15
- {/* 注意:生产环境建议使用 next/image 并配置 remotePatterns */}
16
- <img
16
+ <Image
17
17
  className="dark:invert"
18
18
  src="https://lf3-static.bytednsdoc.com/obj/eden-cn/hkpzboz/coze_logo.png"
19
19
  alt="扣子编程 Logo"
20
20
  width={40}
21
21
  height={40}
22
- style={{ width: '40px', height: '40px', objectFit: 'contain' }}
23
22
  />
24
23
  <span className="text-xl font-bold tracking-tight text-black dark:text-zinc-50">
25
24
  扣子编程
@@ -1,46 +1,53 @@
1
- "use client"
1
+ 'use client';
2
2
 
3
- import * as React from "react"
4
- import { GripVerticalIcon } from "lucide-react"
5
- import * as ResizablePrimitive from "react-resizable-panels"
3
+ import { GripVerticalIcon } from 'lucide-react';
4
+ import {
5
+ Group,
6
+ Panel,
7
+ Separator,
8
+ type GroupProps,
9
+ type PanelProps,
10
+ type SeparatorProps,
11
+ } from 'react-resizable-panels';
6
12
 
7
- import { cn } from "@/lib/utils"
13
+ import { cn } from '@/lib/utils';
8
14
 
9
15
  function ResizablePanelGroup({
10
16
  className,
17
+ orientation = 'horizontal',
11
18
  ...props
12
- }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {
19
+ }: GroupProps) {
13
20
  return (
14
- <ResizablePrimitive.PanelGroup
21
+ <Group
15
22
  data-slot="resizable-panel-group"
23
+ data-panel-group-direction={orientation}
24
+ orientation={orientation}
16
25
  className={cn(
17
- "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
18
- className
26
+ 'flex h-full w-full data-[panel-group-direction=vertical]:flex-col',
27
+ className,
19
28
  )}
20
29
  {...props}
21
30
  />
22
- )
31
+ );
23
32
  }
24
33
 
25
- function ResizablePanel({
26
- ...props
27
- }: React.ComponentProps<typeof ResizablePrimitive.Panel>) {
28
- return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />
34
+ function ResizablePanel({ ...props }: PanelProps) {
35
+ return <Panel data-slot="resizable-panel" {...props} />;
29
36
  }
30
37
 
31
38
  function ResizableHandle({
32
39
  withHandle,
33
40
  className,
34
41
  ...props
35
- }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
36
- withHandle?: boolean
42
+ }: SeparatorProps & {
43
+ withHandle?: boolean;
37
44
  }) {
38
45
  return (
39
- <ResizablePrimitive.PanelResizeHandle
46
+ <Separator
40
47
  data-slot="resizable-handle"
41
48
  className={cn(
42
- "bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
43
- className
49
+ 'bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90',
50
+ className,
44
51
  )}
45
52
  {...props}
46
53
  >
@@ -49,8 +56,8 @@ function ResizableHandle({
49
56
  <GripVerticalIcon className="size-2.5" />
50
57
  </div>
51
58
  )}
52
- </ResizablePrimitive.PanelResizeHandle>
53
- )
59
+ </Separator>
60
+ );
54
61
  }
55
62
 
56
- export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
63
+ export { ResizablePanelGroup, ResizablePanel, ResizableHandle };