@weapp-core/init 6.0.8 → 6.0.9

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 +8 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -523,6 +523,8 @@ function getDefaultTsDts() {
523
523
  * @description 文件读取错误
524
524
  */
525
525
  var FsReadError = class extends Error {
526
+ filepath;
527
+ cause;
526
528
  constructor(filepath, cause) {
527
529
  super(`Failed to read ${filepath}`);
528
530
  this.filepath = filepath;
@@ -534,6 +536,8 @@ var FsReadError = class extends Error {
534
536
  * @description 文件写入错误
535
537
  */
536
538
  var FsWriteError = class extends Error {
539
+ filepath;
540
+ cause;
537
541
  constructor(filepath, cause) {
538
542
  super(`Failed to write ${filepath}`);
539
543
  this.filepath = filepath;
@@ -663,7 +667,7 @@ async function initTsJsonFiles(options) {
663
667
  }
664
668
  //#endregion
665
669
  //#region ../../packages/weapp-vite/package.json
666
- var version = "6.15.8";
670
+ var version = "6.16.18";
667
671
  //#endregion
668
672
  //#region src/npm.ts
669
673
  /**
@@ -922,17 +926,17 @@ function ensureTrailingNewline(value) {
922
926
  function mergeGitignore(existing) {
923
927
  const normalizedExisting = normalizeLineEndings(existing ?? "");
924
928
  const merged = [...normalizedExisting.length ? normalizedExisting.split("\n") : []];
925
- while (merged.length > 0 && merged.at(-1) === "") merged.pop();
929
+ while (merged.length > 0 && merged[merged.length - 1] === "") merged.pop();
926
930
  const seen = new Set(merged);
927
931
  let appendedNonBlank = false;
928
932
  for (const line of DEFAULT_GITIGNORE.split("\n")) {
929
933
  if (line.length === 0) {
930
- if (merged.length === 0 || merged.at(-1) === "") continue;
934
+ if (merged.length === 0 || merged[merged.length - 1] === "") continue;
931
935
  merged.push("");
932
936
  continue;
933
937
  }
934
938
  if (seen.has(line)) continue;
935
- if (!appendedNonBlank && merged.length > 0 && merged.at(-1) !== "") merged.push("");
939
+ if (!appendedNonBlank && merged.length > 0 && merged[merged.length - 1] !== "") merged.push("");
936
940
  merged.push(line);
937
941
  seen.add(line);
938
942
  appendedNonBlank = true;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-core/init",
3
3
  "type": "module",
4
- "version": "6.0.8",
4
+ "version": "6.0.9",
5
5
  "description": "@weapp-core/init",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -39,8 +39,8 @@
39
39
  "node": "^20.19.0 || >=22.12.0"
40
40
  },
41
41
  "dependencies": {
42
- "@weapp-core/logger": "^3.1.1",
43
- "@weapp-core/shared": "^3.0.4"
42
+ "@weapp-core/logger": "3.1.1",
43
+ "@weapp-core/shared": "3.0.4"
44
44
  },
45
45
  "scripts": {
46
46
  "dev": "tsdown -w --sourcemap",