@weapp-core/init 1.1.15-alpha.2 → 1.1.15-alpha.4

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 (33) hide show
  1. package/dist/index.cjs +11 -483
  2. package/dist/index.d.cts +1 -4
  3. package/dist/index.d.ts +1 -4
  4. package/dist/index.js +4 -501
  5. package/package.json +1 -1
  6. package/templates/default/project.config.json +2 -2
  7. package/templates/default/project.private.config.json +1 -1
  8. package/templates/default/src/app.json +2 -4
  9. package/templates/default/src/components/Navbar/Navbar.wxml +1 -0
  10. package/templates/default/src/pages/index/index.ts +1 -28
  11. package/templates/default/src/pages/index/index.wxml +3 -10
  12. package/templates/default/vite.config.ts +7 -0
  13. package/templates/tailwindcss/project.private.config.json +1 -1
  14. package/templates/tailwindcss/src/app.json +1 -2
  15. package/templates/tdesign/src/app.json +1 -2
  16. package/templates/vant/project.private.config.json +1 -1
  17. package/templates/vant/src/app.json +1 -2
  18. package/templates/default/src/pages/logs/logs.json +0 -6
  19. package/templates/default/src/pages/logs/logs.scss +0 -0
  20. package/templates/default/src/pages/logs/logs.ts +0 -3
  21. package/templates/default/src/pages/logs/logs.wxml +0 -0
  22. package/templates/tailwindcss/src/pages/logs/logs.json +0 -6
  23. package/templates/tailwindcss/src/pages/logs/logs.scss +0 -0
  24. package/templates/tailwindcss/src/pages/logs/logs.ts +0 -3
  25. package/templates/tailwindcss/src/pages/logs/logs.wxml +0 -0
  26. package/templates/tdesign/src/pages/logs/logs.json +0 -6
  27. package/templates/tdesign/src/pages/logs/logs.scss +0 -0
  28. package/templates/tdesign/src/pages/logs/logs.ts +0 -3
  29. package/templates/tdesign/src/pages/logs/logs.wxml +0 -0
  30. package/templates/vant/src/pages/logs/logs.json +0 -6
  31. package/templates/vant/src/pages/logs/logs.scss +0 -0
  32. package/templates/vant/src/pages/logs/logs.ts +0 -3
  33. package/templates/vant/src/pages/logs/logs.wxml +0 -0
package/dist/index.cjs CHANGED
@@ -5,12 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function __init() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
- };
11
- var __commonJS = (cb, mod) => function __require() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
- };
14
8
  var __export = (target, all) => {
15
9
  for (var name in all)
16
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -33,461 +27,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
27
  ));
34
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
29
 
36
- // ../../node_modules/.pnpm/tsup@8.3.5_@swc+core@1.10.4_jiti@2.4.2_postcss@8.4.49_tsx@4.19.2_typescript@5.7.2_yaml@2.6.1/node_modules/tsup/assets/cjs_shims.js
37
- var getImportMetaUrl, importMetaUrl;
38
- var init_cjs_shims = __esm({
39
- "../../node_modules/.pnpm/tsup@8.3.5_@swc+core@1.10.4_jiti@2.4.2_postcss@8.4.49_tsx@4.19.2_typescript@5.7.2_yaml@2.6.1/node_modules/tsup/assets/cjs_shims.js"() {
40
- "use strict";
41
- getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
42
- importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
43
- }
44
- });
45
-
46
- // ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/debug.js
47
- var require_debug = __commonJS({
48
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/debug.js"(exports2, module2) {
49
- "use strict";
50
- init_cjs_shims();
51
- var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
52
- };
53
- module2.exports = debug;
54
- }
55
- });
56
-
57
- // ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/constants.js
58
- var require_constants = __commonJS({
59
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/constants.js"(exports2, module2) {
60
- "use strict";
61
- init_cjs_shims();
62
- var SEMVER_SPEC_VERSION = "2.0.0";
63
- var MAX_LENGTH = 256;
64
- var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
65
- 9007199254740991;
66
- var MAX_SAFE_COMPONENT_LENGTH = 16;
67
- var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
68
- var RELEASE_TYPES = [
69
- "major",
70
- "premajor",
71
- "minor",
72
- "preminor",
73
- "patch",
74
- "prepatch",
75
- "prerelease"
76
- ];
77
- module2.exports = {
78
- MAX_LENGTH,
79
- MAX_SAFE_COMPONENT_LENGTH,
80
- MAX_SAFE_BUILD_LENGTH,
81
- MAX_SAFE_INTEGER,
82
- RELEASE_TYPES,
83
- SEMVER_SPEC_VERSION,
84
- FLAG_INCLUDE_PRERELEASE: 1,
85
- FLAG_LOOSE: 2
86
- };
87
- }
88
- });
89
-
90
- // ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/re.js
91
- var require_re = __commonJS({
92
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/re.js"(exports2, module2) {
93
- "use strict";
94
- init_cjs_shims();
95
- var {
96
- MAX_SAFE_COMPONENT_LENGTH,
97
- MAX_SAFE_BUILD_LENGTH,
98
- MAX_LENGTH
99
- } = require_constants();
100
- var debug = require_debug();
101
- exports2 = module2.exports = {};
102
- var re = exports2.re = [];
103
- var safeRe = exports2.safeRe = [];
104
- var src = exports2.src = [];
105
- var t = exports2.t = {};
106
- var R = 0;
107
- var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
108
- var safeRegexReplacements = [
109
- ["\\s", 1],
110
- ["\\d", MAX_LENGTH],
111
- [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
112
- ];
113
- var makeSafeRegex = (value) => {
114
- for (const [token, max] of safeRegexReplacements) {
115
- value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
116
- }
117
- return value;
118
- };
119
- var createToken = (name, value, isGlobal) => {
120
- const safe = makeSafeRegex(value);
121
- const index = R++;
122
- debug(name, index, value);
123
- t[name] = index;
124
- src[index] = value;
125
- re[index] = new RegExp(value, isGlobal ? "g" : void 0);
126
- safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
127
- };
128
- createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
129
- createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
130
- createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
131
- createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
132
- createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
133
- createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
134
- createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
135
- createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
136
- createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
137
- createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
138
- createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
139
- createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
140
- createToken("FULL", `^${src[t.FULLPLAIN]}$`);
141
- createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
142
- createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
143
- createToken("GTLT", "((?:<|>)?=?)");
144
- createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
145
- createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
146
- createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
147
- createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
148
- createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
149
- createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
150
- createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
151
- createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
152
- createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
153
- createToken("COERCERTL", src[t.COERCE], true);
154
- createToken("COERCERTLFULL", src[t.COERCEFULL], true);
155
- createToken("LONETILDE", "(?:~>?)");
156
- createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
157
- exports2.tildeTrimReplace = "$1~";
158
- createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
159
- createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
160
- createToken("LONECARET", "(?:\\^)");
161
- createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
162
- exports2.caretTrimReplace = "$1^";
163
- createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
164
- createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
165
- createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
166
- createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
167
- createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
168
- exports2.comparatorTrimReplace = "$1$2$3";
169
- createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
170
- createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
171
- createToken("STAR", "(<|>)?=?\\s*\\*");
172
- createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
173
- createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
174
- }
175
- });
176
-
177
- // ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/parse-options.js
178
- var require_parse_options = __commonJS({
179
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/parse-options.js"(exports2, module2) {
180
- "use strict";
181
- init_cjs_shims();
182
- var looseOption = Object.freeze({ loose: true });
183
- var emptyOpts = Object.freeze({});
184
- var parseOptions = (options) => {
185
- if (!options) {
186
- return emptyOpts;
187
- }
188
- if (typeof options !== "object") {
189
- return looseOption;
190
- }
191
- return options;
192
- };
193
- module2.exports = parseOptions;
194
- }
195
- });
196
-
197
- // ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/identifiers.js
198
- var require_identifiers = __commonJS({
199
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/identifiers.js"(exports2, module2) {
200
- "use strict";
201
- init_cjs_shims();
202
- var numeric = /^[0-9]+$/;
203
- var compareIdentifiers = (a, b) => {
204
- const anum = numeric.test(a);
205
- const bnum = numeric.test(b);
206
- if (anum && bnum) {
207
- a = +a;
208
- b = +b;
209
- }
210
- return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
211
- };
212
- var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
213
- module2.exports = {
214
- compareIdentifiers,
215
- rcompareIdentifiers
216
- };
217
- }
218
- });
219
-
220
- // ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/semver.js
221
- var require_semver = __commonJS({
222
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/semver.js"(exports2, module2) {
223
- "use strict";
224
- init_cjs_shims();
225
- var debug = require_debug();
226
- var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
227
- var { safeRe: re, t } = require_re();
228
- var parseOptions = require_parse_options();
229
- var { compareIdentifiers } = require_identifiers();
230
- var SemVer = class _SemVer {
231
- constructor(version2, options) {
232
- options = parseOptions(options);
233
- if (version2 instanceof _SemVer) {
234
- if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) {
235
- return version2;
236
- } else {
237
- version2 = version2.version;
238
- }
239
- } else if (typeof version2 !== "string") {
240
- throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`);
241
- }
242
- if (version2.length > MAX_LENGTH) {
243
- throw new TypeError(
244
- `version is longer than ${MAX_LENGTH} characters`
245
- );
246
- }
247
- debug("SemVer", version2, options);
248
- this.options = options;
249
- this.loose = !!options.loose;
250
- this.includePrerelease = !!options.includePrerelease;
251
- const m = version2.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
252
- if (!m) {
253
- throw new TypeError(`Invalid Version: ${version2}`);
254
- }
255
- this.raw = version2;
256
- this.major = +m[1];
257
- this.minor = +m[2];
258
- this.patch = +m[3];
259
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
260
- throw new TypeError("Invalid major version");
261
- }
262
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
263
- throw new TypeError("Invalid minor version");
264
- }
265
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
266
- throw new TypeError("Invalid patch version");
267
- }
268
- if (!m[4]) {
269
- this.prerelease = [];
270
- } else {
271
- this.prerelease = m[4].split(".").map((id) => {
272
- if (/^[0-9]+$/.test(id)) {
273
- const num = +id;
274
- if (num >= 0 && num < MAX_SAFE_INTEGER) {
275
- return num;
276
- }
277
- }
278
- return id;
279
- });
280
- }
281
- this.build = m[5] ? m[5].split(".") : [];
282
- this.format();
283
- }
284
- format() {
285
- this.version = `${this.major}.${this.minor}.${this.patch}`;
286
- if (this.prerelease.length) {
287
- this.version += `-${this.prerelease.join(".")}`;
288
- }
289
- return this.version;
290
- }
291
- toString() {
292
- return this.version;
293
- }
294
- compare(other) {
295
- debug("SemVer.compare", this.version, this.options, other);
296
- if (!(other instanceof _SemVer)) {
297
- if (typeof other === "string" && other === this.version) {
298
- return 0;
299
- }
300
- other = new _SemVer(other, this.options);
301
- }
302
- if (other.version === this.version) {
303
- return 0;
304
- }
305
- return this.compareMain(other) || this.comparePre(other);
306
- }
307
- compareMain(other) {
308
- if (!(other instanceof _SemVer)) {
309
- other = new _SemVer(other, this.options);
310
- }
311
- return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
312
- }
313
- comparePre(other) {
314
- if (!(other instanceof _SemVer)) {
315
- other = new _SemVer(other, this.options);
316
- }
317
- if (this.prerelease.length && !other.prerelease.length) {
318
- return -1;
319
- } else if (!this.prerelease.length && other.prerelease.length) {
320
- return 1;
321
- } else if (!this.prerelease.length && !other.prerelease.length) {
322
- return 0;
323
- }
324
- let i = 0;
325
- do {
326
- const a = this.prerelease[i];
327
- const b = other.prerelease[i];
328
- debug("prerelease compare", i, a, b);
329
- if (a === void 0 && b === void 0) {
330
- return 0;
331
- } else if (b === void 0) {
332
- return 1;
333
- } else if (a === void 0) {
334
- return -1;
335
- } else if (a === b) {
336
- continue;
337
- } else {
338
- return compareIdentifiers(a, b);
339
- }
340
- } while (++i);
341
- }
342
- compareBuild(other) {
343
- if (!(other instanceof _SemVer)) {
344
- other = new _SemVer(other, this.options);
345
- }
346
- let i = 0;
347
- do {
348
- const a = this.build[i];
349
- const b = other.build[i];
350
- debug("build compare", i, a, b);
351
- if (a === void 0 && b === void 0) {
352
- return 0;
353
- } else if (b === void 0) {
354
- return 1;
355
- } else if (a === void 0) {
356
- return -1;
357
- } else if (a === b) {
358
- continue;
359
- } else {
360
- return compareIdentifiers(a, b);
361
- }
362
- } while (++i);
363
- }
364
- // preminor will bump the version up to the next minor release, and immediately
365
- // down to pre-release. premajor and prepatch work the same way.
366
- inc(release, identifier, identifierBase) {
367
- switch (release) {
368
- case "premajor":
369
- this.prerelease.length = 0;
370
- this.patch = 0;
371
- this.minor = 0;
372
- this.major++;
373
- this.inc("pre", identifier, identifierBase);
374
- break;
375
- case "preminor":
376
- this.prerelease.length = 0;
377
- this.patch = 0;
378
- this.minor++;
379
- this.inc("pre", identifier, identifierBase);
380
- break;
381
- case "prepatch":
382
- this.prerelease.length = 0;
383
- this.inc("patch", identifier, identifierBase);
384
- this.inc("pre", identifier, identifierBase);
385
- break;
386
- // If the input is a non-prerelease version, this acts the same as
387
- // prepatch.
388
- case "prerelease":
389
- if (this.prerelease.length === 0) {
390
- this.inc("patch", identifier, identifierBase);
391
- }
392
- this.inc("pre", identifier, identifierBase);
393
- break;
394
- case "major":
395
- if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
396
- this.major++;
397
- }
398
- this.minor = 0;
399
- this.patch = 0;
400
- this.prerelease = [];
401
- break;
402
- case "minor":
403
- if (this.patch !== 0 || this.prerelease.length === 0) {
404
- this.minor++;
405
- }
406
- this.patch = 0;
407
- this.prerelease = [];
408
- break;
409
- case "patch":
410
- if (this.prerelease.length === 0) {
411
- this.patch++;
412
- }
413
- this.prerelease = [];
414
- break;
415
- // This probably shouldn't be used publicly.
416
- // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
417
- case "pre": {
418
- const base = Number(identifierBase) ? 1 : 0;
419
- if (!identifier && identifierBase === false) {
420
- throw new Error("invalid increment argument: identifier is empty");
421
- }
422
- if (this.prerelease.length === 0) {
423
- this.prerelease = [base];
424
- } else {
425
- let i = this.prerelease.length;
426
- while (--i >= 0) {
427
- if (typeof this.prerelease[i] === "number") {
428
- this.prerelease[i]++;
429
- i = -2;
430
- }
431
- }
432
- if (i === -1) {
433
- if (identifier === this.prerelease.join(".") && identifierBase === false) {
434
- throw new Error("invalid increment argument: identifier already exists");
435
- }
436
- this.prerelease.push(base);
437
- }
438
- }
439
- if (identifier) {
440
- let prerelease = [identifier, base];
441
- if (identifierBase === false) {
442
- prerelease = [identifier];
443
- }
444
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
445
- if (isNaN(this.prerelease[1])) {
446
- this.prerelease = prerelease;
447
- }
448
- } else {
449
- this.prerelease = prerelease;
450
- }
451
- }
452
- break;
453
- }
454
- default:
455
- throw new Error(`invalid increment argument: ${release}`);
456
- }
457
- this.raw = this.format();
458
- if (this.build.length) {
459
- this.raw += `+${this.build.join(".")}`;
460
- }
461
- return this;
462
- }
463
- };
464
- module2.exports = SemVer;
465
- }
466
- });
467
-
468
- // ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/parse.js
469
- var require_parse = __commonJS({
470
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/parse.js"(exports2, module2) {
471
- "use strict";
472
- init_cjs_shims();
473
- var SemVer = require_semver();
474
- var parse2 = (version2, options, throwErrors = false) => {
475
- if (version2 instanceof SemVer) {
476
- return version2;
477
- }
478
- try {
479
- return new SemVer(version2, options);
480
- } catch (er) {
481
- if (!throwErrors) {
482
- return null;
483
- }
484
- throw er;
485
- }
486
- };
487
- module2.exports = parse2;
488
- }
489
- });
490
-
491
30
  // src/index.ts
492
31
  var index_exports = {};
493
32
  __export(index_exports, {
@@ -498,22 +37,22 @@ __export(index_exports, {
498
37
  initConfig: () => initConfig,
499
38
  initTsDtsFile: () => initTsDtsFile,
500
39
  initTsJsonFiles: () => initTsJsonFiles,
501
- initViteConfigFile: () => initViteConfigFile,
502
- semVer: () => semVer
40
+ initViteConfigFile: () => initViteConfigFile
503
41
  });
504
42
  module.exports = __toCommonJS(index_exports);
505
- init_cjs_shims();
43
+
44
+ // ../../node_modules/.pnpm/tsup@8.3.5_@swc+core@1.10.4_jiti@2.4.2_postcss@8.4.49_tsx@4.19.2_typescript@5.7.2_yaml@2.6.1/node_modules/tsup/assets/cjs_shims.js
45
+ var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
46
+ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
47
+
48
+ // src/index.ts
506
49
  var import_node_process = __toESM(require("process"), 1);
507
50
  var import_node_url = require("url");
508
51
  var import_logger = __toESM(require("@weapp-core/logger"), 1);
509
52
  var import_shared = require("@weapp-core/shared");
510
53
  var import_fs_extra = __toESM(require("fs-extra"), 1);
511
54
 
512
- // ../../node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/index.mjs
513
- init_cjs_shims();
514
-
515
55
  // ../../node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.mjs
516
- init_cjs_shims();
517
56
  var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
518
57
  function normalizeWindowsPath(input = "") {
519
58
  if (!input) {
@@ -733,14 +272,10 @@ var path = {
733
272
  toNamespacedPath
734
273
  };
735
274
 
736
- // src/index.ts
737
- var import_parse = __toESM(require_parse(), 1);
738
-
739
- // package.json
740
- var version = "1.1.15-alpha.2";
275
+ // ../../packages/weapp-vite/package.json
276
+ var version = "2.0.1-alpha.4";
741
277
 
742
278
  // src/context.ts
743
- init_cjs_shims();
744
279
  function createContext() {
745
280
  return {
746
281
  projectConfig: {
@@ -777,7 +312,6 @@ function createContext() {
777
312
  }
778
313
 
779
314
  // src/enums.ts
780
- init_cjs_shims();
781
315
  var TemplateName = /* @__PURE__ */ ((TemplateName2) => {
782
316
  TemplateName2["default"] = "default";
783
317
  TemplateName2["tailwindcss"] = "tailwindcss";
@@ -787,7 +321,6 @@ var TemplateName = /* @__PURE__ */ ((TemplateName2) => {
787
321
  })(TemplateName || {});
788
322
 
789
323
  // src/gitignore.ts
790
- init_cjs_shims();
791
324
  function getDefaultGitignore() {
792
325
  return `# dependencies
793
326
  node_modules
@@ -826,7 +359,6 @@ vite.config.ts.timestamp-*.mjs`;
826
359
  }
827
360
 
828
361
  // src/tsconfigJson.ts
829
- init_cjs_shims();
830
362
  function getDefaultTsconfigJson() {
831
363
  return {
832
364
  compilerOptions: {
@@ -891,14 +423,12 @@ function getDefaultTsconfigNodeJson(include = []) {
891
423
  }
892
424
 
893
425
  // src/tsDts.ts
894
- init_cjs_shims();
895
426
  function getDefaultTsDts() {
896
427
  return `/// <reference types="weapp-vite/client" />
897
428
  `;
898
429
  }
899
430
 
900
431
  // src/viteConfig.ts
901
- init_cjs_shims();
902
432
  function getDefaultViteConfig() {
903
433
  return `import { defineConfig } from 'weapp-vite/config'
904
434
 
@@ -911,7 +441,6 @@ export default defineConfig({
911
441
  }
912
442
 
913
443
  // src/index.ts
914
- var semVer = (0, import_parse.default)(version);
915
444
  var __dirname = path.dirname((0, import_node_url.fileURLToPath)(importMetaUrl));
916
445
  var ctx = createContext();
917
446
  async function createOrUpdateProjectConfig(options) {
@@ -1137,7 +666,7 @@ async function createProject(targetDir = "", templateName = "default" /* default
1137
666
  const pkgJson = await import_fs_extra.default.readJson(pkgJsonPath);
1138
667
  if (pkgJson.devDependencies) {
1139
668
  if (pkgJson.devDependencies["weapp-vite"]) {
1140
- pkgJson.devDependencies["weapp-vite"] = semVer?.prerelease[0] ? `npm:weapp-vite@${semVer.prerelease[0]}` : "latest";
669
+ pkgJson.devDependencies["weapp-vite"] = version;
1141
670
  }
1142
671
  if (pkgJson.devDependencies["weapp-tailwindcss"]) {
1143
672
  pkgJson.devDependencies["weapp-tailwindcss"] = "latest";
@@ -1158,6 +687,5 @@ async function createProject(targetDir = "", templateName = "default" /* default
1158
687
  initConfig,
1159
688
  initTsDtsFile,
1160
689
  initTsJsonFiles,
1161
- initViteConfigFile,
1162
- semVer
690
+ initViteConfigFile
1163
691
  });
package/dist/index.d.cts CHANGED
@@ -1,6 +1,5 @@
1
1
  import * as pkg_types from 'pkg-types';
2
2
  import { PackageJson } from 'pkg-types';
3
- import * as semver from 'semver';
4
3
  import { set } from '@weapp-core/shared';
5
4
 
6
5
  interface SetMethod {
@@ -38,8 +37,6 @@ declare enum TemplateName {
38
37
  tdesign = "tdesign"
39
38
  }
40
39
 
41
- declare const semVer: semver.SemVer | null;
42
-
43
40
  declare function createOrUpdateProjectConfig(options: UpdateProjectConfigOptions): Promise<ProjectConfig | undefined>;
44
41
  declare function createOrUpdatePackageJson(options: UpdatePackageJsonOptions): Promise<PackageJson | undefined>;
45
42
  declare function initViteConfigFile(options: SharedUpdateOptions): Promise<string>;
@@ -82,4 +79,4 @@ declare function initConfig(options: {
82
79
  }>;
83
80
  declare function createProject(targetDir?: string, templateName?: TemplateName): Promise<void>;
84
81
 
85
- export { TemplateName, createOrUpdatePackageJson, createOrUpdateProjectConfig, createProject, initConfig, initTsDtsFile, initTsJsonFiles, initViteConfigFile, semVer };
82
+ export { TemplateName, createOrUpdatePackageJson, createOrUpdateProjectConfig, createProject, initConfig, initTsDtsFile, initTsJsonFiles, initViteConfigFile };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import * as pkg_types from 'pkg-types';
2
2
  import { PackageJson } from 'pkg-types';
3
- import * as semver from 'semver';
4
3
  import { set } from '@weapp-core/shared';
5
4
 
6
5
  interface SetMethod {
@@ -38,8 +37,6 @@ declare enum TemplateName {
38
37
  tdesign = "tdesign"
39
38
  }
40
39
 
41
- declare const semVer: semver.SemVer | null;
42
-
43
40
  declare function createOrUpdateProjectConfig(options: UpdateProjectConfigOptions): Promise<ProjectConfig | undefined>;
44
41
  declare function createOrUpdatePackageJson(options: UpdatePackageJsonOptions): Promise<PackageJson | undefined>;
45
42
  declare function initViteConfigFile(options: SharedUpdateOptions): Promise<string>;
@@ -82,4 +79,4 @@ declare function initConfig(options: {
82
79
  }>;
83
80
  declare function createProject(targetDir?: string, templateName?: TemplateName): Promise<void>;
84
81
 
85
- export { TemplateName, createOrUpdatePackageJson, createOrUpdateProjectConfig, createProject, initConfig, initTsDtsFile, initTsJsonFiles, initViteConfigFile, semVer };
82
+ export { TemplateName, createOrUpdatePackageJson, createOrUpdateProjectConfig, createProject, initConfig, initTsDtsFile, initTsJsonFiles, initViteConfigFile };