@capyclaw/scrapling 1.0.1 → 1.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.
Files changed (2) hide show
  1. package/package.json +60 -63
  2. package/test/plugin.test.mjs +0 -32
package/package.json CHANGED
@@ -1,63 +1,60 @@
1
- {
2
- "name": "@capyclaw/scrapling",
3
- "version": "1.0.1",
4
- "description": "Scrapling 网页抓取集成:支持 HTTP 请求、隐身浏览器、JavaScript 渲染、Cloudflare 绕过、并发爬虫和数据导出",
5
- "type": "module",
6
- "main": "./lib/host.mjs",
7
- "exports": {
8
- ".": "./lib/host.mjs",
9
- "./api": "./lib/index.mjs",
10
- "./client": "./client/client.js",
11
- "./package.json": "./package.json"
12
- },
13
- "dependencies": {
14
- "@capyclaw/plugin-kit": "^0.2.0"
15
- },
16
- "dsh": {
17
- "bundle": {
18
- "patch": "./cordis.patch.yml"
19
- },
20
- "client": {
21
- "platform": "web",
22
- "immediately": false
23
- },
24
- "category": "tool",
25
- "platform": "both"
26
- },
27
- "meta": {
28
- "title": "Scrapling 网页抓取",
29
- "description": "强大的网页抓取工具:支持快速 HTTP 请求、隐身浏览器模式、JavaScript 渲染、Cloudflare 自动绕过、CSS/XPath 选择器、并发爬虫、代理轮换和多格式数据导出(JSON/CSV/XML)。"
30
- },
31
- "files": [
32
- "lib/",
33
- "client/",
34
- "test/",
35
- "cordis.patch.yml",
36
- "README.md"
37
- ],
38
- "scripts": {
39
- "test": "node test/plugin.test.mjs"
40
- },
41
- "engines": {
42
- "node": ">=18",
43
- "dsh": "^0.2.0-rc.2"
44
- },
45
- "license": "MIT",
46
- "author": {
47
- "name": "CapyClaw",
48
- "url": "https://github.com/capyclaw",
49
- "email": "support@capyclaw.dev"
50
- },
51
- "repository": {
52
- "type": "git",
53
- "url": "https://github.com/capyclaw/dsh-plugins",
54
- "directory": "extensions/official/capyclaw-scrapling"
55
- },
56
- "bugs": {
57
- "url": "https://github.com/capyclaw/dsh-plugins/issues"
58
- },
59
- "homepage": "https://github.com/capyclaw/dsh-plugins",
60
- "publishConfig": {
61
- "access": "public"
62
- }
63
- }
1
+ {
2
+ "name": "@capyclaw/scrapling",
3
+ "version": "1.0.2",
4
+ "description": "Scrapling 网页抓取集成:支持 HTTP 请求、隐身浏览器、JavaScript 渲染、Cloudflare 绕过、并发爬虫和数据导出",
5
+ "type": "module",
6
+ "main": "./lib/host.mjs",
7
+ "exports": {
8
+ ".": "./lib/host.mjs",
9
+ "./api": "./lib/index.mjs",
10
+ "./client": "./client/client.js",
11
+ "./package.json": "./package.json"
12
+ },
13
+ "dependencies": {
14
+ "@capyclaw/plugin-kit": "^0.2.0"
15
+ },
16
+ "dsh": {
17
+ "bundle": {
18
+ "patch": "./cordis.patch.yml"
19
+ },
20
+ "client": {
21
+ "platform": "web",
22
+ "immediately": false
23
+ },
24
+ "category": "tool",
25
+ "platform": "both"
26
+ },
27
+ "meta": {
28
+ "title": "Scrapling 网页抓取",
29
+ "description": "强大的网页抓取工具:支持快速 HTTP 请求、隐身浏览器模式、JavaScript 渲染、Cloudflare 自动绕过、CSS/XPath 选择器、并发爬虫、代理轮换和多格式数据导出(JSON/CSV/XML)。"
30
+ },
31
+ "files": [
32
+ "lib/",
33
+ "client/",
34
+ "cordis.patch.yml",
35
+ "README.md"
36
+ ],
37
+ "scripts": {},
38
+ "engines": {
39
+ "node": ">=18",
40
+ "dsh": "^0.2.0-rc.2"
41
+ },
42
+ "license": "MIT",
43
+ "author": {
44
+ "name": "CapyClaw",
45
+ "url": "https://github.com/capyclaw",
46
+ "email": "support@capyclaw.dev"
47
+ },
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/Maple496/capyclaw.git",
51
+ "directory": "extensions/official/capyclaw-scrapling"
52
+ },
53
+ "bugs": {
54
+ "url": "https://github.com/Maple496/capyclaw/issues"
55
+ },
56
+ "homepage": "https://github.com/capyclaw/dsh-plugins",
57
+ "publishConfig": {
58
+ "access": "public"
59
+ }
60
+ }
@@ -1,32 +0,0 @@
1
- /**
2
- * dsh-scrapling 插件测试
3
- */
4
- import { describe, it } from 'node:test'
5
- import assert from 'node:assert'
6
-
7
- describe('dsh-scrapling', () => {
8
- it('应该导出 name 和 apply', async () => {
9
- const plugin = await import('../lib/host.mjs')
10
- assert.strictEqual(plugin.name, '@capyclaw/scrapling')
11
- assert.strictEqual(typeof plugin.apply, 'function')
12
- })
13
-
14
- it('应该提供 scrapling 服务', async () => {
15
- const plugin = await import('../lib/host.mjs')
16
-
17
- // 模拟 Cordis 上下文
18
- const services = {}
19
- const ctx = {
20
- provide(name, service) {
21
- services[name] = service
22
- }
23
- }
24
-
25
- await plugin.apply(ctx, {})
26
-
27
- assert.ok(services.scrapling)
28
- assert.strictEqual(typeof services.scrapling.fetch, 'function')
29
- assert.strictEqual(typeof services.scrapling.fetchWithBrowser, 'function')
30
- assert.strictEqual(typeof services.scrapling.parse, 'function')
31
- })
32
- })