create-weapp-vite 2.3.47 → 2.3.49

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/dist/cli.js CHANGED
@@ -1,9 +1,10 @@
1
- import { n as RECOMMENDED_SKILLS_INSTALL_COMMAND, t as createProject } from "./src-BtYHexpT.js";
1
+ import { n as RECOMMENDED_SKILLS_INSTALL_COMMAND, t as createProject } from "./src-BDVRIvry.js";
2
2
  import logger from "@weapp-core/logger";
3
3
  import { fs } from "@weapp-core/shared/fs";
4
4
  import process from "node:process";
5
5
  import path from "node:path";
6
6
  import { confirm, input, select } from "@inquirer/prompts";
7
+ import { initConfig } from "@weapp-core/init";
7
8
  //#region src/cli.ts
8
9
  const cwd = process.cwd();
9
10
  const TEMPLATE_CHOICES = [
@@ -55,13 +56,19 @@ function parseCliArgs(argv) {
55
56
  positionals.push(arg);
56
57
  }
57
58
  return {
59
+ command: positionals[0],
58
60
  targetDir: positionals[0],
59
61
  templateName: positionals[1],
60
62
  installSkills
61
63
  };
62
64
  }
63
65
  async function run() {
64
- const { targetDir: argTarget, templateName: argTemplate, installSkills: argInstallSkills } = parseCliArgs(process.argv.slice(2));
66
+ const parsedArgs = parseCliArgs(process.argv.slice(2));
67
+ if (parsedArgs.command === "init") {
68
+ await initConfig({ command: "weapp-vite" });
69
+ return;
70
+ }
71
+ const { targetDir: argTarget, templateName: argTemplate, installSkills: argInstallSkills } = parsedArgs;
65
72
  const isArgMode = Boolean(argTarget);
66
73
  const targetDir = isArgMode ? argTarget : await input({
67
74
  message: "创建应用的目录",
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { r as TemplateName, t as createProject } from "./src-BtYHexpT.js";
1
+ import { r as TemplateName, t as createProject } from "./src-BDVRIvry.js";
2
2
  export { TemplateName, createProject };
@@ -6,13 +6,13 @@ import https from "node:https";
6
6
  import { spawn } from "node:child_process";
7
7
  import process from "node:process";
8
8
  //#region ../../packages-runtime/wevu/package.json
9
- var version$2 = "6.16.40";
9
+ var version$2 = "6.16.42";
10
10
  //#endregion
11
11
  //#region ../dashboard/package.json
12
- var version$1 = "6.16.40";
12
+ var version$1 = "6.16.42";
13
13
  //#endregion
14
14
  //#region ../weapp-vite/package.json
15
- var version = "6.16.40";
15
+ var version = "6.16.42";
16
16
  //#endregion
17
17
  //#region src/enums.ts
18
18
  let TemplateName = /* @__PURE__ */ function(TemplateName) {
@@ -109,9 +109,8 @@ const TEMPLATE_CATALOG = {
109
109
  "@icebreakers/stylelint-config": "^4.0.2",
110
110
  "@iconify-json/mdi": "^1.2.3",
111
111
  "@mini-types/alipay": "^3.0.14",
112
- "@tailwindcss/postcss": "^4.3.0",
113
112
  "@tailwindcss/vite": "^4.3.0",
114
- "@types/node": "^25.9.1",
113
+ "@types/node": "^25.9.2",
115
114
  "@types/semver": "^7.7.1",
116
115
  "@vant/weapp": "^1.11.7",
117
116
  "@vitejs/plugin-vue": "^6.0.7",
@@ -133,11 +132,11 @@ const TEMPLATE_CATALOG = {
133
132
  "sass-embedded": "^1.100.0",
134
133
  "tailwind-merge": "^3.6.0",
135
134
  "tailwind-variants": "^3.2.2",
136
- "tdesign-miniprogram": "^1.15.0",
135
+ "tdesign-miniprogram": "^1.15.1",
137
136
  "ts-morph": "^28.0.0",
138
137
  "vite-plugin-inspect": "^11.4.1",
139
138
  "vue-tsc": "^3.3.3",
140
- "weapp-tailwindcss": "^4.12.0",
139
+ "weapp-tailwindcss": "^5.0.4",
141
140
  autoprefixer: "^10.5.0",
142
141
  clsx: "^2.1.1",
143
142
  dayjs: "^1.11.21",
@@ -148,12 +147,12 @@ const TEMPLATE_CATALOG = {
148
147
  htmlparser2: "^12.0.0",
149
148
  lodash: "^4.18.1",
150
149
  merge: "^2.1.1",
151
- obug: "^2.1.1",
150
+ obug: "^2.1.2",
152
151
  pathe: "^2.0.3",
153
152
  postcss: "^8.5.15",
154
153
  rolldown: "1.1.0",
155
154
  sass: "^1.100.0",
156
- stylelint: "^17.12.0",
155
+ stylelint: "^17.13.0",
157
156
  tailwindcss: "^4.3.0",
158
157
  tslib: "^2.8.1",
159
158
  typescript: "^6.0.3",
@@ -162,8 +161,8 @@ const TEMPLATE_CATALOG = {
162
161
  zod: "^4.4.3"
163
162
  };
164
163
  const TEMPLATE_NAMED_CATALOG = {
165
- "tdesign-miniprogram-fixed": { "tdesign-miniprogram": "1.15.0" },
166
- "weapp-tailwindcss-fixed": { "weapp-tailwindcss": "4.12.0" },
164
+ "tdesign-miniprogram-fixed": { "tdesign-miniprogram": "1.15.1" },
165
+ "weapp-tailwindcss-fixed": { "weapp-tailwindcss": "5.0.4" },
167
166
  latest: {
168
167
  "miniprogram-api-typings": "^5.2.1",
169
168
  typescript: "^6.0.3"
@@ -412,6 +411,12 @@ function normalizeTemplateRelativePath(relativePath) {
412
411
  if (!relativePath || relativePath === ".") return "";
413
412
  return normalizeTemplatePath(relativePath);
414
413
  }
414
+ function isGeneratedOutputSegment(segment) {
415
+ return segment === "dist" || segment.startsWith("dist-");
416
+ }
417
+ function hasTemplatePathSegment(relativePath, predicate) {
418
+ return relativePath.split("/").some(predicate);
419
+ }
415
420
  async function resolveTemplateDirs(templateName) {
416
421
  const packagedTemplateDir = path.resolve(moduleDir, "../templates", templateName);
417
422
  const workspaceTemplateDir = resolveWorkspaceTemplateDir(templateName);
@@ -424,7 +429,7 @@ async function resolveTemplateDirs(templateName) {
424
429
  function shouldSkipTemplateFile(filePath, templateRoot) {
425
430
  const relativePath = normalizeTemplateRelativePath(path.relative(normalizeTemplatePath(templateRoot), normalizeTemplatePath(filePath)));
426
431
  if (!relativePath) return false;
427
- return relativePath === "node_modules" || relativePath.startsWith("node_modules/") || relativePath.includes("/node_modules/") || relativePath === ".weapp-vite" || relativePath.startsWith(".weapp-vite/") || relativePath.includes("/.weapp-vite/") || relativePath === "vite.config.ts.timestamp" || relativePath.endsWith("/vite.config.ts.timestamp") || relativePath === "dist" || relativePath.startsWith("dist/") || relativePath.includes("/dist/") || relativePath === "CHANGELOG.md" || relativePath.endsWith("/CHANGELOG.md") || relativePath === ".turbo" || relativePath.startsWith(".turbo/") || relativePath.includes("/.turbo/") || relativePath === ".DS_Store" || relativePath.endsWith("/.DS_Store");
432
+ return hasTemplatePathSegment(relativePath, (segment) => segment === "node_modules") || hasTemplatePathSegment(relativePath, (segment) => segment === ".weapp-vite") || hasTemplatePathSegment(relativePath, isGeneratedOutputSegment) || hasTemplatePathSegment(relativePath, (segment) => segment === ".turbo") || relativePath === "vite.config.ts.timestamp" || relativePath.endsWith("/vite.config.ts.timestamp") || relativePath === "CHANGELOG.md" || relativePath.endsWith("/CHANGELOG.md") || relativePath === ".DS_Store" || relativePath.endsWith("/.DS_Store");
428
433
  }
429
434
  function normalizeLines(value) {
430
435
  return value.replace(CRLF_RE, "\n").split("\n");
@@ -483,7 +488,7 @@ async function upsertTailwindcssVersion(pkgJson) {
483
488
  if (!pkgJson.devDependencies) return;
484
489
  const resolved = await latestVersion("weapp-tailwindcss");
485
490
  if (resolved) pkgJson.devDependencies["weapp-tailwindcss"] = resolved;
486
- else if (!pkgJson.devDependencies["weapp-tailwindcss"]) pkgJson.devDependencies["weapp-tailwindcss"] = "^4.3.3";
491
+ else if (!pkgJson.devDependencies["weapp-tailwindcss"]) pkgJson.devDependencies["weapp-tailwindcss"] = "^5.0.0";
487
492
  }
488
493
  function upsertExistingDependencyVersion(pkgJson, packageName, resolvedVersion) {
489
494
  if (pkgJson.dependencies?.[packageName]) pkgJson.dependencies[packageName] = resolvedVersion;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-weapp-vite",
3
3
  "type": "module",
4
- "version": "2.3.47",
4
+ "version": "2.3.49",
5
5
  "description": "create-weapp-vite",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -50,6 +50,7 @@
50
50
  "@inquirer/prompts": "^8.5.2",
51
51
  "pathe": "^2.0.3",
52
52
  "pkg-types": "^2.3.1",
53
+ "@weapp-core/init": "6.0.10",
53
54
  "@weapp-core/logger": "3.1.1",
54
55
  "@weapp-core/shared": "3.0.4"
55
56
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weapp-vite-lib-template",
3
3
  "type": "module",
4
- "version": "7.0.40",
4
+ "version": "7.0.42",
5
5
  "private": true,
6
6
  "description": "weapp-vite 组件库(lib 模式)模板",
7
7
  "author": "ice breaker <1324318532@qq.com>",
@@ -27,14 +27,13 @@
27
27
  "stylelint": "stylelint \"src/**/*.{css,scss,vue,wxss}\" --allow-empty-input",
28
28
  "stylelint:fix": "stylelint \"src/**/*.{css,scss,vue,wxss}\" --fix --allow-empty-input",
29
29
  "g": "wv generate",
30
- "postinstall": "weapp-tw patch && wv prepare"
30
+ "postinstall": "wv prepare"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@egoist/tailwindcss-icons": "catalog:",
34
34
  "@icebreakers/eslint-config": "catalog:",
35
35
  "@icebreakers/stylelint-config": "catalog:",
36
36
  "@iconify-json/mdi": "catalog:",
37
- "@tailwindcss/postcss": "catalog:",
38
37
  "@types/node": "catalog:",
39
38
  "@weapp-vite/dashboard": "workspace:*",
40
39
  "eslint": "catalog:",
@@ -1,5 +1,3 @@
1
1
  export default {
2
- plugins: {
3
- '@tailwindcss/postcss': {},
4
- },
2
+ plugins: {},
5
3
  }
@@ -1,5 +1,5 @@
1
1
  import path from 'node:path'
2
- import { weappTailwindcss } from 'weapp-tailwindcss/vite'
2
+ import { WeappTailwindcss } from 'weapp-tailwindcss/vite'
3
3
  import { defineConfig } from 'weapp-vite'
4
4
 
5
5
  export default defineConfig({
@@ -31,7 +31,7 @@ export default defineConfig({
31
31
  },
32
32
  },
33
33
  plugins: [
34
- weappTailwindcss({
34
+ WeappTailwindcss({
35
35
  rem2rpx: true,
36
36
  cssEntries: [path.resolve(import.meta.dirname, 'src/app.css')],
37
37
  }),
@@ -27,7 +27,7 @@
27
27
  "stylelint": "stylelint \"src/**/*.{css,scss,vue,wxss}\" --allow-empty-input",
28
28
  "stylelint:fix": "stylelint \"src/**/*.{css,scss,vue,wxss}\" --fix --allow-empty-input",
29
29
  "g": "wv generate",
30
- "postinstall": "weapp-tw patch && wv prepare"
30
+ "postinstall": "wv prepare"
31
31
  },
32
32
  "dependencies": {
33
33
  "tdesign-miniprogram": "catalog:"
@@ -37,7 +37,6 @@
37
37
  "@icebreakers/eslint-config": "catalog:",
38
38
  "@icebreakers/stylelint-config": "catalog:",
39
39
  "@iconify-json/mdi": "catalog:",
40
- "@tailwindcss/postcss": "catalog:",
41
40
  "@types/node": "catalog:",
42
41
  "@weapp-vite/dashboard": "workspace:*",
43
42
  "eslint": "catalog:",
@@ -1,5 +1,3 @@
1
1
  export default {
2
- plugins: {
3
- '@tailwindcss/postcss': {},
4
- },
2
+ plugins: {},
5
3
  }
@@ -1,5 +1,5 @@
1
1
  import path from 'node:path'
2
- import { weappTailwindcss } from 'weapp-tailwindcss/vite'
2
+ import { WeappTailwindcss } from 'weapp-tailwindcss/vite'
3
3
  import { defineConfig } from 'weapp-vite'
4
4
  import { TDesignResolver } from 'weapp-vite/auto-import-components/resolvers'
5
5
 
@@ -44,7 +44,7 @@ export default defineConfig({
44
44
  },
45
45
  },
46
46
  plugins: [
47
- weappTailwindcss({
47
+ WeappTailwindcss({
48
48
  rem2rpx: true,
49
49
  cssEntries: [path.resolve(import.meta.dirname, 'src/app.css')],
50
50
  }),
@@ -27,7 +27,7 @@
27
27
  "stylelint": "stylelint \"src/**/*.{css,scss,vue,wxss}\" --allow-empty-input",
28
28
  "stylelint:fix": "stylelint \"src/**/*.{css,scss,vue,wxss}\" --fix --allow-empty-input",
29
29
  "g": "wv generate",
30
- "postinstall": "weapp-tw patch && wv prepare"
30
+ "postinstall": "wv prepare"
31
31
  },
32
32
  "dependencies": {
33
33
  "@vant/weapp": "catalog:"
@@ -37,7 +37,6 @@
37
37
  "@icebreakers/eslint-config": "catalog:",
38
38
  "@icebreakers/stylelint-config": "catalog:",
39
39
  "@iconify-json/mdi": "catalog:",
40
- "@tailwindcss/postcss": "catalog:",
41
40
  "@types/node": "catalog:",
42
41
  "@weapp-vite/dashboard": "workspace:*",
43
42
  "eslint": "catalog:",
@@ -1,5 +1,3 @@
1
1
  export default {
2
- plugins: {
3
- '@tailwindcss/postcss': {},
4
- },
2
+ plugins: {},
5
3
  }
@@ -1,5 +1,5 @@
1
1
  import path from 'node:path'
2
- import { weappTailwindcss } from 'weapp-tailwindcss/vite'
2
+ import { WeappTailwindcss } from 'weapp-tailwindcss/vite'
3
3
  import { defineConfig } from 'weapp-vite'
4
4
  import { VantResolver } from 'weapp-vite/auto-import-components/resolvers'
5
5
 
@@ -44,7 +44,7 @@ export default defineConfig({
44
44
  },
45
45
  },
46
46
  plugins: [
47
- weappTailwindcss({
47
+ WeappTailwindcss({
48
48
  rem2rpx: true,
49
49
  cssEntries: [path.resolve(import.meta.dirname, 'src/app.css')],
50
50
  }),
@@ -27,7 +27,7 @@
27
27
  "open": "wv open",
28
28
  "stylelint": "stylelint \"src/**/*.{css,scss,vue,wxss}\" --allow-empty-input",
29
29
  "stylelint:fix": "stylelint \"src/**/*.{css,scss,vue,wxss}\" --fix --allow-empty-input",
30
- "postinstall": "weapp-tw patch && wv prepare"
30
+ "postinstall": "wv prepare"
31
31
  },
32
32
  "dependencies": {
33
33
  "tdesign-miniprogram": "catalog:"
@@ -37,7 +37,6 @@
37
37
  "@icebreakers/eslint-config": "catalog:",
38
38
  "@icebreakers/stylelint-config": "catalog:",
39
39
  "@iconify-json/mdi": "catalog:",
40
- "@tailwindcss/postcss": "catalog:",
41
40
  "@types/node": "catalog:",
42
41
  "@weapp-vite/dashboard": "workspace:*",
43
42
  "eslint": "catalog:",
@@ -1,5 +1,3 @@
1
1
  export default {
2
- plugins: {
3
- '@tailwindcss/postcss': {},
4
- },
2
+ plugins: {},
5
3
  }
@@ -1,5 +1,5 @@
1
1
  import path from 'node:path'
2
- import { weappTailwindcss } from 'weapp-tailwindcss/vite'
2
+ import { WeappTailwindcss } from 'weapp-tailwindcss/vite'
3
3
  import { defineConfig } from 'weapp-vite'
4
4
  import { TDesignResolver } from 'weapp-vite/auto-import-components/resolvers'
5
5
 
@@ -64,7 +64,7 @@ export default defineConfig({
64
64
  },
65
65
  },
66
66
  plugins: [
67
- weappTailwindcss({
67
+ WeappTailwindcss({
68
68
  rem2rpx: true,
69
69
  cssEntries: [path.resolve(import.meta.dirname, 'src/app.css')],
70
70
  }),