@weapp-core/init 3.0.1 → 3.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.
package/dist/index.cjs CHANGED
@@ -42,7 +42,7 @@ __export(index_exports, {
42
42
  });
43
43
  module.exports = __toCommonJS(index_exports);
44
44
 
45
- // ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.19_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_typescript@5.9.3_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
45
+ // ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.21_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_typescript@5.9.3_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
46
46
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
47
47
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
48
48
 
@@ -573,23 +573,39 @@ function getDefaultTsDts() {
573
573
 
574
574
  // src/utils/fs.ts
575
575
  var import_fs_extra = __toESM(require("fs-extra"), 1);
576
+ var FsReadError = class extends Error {
577
+ constructor(filepath, cause) {
578
+ super(`Failed to read ${filepath}`);
579
+ this.filepath = filepath;
580
+ this.cause = cause;
581
+ this.name = "FsReadError";
582
+ }
583
+ };
584
+ var FsWriteError = class extends Error {
585
+ constructor(filepath, cause) {
586
+ super(`Failed to write ${filepath}`);
587
+ this.filepath = filepath;
588
+ this.cause = cause;
589
+ this.name = "FsWriteError";
590
+ }
591
+ };
576
592
  async function readJsonIfExists(filepath) {
577
593
  try {
578
- if (!await import_fs_extra.default.pathExists(filepath)) {
579
- return null;
580
- }
581
594
  return await import_fs_extra.default.readJSON(filepath);
582
595
  } catch (error) {
596
+ if (error?.code === "ENOENT") {
597
+ return null;
598
+ }
583
599
  throw new FsReadError(filepath, error);
584
600
  }
585
601
  }
586
602
  async function readFileIfExists(filepath) {
587
603
  try {
588
- if (!await import_fs_extra.default.pathExists(filepath)) {
589
- return null;
590
- }
591
604
  return await import_fs_extra.default.readFile(filepath, "utf8");
592
605
  } catch (error) {
606
+ if (error?.code === "ENOENT") {
607
+ return null;
608
+ }
593
609
  throw new FsReadError(filepath, error);
594
610
  }
595
611
  }
@@ -609,22 +625,6 @@ async function writeFile(filepath, contents) {
609
625
  throw new FsWriteError(filepath, error);
610
626
  }
611
627
  }
612
- var FsReadError = class extends Error {
613
- constructor(filepath, cause) {
614
- super(`Failed to read ${filepath}`);
615
- this.filepath = filepath;
616
- this.cause = cause;
617
- this.name = "FsReadError";
618
- }
619
- };
620
- var FsWriteError = class extends Error {
621
- constructor(filepath, cause) {
622
- super(`Failed to write ${filepath}`);
623
- this.filepath = filepath;
624
- this.cause = cause;
625
- this.name = "FsWriteError";
626
- }
627
- };
628
628
 
629
629
  // src/utils/path.ts
630
630
  function resolveOutputPath(root, dest, fallback) {
@@ -704,7 +704,7 @@ var import_logger3 = __toESM(require("@weapp-core/logger"), 1);
704
704
  var import_fs_extra2 = __toESM(require("fs-extra"), 1);
705
705
 
706
706
  // ../../packages/weapp-vite/package.json
707
- var version = "5.2.1";
707
+ var version = "5.6.0";
708
708
 
709
709
  // src/enums.ts
710
710
  var TemplateName = /* @__PURE__ */ ((TemplateName2) => {
@@ -792,6 +792,7 @@ yarn-error.log*
792
792
 
793
793
  dist
794
794
  dist-plugin
795
+ dist-web
795
796
  vite.config.ts.timestamp-*.mjs`;
796
797
  function mergeGitignore(existing) {
797
798
  const normalizedExisting = normalizeLineEndings(existing ?? "");
package/dist/index.js CHANGED
@@ -525,23 +525,39 @@ function getDefaultTsDts() {
525
525
 
526
526
  // src/utils/fs.ts
527
527
  import fs from "fs-extra";
528
+ var FsReadError = class extends Error {
529
+ constructor(filepath, cause) {
530
+ super(`Failed to read ${filepath}`);
531
+ this.filepath = filepath;
532
+ this.cause = cause;
533
+ this.name = "FsReadError";
534
+ }
535
+ };
536
+ var FsWriteError = class extends Error {
537
+ constructor(filepath, cause) {
538
+ super(`Failed to write ${filepath}`);
539
+ this.filepath = filepath;
540
+ this.cause = cause;
541
+ this.name = "FsWriteError";
542
+ }
543
+ };
528
544
  async function readJsonIfExists(filepath) {
529
545
  try {
530
- if (!await fs.pathExists(filepath)) {
531
- return null;
532
- }
533
546
  return await fs.readJSON(filepath);
534
547
  } catch (error) {
548
+ if (error?.code === "ENOENT") {
549
+ return null;
550
+ }
535
551
  throw new FsReadError(filepath, error);
536
552
  }
537
553
  }
538
554
  async function readFileIfExists(filepath) {
539
555
  try {
540
- if (!await fs.pathExists(filepath)) {
541
- return null;
542
- }
543
556
  return await fs.readFile(filepath, "utf8");
544
557
  } catch (error) {
558
+ if (error?.code === "ENOENT") {
559
+ return null;
560
+ }
545
561
  throw new FsReadError(filepath, error);
546
562
  }
547
563
  }
@@ -561,22 +577,6 @@ async function writeFile(filepath, contents) {
561
577
  throw new FsWriteError(filepath, error);
562
578
  }
563
579
  }
564
- var FsReadError = class extends Error {
565
- constructor(filepath, cause) {
566
- super(`Failed to read ${filepath}`);
567
- this.filepath = filepath;
568
- this.cause = cause;
569
- this.name = "FsReadError";
570
- }
571
- };
572
- var FsWriteError = class extends Error {
573
- constructor(filepath, cause) {
574
- super(`Failed to write ${filepath}`);
575
- this.filepath = filepath;
576
- this.cause = cause;
577
- this.name = "FsWriteError";
578
- }
579
- };
580
580
 
581
581
  // src/utils/path.ts
582
582
  function resolveOutputPath(root, dest, fallback) {
@@ -656,7 +656,7 @@ import logger3 from "@weapp-core/logger";
656
656
  import fs2 from "fs-extra";
657
657
 
658
658
  // ../../packages/weapp-vite/package.json
659
- var version = "5.2.1";
659
+ var version = "5.6.0";
660
660
 
661
661
  // src/enums.ts
662
662
  var TemplateName = /* @__PURE__ */ ((TemplateName2) => {
@@ -744,6 +744,7 @@ yarn-error.log*
744
744
 
745
745
  dist
746
746
  dist-plugin
747
+ dist-web
747
748
  vite.config.ts.timestamp-*.mjs`;
748
749
  function mergeGitignore(existing) {
749
750
  const normalizedExisting = normalizeLineEndings(existing ?? "");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-core/init",
3
3
  "type": "module",
4
- "version": "3.0.1",
4
+ "version": "3.0.2",
5
5
  "description": "@weapp-core/init",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -31,4 +31,5 @@ yarn-error.log*
31
31
  .turbo
32
32
 
33
33
  dist
34
- vite.config.ts.timestamp-*.mjs
34
+ vite.config.ts.timestamp-*.mjs
35
+ dist-web
@@ -31,4 +31,5 @@ yarn-error.log*
31
31
  .turbo
32
32
 
33
33
  dist
34
- vite.config.ts.timestamp-*.mjs
34
+ vite.config.ts.timestamp-*.mjs
35
+ dist-web
@@ -32,7 +32,7 @@
32
32
  "sass": "^1.93.2",
33
33
  "tailwindcss": "^3.4.17",
34
34
  "typescript": "^5.9.3",
35
- "weapp-tailwindcss": "^4.3.3",
35
+ "weapp-tailwindcss": "^4.5.2",
36
36
  "weapp-vite": "workspace:*"
37
37
  }
38
38
  }
@@ -31,4 +31,5 @@ yarn-error.log*
31
31
  .turbo
32
32
 
33
33
  dist
34
- vite.config.ts.timestamp-*.mjs
34
+ vite.config.ts.timestamp-*.mjs
35
+ dist-web
@@ -24,7 +24,7 @@
24
24
  "postinstall": "weapp-tw patch"
25
25
  },
26
26
  "dependencies": {
27
- "tdesign-miniprogram": "^1.10.1"
27
+ "tdesign-miniprogram": "^1.11.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@egoist/tailwindcss-icons": "^1.9.0",
@@ -35,7 +35,7 @@
35
35
  "sass": "^1.93.2",
36
36
  "tailwindcss": "^3.4.17",
37
37
  "typescript": "^5.9.3",
38
- "weapp-tailwindcss": "^4.3.3",
38
+ "weapp-tailwindcss": "^4.5.2",
39
39
  "weapp-vite": "workspace:*"
40
40
  }
41
41
  }
@@ -31,4 +31,5 @@ yarn-error.log*
31
31
  .turbo
32
32
 
33
33
  dist
34
- vite.config.ts.timestamp-*.mjs
34
+ vite.config.ts.timestamp-*.mjs
35
+ dist-web
@@ -35,7 +35,7 @@
35
35
  "sass": "^1.93.2",
36
36
  "tailwindcss": "^3.4.17",
37
37
  "typescript": "^5.9.3",
38
- "weapp-tailwindcss": "^4.3.3",
38
+ "weapp-tailwindcss": "^4.5.2",
39
39
  "weapp-vite": "workspace:*"
40
40
  }
41
41
  }