@karinjs/plugin-puppeteer 1.0.21 → 1.1.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.
@@ -6,7 +6,7 @@ import { basePath } from 'node-karin/root';
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@karinjs/plugin-puppeteer",
9
- version: "1.0.21",
9
+ version: "1.1.2",
10
10
  description: "karin\u7684 puppeteer\u622A\u56FE\u3001\u6E32\u67D3\u63D2\u4EF6",
11
11
  keywords: [
12
12
  "karin",
@@ -22,24 +22,21 @@ var package_default = {
22
22
  main: "dist/index.js",
23
23
  types: "dist/index.d.ts",
24
24
  files: [
25
- "dist",
26
- "!LICENSE",
27
- "!README.md"
25
+ "dist"
28
26
  ],
29
27
  scripts: {
30
28
  build: "tsc && tsup",
31
- dev: "tsx src/index.ts",
29
+ dev: "tsx src/app.ts",
32
30
  "dev:test": "node dist/index.js",
33
31
  pub: "pnpm publish --access public",
34
32
  rm: `node -e "require('fs').rmSync('dist', { recursive: true, force: true })"`,
35
33
  sync: 'curl -X PUT "https://registry-direct.npmmirror.com/-/package/@karinjs/plugin-puppeteer/syncs"'
36
34
  },
37
35
  dependencies: {
38
- "@karinjs/puppeteer": "workspace:*"
36
+ "@snapka/puppeteer": "0.1.5"
39
37
  },
40
38
  devDependencies: {
41
- "@karinjs/puppeteer-types": "workspace:*",
42
- "node-karin": "^1.7.12"
39
+ "node-karin": "^1.13.0"
43
40
  },
44
41
  karin: {
45
42
  main: "src/index.ts",
@@ -48,49 +45,29 @@ var package_default = {
48
45
  "ts-web": "src/web.config.ts",
49
46
  files: [
50
47
  "config"
51
- ],
52
- env: [
53
- {
54
- key: "PUPPETEER_CACHE_DIR",
55
- value: "",
56
- comment: "Puppeteer\u7F13\u5B58\u7684\u9ED8\u8BA4\u6839\u76EE\u5F55"
57
- },
58
- {
59
- key: "PUPPETEER_CACHE_VERSION",
60
- value: "",
61
- comment: "\u8BB0\u5F55puppeteer\u4E0B\u8F7D\u8FC7\u7684\u6D4F\u89C8\u5668\u4FE1\u606F"
62
- },
63
- {
64
- key: "PUPPETEER_CHROME_HEADLESS_SHELL_VERSION",
65
- value: "",
66
- comment: "Puppeteer\u4E0B\u8F7D\u6D4F\u89C8\u5668\u7684\u7248\u672C"
67
- },
68
- {
69
- key: "PUPPETEER_EXECUTABLE_PATH",
70
- value: "",
71
- comment: "Puppeteer\u53EF\u6267\u884C\u6587\u4EF6\u8DEF\u5F84 \u914D\u7F6E\u540E\u5C06\u4F7F\u7528\u6B64\u8DEF\u5F84\u7684\u6D4F\u89C8\u5668"
72
- },
73
- {
74
- key: "PUPPETEER_CHROME_HEADLESS_SHELL_DOWNLOAD_BASE_URL",
75
- value: "",
76
- comment: "Puppeteer\u6D4F\u89C8\u5668host\u5730\u5740"
77
- }
78
48
  ]
79
49
  },
80
50
  timestamp: "2025-10-01T00:47:22.222Z"
81
51
  };
82
52
  var HMR_KEY = "karin-plugin-puppeteer-hmr";
83
53
  var defaultConfig = {
84
- downloadBrowser: "chrome",
85
54
  protocol: "cdp",
86
- headless: true,
55
+ headless: "shell",
87
56
  debug: false,
88
- maxPages: 10,
89
- idleTime: 500,
90
- hmr: false,
91
- executablePath: "",
92
- pipe: false,
93
- userDataDir: "",
57
+ findBrowser: true,
58
+ slowMo: 0,
59
+ maxOpenPages: 10,
60
+ pageMode: "reuse",
61
+ pageIdleTimeout: 6e4,
62
+ defaultViewport: {
63
+ width: 800,
64
+ height: 600
65
+ },
66
+ download: {
67
+ enable: true,
68
+ browser: "chrome-headless-shell",
69
+ version: "latest"
70
+ },
94
71
  args: [
95
72
  "--window-size=800,600",
96
73
  // 设置窗口大小
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from '@karinjs/puppeteer';
1
+ export * from '@snapka/puppeteer';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { getConfig, HMR_KEY, pluginVersion, pluginName } from './chunk-TPFKFKF4.js';
1
+ import { getConfig, HMR_KEY, pluginVersion, pluginName } from './chunk-PIY2AHNK.js';
2
2
  import path from 'node:path';
3
- import { launch } from '@karinjs/puppeteer';
4
- export * from '@karinjs/puppeteer';
3
+ import { snapka } from '@snapka/puppeteer';
4
+ export * from '@snapka/puppeteer';
5
5
  import { karin, registerRender, renderTpl, logger } from 'node-karin';
6
6
 
7
7
  var formatBytes = (bytes) => {
@@ -13,7 +13,7 @@ var formatBytes = (bytes) => {
13
13
  };
14
14
  var getScreenshotByteSize = (payload, encoding) => {
15
15
  try {
16
- if (payload == null) return void 0;
16
+ if (payload == null) return null;
17
17
  const enc = (encoding || "").toLowerCase();
18
18
  if (Array.isArray(payload)) {
19
19
  let total = 0;
@@ -37,35 +37,32 @@ var getScreenshotByteSize = (payload, encoding) => {
37
37
  if (anyPayload.buffer instanceof ArrayBuffer) return anyPayload.buffer.byteLength;
38
38
  if (typeof anyPayload.byteLength === "number") return anyPayload.byteLength;
39
39
  if (typeof anyPayload.length === "number") return anyPayload.length;
40
- return void 0;
40
+ return null;
41
41
  } catch {
42
- return void 0;
42
+ return null;
43
43
  }
44
44
  };
45
45
  var main = async () => {
46
46
  const config = getConfig();
47
- const browser = await launch(config);
48
- karin.on(HMR_KEY, (cfg) => browser.hmrConfig(cfg));
47
+ const browser = await snapka.launch(config);
48
+ karin.on(HMR_KEY, async () => {
49
+ await browser.restart();
50
+ });
49
51
  const name = "@karinjs/plugin-puppeteer";
50
52
  registerRender(name, async (options) => {
51
53
  options.encoding = "base64";
52
54
  const data = renderTpl(options);
53
55
  data.encoding = options.encoding;
54
56
  const time = Date.now();
55
- const result = await browser.screenshot(data);
57
+ const { run } = await browser.screenshot(data);
58
+ const result = await run();
56
59
  const fileName = typeof data?.file === "string" ? path.basename(data.file) : "unknown";
57
- if (!result.status) {
58
- logger.info(
59
- `[${name}][${fileName}] \u622A\u56FE\u5931\u8D25 \u8017\u65F6: ${logger.green(Date.now() - time + "")} ms`
60
- );
61
- throw new Error(result.data.message || "\u622A\u56FE\u5931\u8D25", { cause: result.data });
62
- }
63
- const sizeBytes = getScreenshotByteSize(result.data, options.encoding);
64
- const sizeStr = sizeBytes != null ? `\u5927\u5C0F: ${logger.green(formatBytes(sizeBytes))} ` : "";
60
+ const sizeBytes = getScreenshotByteSize(result, options.encoding);
61
+ const sizeStr = typeof sizeBytes === "number" ? `\u5927\u5C0F: ${logger.green(formatBytes(sizeBytes))} ` : "";
65
62
  logger.info(
66
63
  `[${name}][${fileName}] \u622A\u56FE\u5B8C\u6210 ${sizeStr}\u8017\u65F6: ${logger.green(Date.now() - time + "")} ms`
67
64
  );
68
- return result.data;
65
+ return result;
69
66
  });
70
67
  logger.info(`${logger.violet(`[\u63D2\u4EF6:${pluginVersion}]`)} ${logger.green(pluginName)} \u521D\u59CB\u5316\u5B8C\u6210~`);
71
68
  };
@@ -1,10 +1,10 @@
1
- import { LaunchOptions } from '@karinjs/puppeteer';
1
+ import { PuppeteerLaunchOptions } from '@snapka/puppeteer';
2
2
  import { GetConfigResponse, ComponentConfig } from 'node-karin';
3
3
 
4
4
  declare const webConfig: {
5
5
  info: GetConfigResponse['info'];
6
6
  components: () => ComponentConfig[];
7
- save: (config: LaunchOptions) => {
7
+ save: (config: PuppeteerLaunchOptions) => {
8
8
  success: boolean;
9
9
  message: string;
10
10
  };
@@ -1,4 +1,4 @@
1
- import { package_default, saveConfig, getConfig } from './chunk-TPFKFKF4.js';
1
+ import { package_default, saveConfig, getConfig } from './chunk-PIY2AHNK.js';
2
2
  import { components } from 'node-karin';
3
3
 
4
4
  var webConfig = {
@@ -25,22 +25,54 @@ var webConfig = {
25
25
  components: () => {
26
26
  const config = getConfig();
27
27
  return [
28
+ components.switch.create("downloadEnable", {
29
+ label: "\u542F\u7528\u6D4F\u89C8\u5668\u4E0B\u8F7D",
30
+ description: "\u662F\u5426\u542F\u7528\u6D4F\u89C8\u5668\u81EA\u52A8\u4E0B\u8F7D\u529F\u80FD",
31
+ defaultSelected: config.download?.enable !== false,
32
+ color: "success"
33
+ }),
28
34
  components.radio.group("downloadBrowser", {
29
35
  label: "\u4E0B\u8F7D\u7684\u6D4F\u89C8\u5668",
30
36
  orientation: "horizontal",
31
- description: "\u6CA1\u6709\u6D4F\u89C8\u5668\u65F6\uFF0C\u4E0B\u8F7D\u7684\u6D4F\u89C8\u5668\u7248\u672C\uFF0Clinux\u63A8\u8350 chrome-headless-shell",
32
- defaultValue: config.downloadBrowser,
37
+ description: "\u6CA1\u6709\u6D4F\u89C8\u5668\u65F6\uFF0C\u4E0B\u8F7D\u7684\u6D4F\u89C8\u5668\u7C7B\u578B\uFF0Clinux\u63A8\u8350 chrome-headless-shell",
38
+ defaultValue: config.download?.browser || "chrome",
33
39
  radio: [
34
40
  components.radio.create("chrome", {
35
41
  label: "chrome",
36
42
  value: "chrome"
37
43
  }),
44
+ components.radio.create("chromium", {
45
+ label: "chromium",
46
+ value: "chromium"
47
+ }),
38
48
  components.radio.create("chrome-headless-shell", {
39
49
  label: "chrome-headless-shell",
40
50
  value: "chrome-headless-shell"
41
51
  })
42
52
  ]
43
53
  }),
54
+ components.input.string("downloadVersion", {
55
+ label: "\u4E0B\u8F7D\u6D4F\u89C8\u5668\u7248\u672C",
56
+ description: "\u652F\u6301\uFF1Alatest\u3001stable\u3001beta\u3001dev\u3001canary \u6216\u7279\u5B9A\u7248\u672C\u53F7",
57
+ defaultValue: config.download?.version || "stable",
58
+ isRequired: false,
59
+ className: "inline-block p-2"
60
+ }),
61
+ components.input.string("downloadDir", {
62
+ label: "\u4E0B\u8F7D\u76EE\u5F55",
63
+ description: "\u6D4F\u89C8\u5668\u4E0B\u8F7D\u4FDD\u5B58\u76EE\u5F55\uFF0C\u4E3A\u7A7A\u5219\u4F7F\u7528\u9ED8\u8BA4\u8DEF\u5F84",
64
+ defaultValue: config.download?.dir || "",
65
+ isRequired: false,
66
+ className: "inline-block p-2"
67
+ }),
68
+ components.input.string("downloadBaseUrl", {
69
+ label: "\u81EA\u5B9A\u4E49\u4E0B\u8F7D\u6E90",
70
+ description: "\u81EA\u5B9A\u4E49\u4E0B\u8F7D\u6E90URL\uFF0C\u4E0D\u5EFA\u8BAE\u8BBE\u7F6E",
71
+ defaultValue: config.download?.baseUrl || "",
72
+ isRequired: false,
73
+ className: "inline-block p-2"
74
+ }),
75
+ components.divider.create("divider0"),
44
76
  components.radio.group("protocol", {
45
77
  label: "protocol",
46
78
  orientation: "horizontal",
@@ -62,23 +94,24 @@ var webConfig = {
62
94
  components.divider.create("divider1"),
63
95
  components.radio.group("headless", {
64
96
  label: "\u65E0\u5934\u6A21\u5F0F",
65
- description: "\u662F\u5426\u65E0\u5934\u6A21\u5F0F\uFF0C\u65E0\u5934\u6A21\u5F0F\u4E0B\uFF0C\u6D4F\u89C8\u5668\u5C06\u540E\u53F0\u8FD0\u884C\uFF0C\u4E0D\u4F1A\u6253\u5F00\u6D4F\u89C8\u5668\u7A97\u53E3",
66
- defaultValue: String(config.headless),
97
+ orientation: "horizontal",
98
+ description: "\u65E0\u5934\u6A21\u5F0F\u914D\u7F6E\uFF0C\u6700\u65B0\u7248chrome\u652F\u6301\u6240\u6709\u9009\u9879",
99
+ defaultValue: config.headless || "new",
67
100
  radio: [
68
- components.radio.create("headless:true", {
69
- label: "true",
70
- value: "true",
71
- description: "\u6253\u5F00\u65E0\u5934\u6A21\u5F0F"
72
- }),
73
- components.radio.create("headless:false", {
74
- label: "false",
75
- value: "false",
76
- description: "\u5173\u95ED\u65E0\u5934\u6A21\u5F0F"
101
+ components.radio.create("new", {
102
+ label: "new",
103
+ value: "new",
104
+ description: "\u4F7F\u7528\u65B0\u7684\u65E0\u5934\u6A21\u5F0F\uFF08\u63A8\u8350\uFF09"
77
105
  }),
78
106
  components.radio.create("shell", {
79
107
  label: "shell",
80
108
  value: "shell",
81
- description: "\u4F7F\u7528chrome-headless-shell"
109
+ description: "\u4F7F\u7528\u4F20\u7EDF\u65E0\u5934\u6A21\u5F0F\uFF08\u4EC5chrome-headless-shell\uFF09"
110
+ }),
111
+ components.radio.create("false", {
112
+ label: "false",
113
+ value: "false",
114
+ description: "\u4EE5\u6709\u5934\u6A21\u5F0F\u542F\u52A8\u6D4F\u89C8\u5668"
82
115
  })
83
116
  ]
84
117
  }),
@@ -89,11 +122,11 @@ var webConfig = {
89
122
  defaultSelected: config.debug,
90
123
  color: "success"
91
124
  }),
92
- // hmr
93
- components.switch.create("hmr", {
94
- label: "\u70ED\u66F4\u65B0",
95
- description: "\u662F\u5426\u5F00\u542F\u70ED\u66F4\u65B0\uFF0C\u5F00\u542F\u540E\uFF0C\u524D\u7AEF\u70B9\u51FB\u4FDD\u5B58\u540E\u4F1A\u5F3A\u5236\u5173\u95ED\u6240\u6709\u6B63\u5728\u8FDB\u884C\u7684\u622A\u56FE\u4EFB\u52A1\u5E76\u91CD\u8F7D\u914D\u7F6E",
96
- defaultSelected: config.hmr,
125
+ // findBrowser
126
+ components.switch.create("findBrowser", {
127
+ label: "\u81EA\u52A8\u67E5\u627E\u6D4F\u89C8\u5668",
128
+ description: "\u542F\u7528\u540E\u4F1A\u4F7F\u7528 @snapka/browser-finder \u67E5\u627E\u7CFB\u7EDF\u6D4F\u89C8\u5668\u3001puppeteer\u3001playwright\u4E0B\u8F7D\u7684\u6D4F\u89C8\u5668",
129
+ defaultSelected: config.findBrowser !== false,
97
130
  color: "success"
98
131
  }),
99
132
  // pipe
@@ -104,11 +137,25 @@ var webConfig = {
104
137
  color: "success"
105
138
  }),
106
139
  components.divider.create("divider2"),
107
- // maxPages
108
- components.input.number("maxPages", {
140
+ // slowMo
141
+ components.input.number("slowMo", {
142
+ label: "\u6162\u52A8\u4F5C\u5EF6\u8FDF",
143
+ description: "\u64CD\u4F5C\u6162\u52A8\u4F5C\u5EF6\u8FDF\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09\uFF0C\u7528\u4E8E\u8C03\u8BD5",
144
+ defaultValue: (config.slowMo || 0) + "",
145
+ className: "inline-block p-2",
146
+ rules: [
147
+ {
148
+ min: 0,
149
+ max: 1e4,
150
+ error: "\u6162\u52A8\u4F5C\u5EF6\u8FDF\u5FC5\u987B\u57280-10000\u4E4B\u95F4"
151
+ }
152
+ ]
153
+ }),
154
+ // maxOpenPages
155
+ components.input.number("maxOpenPages", {
109
156
  label: "\u6700\u5927\u6807\u7B7E\u9875",
110
157
  description: "\u6700\u591A\u540C\u65F6\u6253\u5F00\u7684\u6807\u7B7E\u9875\u6570\u91CF\uFF0C\u8D85\u51FA\u540E\u5C06\u4F1A\u81EA\u52A8\u6392\u961F",
111
- defaultValue: config.maxPages + "",
158
+ defaultValue: (config.maxOpenPages || 10) + "",
112
159
  className: "inline-block p-2",
113
160
  rules: [
114
161
  {
@@ -118,17 +165,36 @@ var webConfig = {
118
165
  }
119
166
  ]
120
167
  }),
121
- // idleTime
122
- components.input.number("idleTime", {
123
- label: "\u7F51\u7EDC\u8BF7\u6C42\u7A7A\u95F2\u65F6\u95F4",
124
- description: "\u7F51\u7EDC\u8BF7\u6C42\u7A7A\u95F2\u65F6\u95F4\uFF0C\u5355\u4F4D\u4E3A\u6BEB\u79D2",
125
- defaultValue: config.idleTime + "",
168
+ // pageMode
169
+ components.radio.group("pageMode", {
170
+ label: "\u9875\u9762\u6A21\u5F0F",
171
+ orientation: "horizontal",
172
+ description: "\u9875\u9762\u7BA1\u7406\u6A21\u5F0F\uFF1A\u590D\u7528\u6A21\u5F0F\u6027\u80FD\u66F4\u597D\uFF0C\u4E00\u6B21\u6027\u6A21\u5F0F\u9694\u79BB\u6027\u66F4\u5F3A",
173
+ defaultValue: config.pageMode || "reuse",
174
+ radio: [
175
+ components.radio.create("reuse", {
176
+ label: "reuse",
177
+ value: "reuse",
178
+ description: "\u590D\u7528\u6A21\u5F0F\uFF08\u63A8\u8350\uFF09"
179
+ }),
180
+ components.radio.create("disposable", {
181
+ label: "disposable",
182
+ value: "disposable",
183
+ description: "\u4E00\u6B21\u6027\u6A21\u5F0F"
184
+ })
185
+ ]
186
+ }),
187
+ // pageIdleTimeout
188
+ components.input.number("pageIdleTimeout", {
189
+ label: "\u9875\u9762\u7A7A\u95F2\u8D85\u65F6",
190
+ description: "\u9875\u9762\u5728\u6C60\u4E2D\u7A7A\u95F2\u8D85\u8FC7\u6B64\u65F6\u95F4\u540E\u4F1A\u88AB\u81EA\u52A8\u9500\u6BC1\uFF08\u6BEB\u79D2\uFF09\uFF0C\u8BBE\u7F6E\u4E3A0\u8868\u793A\u6C38\u4E0D\u8D85\u65F6",
191
+ defaultValue: (config.pageIdleTimeout || 6e4) + "",
126
192
  className: "inline-block p-2",
127
193
  rules: [
128
194
  {
129
- min: 1,
130
- max: 999999,
131
- error: "\u7F51\u7EDC\u8BF7\u6C42\u7A7A\u95F2\u65F6\u95F4\u5FC5\u987B\u57281-999999\u4E4B\u95F4"
195
+ min: 0,
196
+ max: 999999999,
197
+ error: "\u9875\u9762\u7A7A\u95F2\u8D85\u65F6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E0"
132
198
  }
133
199
  ]
134
200
  }),
@@ -148,6 +214,34 @@ var webConfig = {
148
214
  isRequired: false,
149
215
  className: "inline-block p-2"
150
216
  }),
217
+ // defaultViewport width
218
+ components.input.number("viewportWidth", {
219
+ label: "\u9ED8\u8BA4\u89C6\u7A97\u5BBD\u5EA6",
220
+ description: "\u9ED8\u8BA4\u89C6\u7A97\u5BBD\u5EA6\uFF08\u50CF\u7D20\uFF09",
221
+ defaultValue: (config.defaultViewport?.width || 800) + "",
222
+ className: "inline-block p-2",
223
+ rules: [
224
+ {
225
+ min: 1,
226
+ max: 1e4,
227
+ error: "\u89C6\u7A97\u5BBD\u5EA6\u5FC5\u987B\u57281-10000\u4E4B\u95F4"
228
+ }
229
+ ]
230
+ }),
231
+ // defaultViewport height
232
+ components.input.number("viewportHeight", {
233
+ label: "\u9ED8\u8BA4\u89C6\u7A97\u9AD8\u5EA6",
234
+ description: "\u9ED8\u8BA4\u89C6\u7A97\u9AD8\u5EA6\uFF08\u50CF\u7D20\uFF09",
235
+ defaultValue: (config.defaultViewport?.height || 600) + "",
236
+ className: "inline-block p-2",
237
+ rules: [
238
+ {
239
+ min: 1,
240
+ max: 1e4,
241
+ error: "\u89C6\u7A97\u9AD8\u5EA6\u5FC5\u987B\u57281-10000\u4E4B\u95F4"
242
+ }
243
+ ]
244
+ }),
151
245
  // 分隔线
152
246
  components.divider.create("divider4"),
153
247
  // args
@@ -163,10 +257,42 @@ var webConfig = {
163
257
  },
164
258
  /** 前端点击保存之后调用的方法 */
165
259
  save: (config) => {
260
+ if (!config.download) {
261
+ config.download = {};
262
+ }
263
+ if (config.downloadEnable !== void 0) {
264
+ config.download.enable = config.downloadEnable;
265
+ delete config.downloadEnable;
266
+ }
267
+ if (config.downloadBrowser) {
268
+ config.download.browser = config.downloadBrowser;
269
+ delete config.downloadBrowser;
270
+ }
271
+ if (config.downloadVersion) {
272
+ config.download.version = config.downloadVersion;
273
+ delete config.downloadVersion;
274
+ }
275
+ if (config.downloadDir) {
276
+ config.download.dir = config.downloadDir;
277
+ delete config.downloadDir;
278
+ }
279
+ if (config.downloadBaseUrl) {
280
+ config.download.baseUrl = config.downloadBaseUrl;
281
+ delete config.downloadBaseUrl;
282
+ }
283
+ if (config.viewportWidth !== void 0 || config.viewportHeight !== void 0) {
284
+ config.defaultViewport = {
285
+ width: Number(config.viewportWidth || 800),
286
+ height: Number(config.viewportHeight || 600)
287
+ };
288
+ delete config.viewportWidth;
289
+ delete config.viewportHeight;
290
+ }
166
291
  config = {
167
292
  ...config,
168
- maxPages: Number(config.maxPages),
169
- idleTime: Number(config.idleTime)
293
+ maxOpenPages: Number(config.maxOpenPages),
294
+ pageIdleTimeout: Number(config.pageIdleTimeout),
295
+ slowMo: Number(config.slowMo || 0)
170
296
  };
171
297
  saveConfig(config);
172
298
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karinjs/plugin-puppeteer",
3
- "version": "1.0.21",
3
+ "version": "1.1.2",
4
4
  "description": "karin的 puppeteer截图、渲染插件",
5
5
  "keywords": [
6
6
  "karin",
@@ -16,16 +16,13 @@
16
16
  "main": "dist/index.js",
17
17
  "types": "dist/index.d.ts",
18
18
  "files": [
19
- "dist",
20
- "!LICENSE",
21
- "!README.md"
19
+ "dist"
22
20
  ],
23
21
  "dependencies": {
24
- "@karinjs/puppeteer": "2.2.4"
22
+ "@snapka/puppeteer": "0.1.5"
25
23
  },
26
24
  "devDependencies": {
27
- "node-karin": "^1.7.12",
28
- "@karinjs/puppeteer-types": "0.0.6"
25
+ "node-karin": "^1.13.0"
29
26
  },
30
27
  "karin": {
31
28
  "main": "src/index.ts",
@@ -34,39 +31,12 @@
34
31
  "ts-web": "src/web.config.ts",
35
32
  "files": [
36
33
  "config"
37
- ],
38
- "env": [
39
- {
40
- "key": "PUPPETEER_CACHE_DIR",
41
- "value": "",
42
- "comment": "Puppeteer缓存的默认根目录"
43
- },
44
- {
45
- "key": "PUPPETEER_CACHE_VERSION",
46
- "value": "",
47
- "comment": "记录puppeteer下载过的浏览器信息"
48
- },
49
- {
50
- "key": "PUPPETEER_CHROME_HEADLESS_SHELL_VERSION",
51
- "value": "",
52
- "comment": "Puppeteer下载浏览器的版本"
53
- },
54
- {
55
- "key": "PUPPETEER_EXECUTABLE_PATH",
56
- "value": "",
57
- "comment": "Puppeteer可执行文件路径 配置后将使用此路径的浏览器"
58
- },
59
- {
60
- "key": "PUPPETEER_CHROME_HEADLESS_SHELL_DOWNLOAD_BASE_URL",
61
- "value": "",
62
- "comment": "Puppeteer浏览器host地址"
63
- }
64
34
  ]
65
35
  },
66
36
  "timestamp": "2025-10-01T00:47:22.222Z",
67
37
  "scripts": {
68
38
  "build": "tsc && tsup",
69
- "dev": "tsx src/index.ts",
39
+ "dev": "tsx src/app.ts",
70
40
  "dev:test": "node dist/index.js",
71
41
  "pub": "pnpm publish --access public",
72
42
  "rm": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",