@code-id-labs/cli 1.0.0 → 1.0.2

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 (2) hide show
  1. package/dist/index.js +30 -2
  2. package/package.json +6 -1
package/dist/index.js CHANGED
@@ -122,6 +122,28 @@ function generateStarterFiles(options) {
122
122
  "*.log",
123
123
  ""
124
124
  ].join("\n"),
125
+ "pnpm-workspace.yaml": [
126
+ "allowBuilds:",
127
+ " \"@parcel/watcher\": false",
128
+ " \"@swc/core\": false",
129
+ " \"@tailwindcss/oxide\": false",
130
+ " core-js: false",
131
+ " core-js-pure: false",
132
+ " esbuild: true",
133
+ " unrs-resolver: false",
134
+ "",
135
+ "onlyBuiltDependencies:",
136
+ " - esbuild",
137
+ "",
138
+ "ignoredBuiltDependencies:",
139
+ " - \"@parcel/watcher\"",
140
+ " - \"@swc/core\"",
141
+ " - \"@tailwindcss/oxide\"",
142
+ " - core-js",
143
+ " - core-js-pure",
144
+ " - unrs-resolver",
145
+ ""
146
+ ].join("\n"),
125
147
  "package.json": JSON.stringify({
126
148
  name: projectName,
127
149
  type: "module",
@@ -143,6 +165,7 @@ function generateStarterFiles(options) {
143
165
  ...iconCollection !== "lucide" ? { [`@iconify-json/${iconCollection}`]: "^1.2.0" } : {},
144
166
  "@types/node": "^22.0.0",
145
167
  "miniprogram-api-typings": "^5.2.3",
168
+ tailwindcss: "^4.3.3",
146
169
  typescript: "^5.8.0",
147
170
  "weapp-vite": "^7.5.0"
148
171
  }
@@ -335,7 +358,7 @@ export default defineConfig({
335
358
  label="Increment"
336
359
  color="primary"
337
360
  leading-icon="i-${iconCollection}-plus"
338
- bind:click="handleIncrement"
361
+ bind:tap="handleIncrement"
339
362
  />
340
363
  </view>
341
364
  </${prefix}-card>
@@ -553,6 +576,12 @@ program.command("init").description("Initialize Code UI configuration (cui.confi
553
576
  logger.success(`Added ${pc.green("@import \"@code-id-labs/components\";")} to ${pc.green("src/app.css")}`);
554
577
  }
555
578
  }
579
+ const pm = detectPackageManager(cwd);
580
+ const pnpmWorkspacePath = path.resolve(cwd, "pnpm-workspace.yaml");
581
+ if (pm === "pnpm" && !fs.existsSync(pnpmWorkspacePath)) {
582
+ fs.writeFileSync(pnpmWorkspacePath, files["pnpm-workspace.yaml"] ?? "", "utf-8");
583
+ logger.success(`Created ${pc.green("pnpm-workspace.yaml")}`);
584
+ }
556
585
  if (cmdOpts.install) {
557
586
  const iconCol = cmdOpts.icons || "lucide";
558
587
  installDependencies(["@code-id-labs/components", "@code-id-labs/plugin-vite"], { cwd });
@@ -562,7 +591,6 @@ program.command("init").description("Initialize Code UI configuration (cui.confi
562
591
  });
563
592
  logger.success("Installed Code UI dependencies.");
564
593
  } else {
565
- const pm = detectPackageManager(cwd);
566
594
  const addCmd = pm === "npm" ? "npm i" : `${pm} add`;
567
595
  const iconCol = cmdOpts.icons || "lucide";
568
596
  console.log(`\n${pc.bold("Install required packages:")}`);
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "@code-id-labs/cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "CLI tool for code-ui prebuilt WeChat MiniProgram component library",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/code-id-miniapp-labs/code-ui.git",
8
+ "directory": "packages/cli"
9
+ },
5
10
  "type": "module",
6
11
  "bin": {
7
12
  "code-ui": "./dist/index.js"