zixulu 1.58.2 → 1.58.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.
@@ -32,7 +32,7 @@ async function removeLock() {
32
32
  await (0, import_promises.rm)("pnpm-lock.yaml", { force: true, recursive: true });
33
33
  await (0, import_promises.rm)("bun.lockb", { force: true, recursive: true });
34
34
  await (0, import_promises.rm)("bun.lock", { force: true, recursive: true });
35
- await (0, import_addRuleToGitIgnore.addRuleToGitIgnore)("package-lock.json", "yarn.lock", "pnpm-lock.yaml", "bun.lockb");
35
+ await (0, import_addRuleToGitIgnore.addRuleToGitIgnore)("package-lock.json", "yarn.lock", "pnpm-lock.yaml", "bun.lockb", "bun.lock");
36
36
  return (0, import_getCommitMessage.getCommitMessage)(import_constant.CommitType.feature, "删除包管理 lock 文件");
37
37
  }
38
38
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/removeLock.ts"],
4
- "sourcesContent": ["import { rm } from \"fs/promises\"\n\nimport { CommitType } from \"@src/constant\"\n\nimport { addRuleToGitIgnore } from \"./addRuleToGitIgnore\"\nimport { getCommitMessage } from \"./getCommitMessage\"\n\nexport async function removeLock() {\n await rm(\"package-lock.json\", { force: true, recursive: true })\n await rm(\"yarn.lock\", { force: true, recursive: true })\n await rm(\"pnpm-lock.yaml\", { force: true, recursive: true })\n await rm(\"bun.lockb\", { force: true, recursive: true })\n await rm(\"bun.lock\", { force: true, recursive: true })\n await addRuleToGitIgnore(\"package-lock.json\", \"yarn.lock\", \"pnpm-lock.yaml\", \"bun.lockb\")\n return getCommitMessage(CommitType.feature, \"删除包管理 lock 文件\")\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAmB;AAEnB,sBAA2B;AAE3B,gCAAmC;AACnC,8BAAiC;AAEjC,eAAsB,aAAa;AAC/B,YAAM,oBAAG,qBAAqB,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAC9D,YAAM,oBAAG,aAAa,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AACtD,YAAM,oBAAG,kBAAkB,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAC3D,YAAM,oBAAG,aAAa,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AACtD,YAAM,oBAAG,YAAY,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AACrD,YAAM,8CAAmB,qBAAqB,aAAa,kBAAkB,WAAW;AACxF,aAAO,0CAAiB,2BAAW,SAAS,eAAe;AAC/D;",
4
+ "sourcesContent": ["import { rm } from \"fs/promises\"\n\nimport { CommitType } from \"@src/constant\"\n\nimport { addRuleToGitIgnore } from \"./addRuleToGitIgnore\"\nimport { getCommitMessage } from \"./getCommitMessage\"\n\nexport async function removeLock() {\n await rm(\"package-lock.json\", { force: true, recursive: true })\n await rm(\"yarn.lock\", { force: true, recursive: true })\n await rm(\"pnpm-lock.yaml\", { force: true, recursive: true })\n await rm(\"bun.lockb\", { force: true, recursive: true })\n await rm(\"bun.lock\", { force: true, recursive: true })\n await addRuleToGitIgnore(\"package-lock.json\", \"yarn.lock\", \"pnpm-lock.yaml\", \"bun.lockb\", \"bun.lock\")\n return getCommitMessage(CommitType.feature, \"删除包管理 lock 文件\")\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAmB;AAEnB,sBAA2B;AAE3B,gCAAmC;AACnC,8BAAiC;AAEjC,eAAsB,aAAa;AAC/B,YAAM,oBAAG,qBAAqB,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAC9D,YAAM,oBAAG,aAAa,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AACtD,YAAM,oBAAG,kBAAkB,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAC3D,YAAM,oBAAG,aAAa,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AACtD,YAAM,oBAAG,YAAY,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AACrD,YAAM,8CAAmB,qBAAqB,aAAa,kBAAkB,aAAa,UAAU;AACpG,aAAO,0CAAiB,2BAAW,SAAS,eAAe;AAC/D;",
6
6
  "names": []
7
7
  }
@@ -28,9 +28,16 @@ async function serverToAction() {
28
28
  const dir = await (0, import_promises.readdir)("server");
29
29
  await (0, import_promises.rm)("actions", { recursive: true, force: true });
30
30
  const actions = dir.filter((item) => item.toLowerCase().endsWith(".ts"));
31
+ const actions2 = [];
32
+ for (const item of actions) {
33
+ const content = await (0, import_promises.readFile)((0, import_path.join)("server", item), "utf-8");
34
+ if (/^"no export"$/m.test(content))
35
+ continue;
36
+ actions2.push(item);
37
+ }
31
38
  await (0, import_promises.mkdir)("actions", { recursive: true });
32
39
  await Promise.all(
33
- actions.map(async (item) => {
40
+ actions2.map(async (item) => {
34
41
  const base = item.replace(/\.ts$/i, "");
35
42
  await (0, import_promises.writeFile)(
36
43
  (0, import_path.join)("actions", item),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/serverToAction.ts"],
4
- "sourcesContent": ["import { mkdir, readdir, rm, writeFile } from \"fs/promises\"\r\nimport { join } from \"path\"\r\n\r\nexport async function serverToAction() {\r\n const dir = await readdir(\"server\")\r\n await rm(\"actions\", { recursive: true, force: true })\r\n const actions = dir.filter(item => item.toLowerCase().endsWith(\".ts\"))\r\n await mkdir(\"actions\", { recursive: true })\r\n await Promise.all(\r\n actions.map(async item => {\r\n const base = item.replace(/\\.ts$/i, \"\")\r\n await writeFile(\r\n join(\"actions\", item),\r\n `\"use server\"\r\n\r\nimport { ${base} } from \"@/server/${base}\"\r\n\r\nimport { getDataResponse } from \"@/utils/getDataResponse\"\r\n\r\nexport async function ${base}Action(...args: Parameters<typeof ${base}>) {\r\n return await getDataResponse(${base}, ...args)\r\n}\r\n`,\r\n )\r\n }),\r\n )\r\n}\r\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA8C;AAC9C,kBAAqB;AAErB,eAAsB,iBAAiB;AACnC,QAAM,MAAM,UAAM,yBAAQ,QAAQ;AAClC,YAAM,oBAAG,WAAW,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AACpD,QAAM,UAAU,IAAI,OAAO,UAAQ,KAAK,YAAY,EAAE,SAAS,KAAK,CAAC;AACrE,YAAM,uBAAM,WAAW,EAAE,WAAW,KAAK,CAAC;AAC1C,QAAM,QAAQ;AAAA,IACV,QAAQ,IAAI,OAAM,SAAQ;AACtB,YAAM,OAAO,KAAK,QAAQ,UAAU,EAAE;AACtC,gBAAM;AAAA,YACF,kBAAK,WAAW,IAAI;AAAA,QACpB;AAAA;AAAA,WAEL,yBAAyB;AAAA;AAAA;AAAA;AAAA,wBAIZ,yCAAyC;AAAA,mCAC9B;AAAA;AAAA;AAAA,MAGvB;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;",
4
+ "sourcesContent": ["import { mkdir, readFile, readdir, rm, writeFile } from \"fs/promises\"\r\nimport { join } from \"path\"\r\n\r\nexport async function serverToAction() {\r\n const dir = await readdir(\"server\")\r\n await rm(\"actions\", { recursive: true, force: true })\r\n const actions = dir.filter(item => item.toLowerCase().endsWith(\".ts\"))\r\n const actions2: string[] = []\r\n for (const item of actions) {\r\n const content = await readFile(join(\"server\", item), \"utf-8\")\r\n if (/^\"no export\"$/m.test(content)) continue\r\n actions2.push(item)\r\n }\r\n await mkdir(\"actions\", { recursive: true })\r\n await Promise.all(\r\n actions2.map(async item => {\r\n const base = item.replace(/\\.ts$/i, \"\")\r\n await writeFile(\r\n join(\"actions\", item),\r\n `\"use server\"\r\n\r\nimport { ${base} } from \"@/server/${base}\"\r\n\r\nimport { getDataResponse } from \"@/utils/getDataResponse\"\r\n\r\nexport async function ${base}Action(...args: Parameters<typeof ${base}>) {\r\n return await getDataResponse(${base}, ...args)\r\n}\r\n`,\r\n )\r\n }),\r\n )\r\n}\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAwD;AACxD,kBAAqB;AAErB,eAAsB,iBAAiB;AACnC,QAAM,MAAM,UAAM,yBAAQ,QAAQ;AAClC,YAAM,oBAAG,WAAW,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AACpD,QAAM,UAAU,IAAI,OAAO,UAAQ,KAAK,YAAY,EAAE,SAAS,KAAK,CAAC;AACrE,QAAM,WAAqB,CAAC;AAC5B,aAAW,QAAQ,SAAS;AACxB,UAAM,UAAU,UAAM,8BAAS,kBAAK,UAAU,IAAI,GAAG,OAAO;AAC5D,QAAI,iBAAiB,KAAK,OAAO;AAAG;AACpC,aAAS,KAAK,IAAI;AAAA,EACtB;AACA,YAAM,uBAAM,WAAW,EAAE,WAAW,KAAK,CAAC;AAC1C,QAAM,QAAQ;AAAA,IACV,SAAS,IAAI,OAAM,SAAQ;AACvB,YAAM,OAAO,KAAK,QAAQ,UAAU,EAAE;AACtC,gBAAM;AAAA,YACF,kBAAK,WAAW,IAAI;AAAA,QACpB;AAAA;AAAA,WAEL,yBAAyB;AAAA;AAAA;AAAA;AAAA,wBAIZ,yCAAyC;AAAA,mCAC9B;AAAA;AAAA;AAAA,MAGvB;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zixulu",
3
- "version": "1.58.2",
3
+ "version": "1.58.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "bin": {
@@ -1,13 +1,19 @@
1
- import { mkdir, readdir, rm, writeFile } from "fs/promises"
1
+ import { mkdir, readFile, readdir, rm, writeFile } from "fs/promises"
2
2
  import { join } from "path"
3
3
 
4
4
  export async function serverToAction() {
5
5
  const dir = await readdir("server")
6
6
  await rm("actions", { recursive: true, force: true })
7
7
  const actions = dir.filter(item => item.toLowerCase().endsWith(".ts"))
8
+ const actions2: string[] = []
9
+ for (const item of actions) {
10
+ const content = await readFile(join("server", item), "utf-8")
11
+ if (/^"no export"$/m.test(content)) continue
12
+ actions2.push(item)
13
+ }
8
14
  await mkdir("actions", { recursive: true })
9
15
  await Promise.all(
10
- actions.map(async item => {
16
+ actions2.map(async item => {
11
17
  const base = item.replace(/\.ts$/i, "")
12
18
  await writeFile(
13
19
  join("actions", item),