chrome-devtools-frontend 1.0.1636056 → 1.0.1640418
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/front_end/core/common/Color.ts +0 -4
- package/front_end/core/host/AidaClientTypes.ts +8 -6
- package/front_end/core/root/Runtime.ts +2 -2
- package/front_end/core/sdk/DOMStorageModel.ts +1 -1
- package/front_end/core/sdk/SourceMap.ts +8 -3
- package/front_end/core/sdk/TargetManager.ts +14 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +147 -0
- package/front_end/generated/ARIAProperties.js +17 -4
- package/front_end/generated/InspectorBackendCommands.ts +13 -7
- package/front_end/generated/SupportedCSSProperties.js +1 -0
- package/front_end/generated/protocol-mapping.d.ts +7 -0
- package/front_end/generated/protocol-proxy-api.d.ts +14 -0
- package/front_end/generated/protocol.ts +120 -2
- package/front_end/global_typings/global_defs.d.ts +13 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +116 -0
- package/front_end/models/ai_assistance/AiConversation.ts +22 -36
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +0 -1
- package/front_end/models/ai_assistance/AiOrigins.ts +46 -0
- package/front_end/models/ai_assistance/AiUtils.ts +9 -0
- package/front_end/models/ai_assistance/README.md +16 -0
- package/front_end/models/ai_assistance/StorageItem.ts +30 -26
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +12 -5
- package/front_end/models/ai_assistance/agents/AiAgent.ts +86 -32
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +31 -10
- package/front_end/models/ai_assistance/agents/ConversationSummaryAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/FileAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +1 -3
- package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +19 -0
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +9 -4
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +41 -12
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +442 -122
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -2
- package/front_end/models/ai_assistance/ai_assistance.ts +4 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/performance/AIContext.ts +7 -8
- package/front_end/models/ai_assistance/skills/README.md +40 -0
- package/front_end/models/ai_assistance/skills/Skill.ts +13 -0
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +10 -0
- package/front_end/models/ai_assistance/skills/styling.md +6 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +12 -4
- package/front_end/models/breakpoints/BreakpointManager.ts +54 -2
- package/front_end/models/greendev/Prototypes.ts +0 -7
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +20 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +5 -0
- package/front_end/models/issues_manager/EmailVerificationRequestIssue.ts +293 -0
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestInvalidEmail.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +1748 -1739
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +1 -1
- package/front_end/models/stack_trace/DetailedErrorStackParser.ts +9 -1
- package/front_end/models/stack_trace/StackTraceImpl.ts +29 -9
- package/front_end/models/stack_trace/StackTraceModel.ts +23 -11
- package/front_end/models/stack_trace/Trie.ts +11 -1
- package/front_end/models/trace/extras/TraceTree.ts +20 -1
- package/front_end/models/trace/insights/Common.ts +9 -0
- package/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +21 -25
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +19 -75
- package/front_end/panels/ai_assistance/components/AccessibilityAgentMarkdownRenderer.ts +10 -3
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +148 -2
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +2 -3
- package/front_end/panels/ai_assistance/components/chatMessage.css +27 -0
- package/front_end/panels/application/CookieItemsView.ts +24 -0
- package/front_end/panels/application/DOMStorageItemsView.ts +9 -4
- package/front_end/panels/application/preloading/components/PreloadingString.ts +6 -0
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -4
- package/front_end/panels/console/ConsoleViewMessage.ts +13 -102
- package/front_end/panels/elements/StandaloneStylesContainer.ts +10 -0
- package/front_end/panels/elements/StylePropertiesSection.ts +6 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +30 -1
- package/front_end/panels/elements/StylesContainer.ts +3 -0
- package/front_end/panels/elements/StylesSidebarPane.ts +54 -4
- package/front_end/panels/elements/elements-meta.ts +14 -0
- package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +4 -4
- package/front_end/panels/network/NetworkDataGridNode.ts +14 -0
- package/front_end/panels/network/NetworkLogViewColumns.ts +2 -2
- package/front_end/panels/network/RequestHeadersView.ts +55 -19
- package/front_end/panels/network/networkTimingTable.css +2 -4
- package/front_end/panels/recorder/components/ReplaySection.ts +28 -16
- package/front_end/panels/recorder/converters/LighthouseConverter.snapshot.txt +47 -0
- package/front_end/panels/recorder/converters/PuppeteerConverter.snapshot.txt +49 -0
- package/front_end/panels/recorder/converters/PuppeteerReplayConverter.snapshot.txt +33 -0
- package/front_end/panels/settings/SettingsScreen.ts +1 -2
- package/front_end/panels/sources/BreakpointsView.ts +23 -42
- package/front_end/panels/sources/DebuggerPlugin.ts +12 -5
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +169 -106
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +2 -2
- package/front_end/third_party/marked/README.chromium +3 -6
- package/front_end/third_party/marked/package/README.md +5 -5
- package/front_end/third_party/marked/package/bin/main.js +27 -22
- package/front_end/third_party/marked/package/bin/marked.js +2 -1
- package/front_end/third_party/marked/package/lib/marked.esm.d.ts +346 -256
- package/front_end/third_party/marked/package/lib/marked.esm.js +67 -2698
- package/front_end/third_party/marked/package/lib/marked.esm.js.map +7 -1
- package/front_end/third_party/marked/package/lib/marked.umd.js +69 -2722
- package/front_end/third_party/marked/package/lib/marked.umd.js.map +7 -1
- package/front_end/third_party/marked/package/man/marked.1 +4 -2
- package/front_end/third_party/marked/package/man/marked.1.md +2 -1
- package/front_end/third_party/marked/package/package.json +49 -57
- package/front_end/third_party/puppeteer-replay/README.chromium +2 -2
- package/front_end/third_party/puppeteer-replay/package/lib/cli.js +84 -80
- package/front_end/third_party/puppeteer-replay/package/lib/cli.js.map +1 -1
- package/front_end/third_party/puppeteer-replay/package/lib/extension-test.js +79 -83
- package/front_end/third_party/puppeteer-replay/package/lib/extension-test.js.map +1 -1
- package/front_end/third_party/puppeteer-replay/package/lib/main.d.ts +43 -171
- package/front_end/third_party/puppeteer-replay/package/lib/main.js +51 -206
- package/front_end/third_party/puppeteer-replay/package/lib/main.js.map +1 -1
- package/front_end/third_party/puppeteer-replay/package/package.json +37 -67
- package/front_end/tsconfig.json +1 -1
- package/front_end/ui/components/markdown_view/CodeBlock.ts +17 -6
- package/front_end/ui/components/markdown_view/MarkdownView.ts +39 -3
- package/front_end/ui/components/markdown_view/codeBlock.css +11 -0
- package/front_end/ui/components/markdown_view/markdownView.css +17 -0
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +0 -79
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +16 -4
- package/front_end/ui/visual_logging/KnownContextValues.ts +4 -0
- package/inspector_overlay/testing/InspectorOverlayHelpers.ts +2 -0
- package/mcp/mcp.ts +1 -6
- package/package.json +14 -16
- package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgent.ts +0 -1015
- package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgentOverlay.ts +0 -87
- package/front_end/third_party/marked/package/bin/marked +0 -215
- package/front_end/third_party/marked/package/lib/marked.cjs +0 -2726
- package/front_end/third_party/marked/package/lib/marked.cjs.map +0 -1
- package/front_end/third_party/marked/package/lib/marked.d.cts +0 -670
- package/front_end/third_party/marked/package/lib/marked.js +0 -2780
- package/front_end/third_party/marked/package/man/marked.1.txt +0 -86
- package/front_end/third_party/marked/package/marked.min.js +0 -6
- package/front_end/third_party/marked/package/src/Lexer.js +0 -492
- package/front_end/third_party/marked/package/src/Parser.js +0 -286
- package/front_end/third_party/marked/package/src/Renderer.js +0 -166
- package/front_end/third_party/marked/package/src/Slugger.js +0 -49
- package/front_end/third_party/marked/package/src/TextRenderer.js +0 -42
- package/front_end/third_party/marked/package/src/Tokenizer.js +0 -755
- package/front_end/third_party/marked/package/src/defaults.js +0 -29
- package/front_end/third_party/marked/package/src/helpers.js +0 -249
- package/front_end/third_party/marked/package/src/marked.js +0 -350
- package/front_end/third_party/marked/package/src/rules.js +0 -285
- package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.cjs +0 -2099
- package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.cjs.map +0 -1
- package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.d.cts +0 -686
- package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.d.ts +0 -35
- package/mcp/HostBindings.ts +0 -319
- /package/front_end/third_party/marked/package/{LICENSE.md → LICENSE} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.TH "MARKED" "1" "
|
|
1
|
+
.TH "MARKED" "1" "May 2026" "18.0.3"
|
|
2
2
|
.SH "NAME"
|
|
3
3
|
\fBmarked\fR \- a javascript markdown parser
|
|
4
4
|
.SH SYNOPSIS
|
|
@@ -104,7 +104,9 @@ marked\.parse('*foo*');
|
|
|
104
104
|
Please report any bugs to https://github.com/markedjs/marked
|
|
105
105
|
.SH LICENSE
|
|
106
106
|
.P
|
|
107
|
-
Copyright (c)
|
|
107
|
+
Copyright (c) 2018+, MarkedJS\. (MIT License)
|
|
108
|
+
.br
|
|
109
|
+
Copyright (c) 2011\-2018, Christopher Jeffrey\. (MIT License)
|
|
108
110
|
.SH SEE ALSO
|
|
109
111
|
.P
|
|
110
112
|
markdown(1), nodejs(1)
|
|
@@ -85,7 +85,8 @@ Please report any bugs to <https://github.com/markedjs/marked>.
|
|
|
85
85
|
|
|
86
86
|
## LICENSE
|
|
87
87
|
|
|
88
|
-
Copyright (c)
|
|
88
|
+
Copyright (c) 2018+, MarkedJS. (MIT License)
|
|
89
|
+
Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
|
|
89
90
|
|
|
90
91
|
## SEE ALSO
|
|
91
92
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "marked",
|
|
3
3
|
"description": "A markdown parser built for speed",
|
|
4
4
|
"author": "Christopher Jeffrey",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "18.0.4",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"main": "./lib/marked.
|
|
7
|
+
"main": "./lib/marked.esm.js",
|
|
8
8
|
"module": "./lib/marked.esm.js",
|
|
9
9
|
"browser": "./lib/marked.umd.js",
|
|
10
10
|
"types": "./lib/marked.d.ts",
|
|
@@ -15,28 +15,23 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"bin/",
|
|
17
17
|
"lib/",
|
|
18
|
-
"man/"
|
|
19
|
-
"marked.min.js"
|
|
18
|
+
"man/"
|
|
20
19
|
],
|
|
21
20
|
"exports": {
|
|
22
21
|
".": {
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
"default": "./lib/marked.esm.js"
|
|
26
|
-
},
|
|
27
|
-
"default": {
|
|
28
|
-
"types": "./lib/marked.d.cts",
|
|
29
|
-
"default": "./lib/marked.cjs"
|
|
30
|
-
}
|
|
22
|
+
"types": "./lib/marked.d.ts",
|
|
23
|
+
"default": "./lib/marked.esm.js"
|
|
31
24
|
},
|
|
32
25
|
"./bin/marked": "./bin/marked.js",
|
|
33
|
-
"./marked.min.js": "./marked.min.js",
|
|
34
26
|
"./package.json": "./package.json"
|
|
35
27
|
},
|
|
36
28
|
"publishConfig": {
|
|
37
29
|
"provenance": true
|
|
38
30
|
},
|
|
39
|
-
"repository":
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git://github.com/markedjs/marked.git"
|
|
34
|
+
},
|
|
40
35
|
"homepage": "https://marked.js.org",
|
|
41
36
|
"bugs": {
|
|
42
37
|
"url": "http://github.com/markedjs/marked/issues"
|
|
@@ -53,59 +48,56 @@
|
|
|
53
48
|
"html"
|
|
54
49
|
],
|
|
55
50
|
"devDependencies": {
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
51
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
52
|
+
"@markedjs/eslint-config": "^1.0.14",
|
|
53
|
+
"@markedjs/testutils": "18.0.0-1",
|
|
54
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
61
55
|
"@semantic-release/git": "^10.0.1",
|
|
62
|
-
"@semantic-release/github": "^
|
|
63
|
-
"@semantic-release/npm": "^
|
|
64
|
-
"@semantic-release/release-notes-generator": "^14.
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"commonmark": "0.31.0",
|
|
69
|
-
"cross-env": "^7.0.3",
|
|
56
|
+
"@semantic-release/github": "^12.0.8",
|
|
57
|
+
"@semantic-release/npm": "^13.1.5",
|
|
58
|
+
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
59
|
+
"cheerio": "1.2.0",
|
|
60
|
+
"commonmark": "0.31.2",
|
|
61
|
+
"cross-env": "^10.1.0",
|
|
70
62
|
"dts-bundle-generator": "^9.5.1",
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"eslint
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"highlight
|
|
77
|
-
"markdown-it": "14.1.0",
|
|
78
|
-
"marked-highlight": "^2.1.2",
|
|
63
|
+
"esbuild": "^0.28.0",
|
|
64
|
+
"esbuild-plugin-umd-wrapper": "^3.0.0",
|
|
65
|
+
"eslint": "^10.4.0",
|
|
66
|
+
"highlight.js": "^11.11.1",
|
|
67
|
+
"markdown-it": "14.1.1",
|
|
68
|
+
"marked-highlight": "^2.2.4",
|
|
79
69
|
"marked-man": "^2.1.0",
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"semantic-release": "^24.0.0",
|
|
70
|
+
"recheck": "^4.5.0",
|
|
71
|
+
"rimraf": "^6.1.3",
|
|
72
|
+
"semantic-release": "^25.0.3",
|
|
84
73
|
"titleize": "^4.0.0",
|
|
85
|
-
"
|
|
86
|
-
"typescript": "
|
|
74
|
+
"tslib": "^2.8.1",
|
|
75
|
+
"typescript": "6.0.3"
|
|
87
76
|
},
|
|
88
77
|
"scripts": {
|
|
89
|
-
"test": "npm run build && npm run test:specs && npm run test:unit",
|
|
90
|
-
"test:all": "npm test && npm run test:umd && npm run test:types && npm run test:lint",
|
|
91
|
-
"test:unit": "node --test --test-reporter=spec test/unit/*.test.js",
|
|
92
|
-
"test:specs": "node --test --test-reporter=spec test/run-spec-tests.js",
|
|
93
|
-
"test:lint": "eslint .",
|
|
94
|
-
"test:redos": "node test/recheck.js > vuln.js",
|
|
95
|
-
"test:types": "tsc --project tsconfig-type-test.json && attw -P --exclude-entrypoints ./bin/marked ./marked.min.js",
|
|
96
|
-
"test:umd": "node test/umd-test.js",
|
|
97
|
-
"test:update": "node test/update-specs.js",
|
|
98
|
-
"rules": "node test/rules.js",
|
|
99
78
|
"bench": "npm run build && node test/bench.js",
|
|
100
|
-
"
|
|
101
|
-
"build:reset": "git checkout upstream/master lib/marked.cjs lib/marked.umd.js lib/marked.esm.js marked.min.js",
|
|
102
|
-
"build": "npm run rollup && npm run build:types && npm run build:man",
|
|
79
|
+
"build": "npm run build:esbuild && npm run build:types && npm run build:man",
|
|
103
80
|
"build:docs": "npm run build && node docs/build.js",
|
|
104
|
-
"build:
|
|
81
|
+
"build:esbuild": "node esbuild.config.js",
|
|
105
82
|
"build:man": "marked-man man/marked.1.md > man/marked.1",
|
|
106
|
-
"
|
|
83
|
+
"build:reset": "rimraf ./lib ./public",
|
|
84
|
+
"build:types": "tsc && dts-bundle-generator --export-referenced-types --project tsconfig.json -o lib/marked.d.ts src/marked.ts",
|
|
85
|
+
"lint": "eslint --fix",
|
|
86
|
+
"rules": "node test/rules.js",
|
|
87
|
+
"test": "npm run build:reset && npm run build:docs && npm run test:specs && npm run test:unit && npm run test:umd && npm run test:cjs && npm run test:types && npm run test:lint",
|
|
88
|
+
"test:cjs": "node test/cjs-test.cjs",
|
|
89
|
+
"test:lint": "eslint",
|
|
90
|
+
"test:only": "npm run build && npm run test:specs:only && npm run test:unit:only",
|
|
91
|
+
"test:redos": "node test/recheck.ts > vuln.js",
|
|
92
|
+
"test:specs:only": "node --test --test-only --test-reporter=spec test/run-spec-tests.js",
|
|
93
|
+
"test:specs": "node --test --test-reporter=spec test/run-spec-tests.js",
|
|
94
|
+
"test:types": "tsc --project tsconfig-type-test.json && attw -P --entrypoints . --profile esm-only",
|
|
95
|
+
"test:umd": "node test/umd-test.js",
|
|
96
|
+
"test:unit:only": "node --test --test-only --test-reporter=spec test/unit/*.test.js",
|
|
97
|
+
"test:unit": "node --test --test-reporter=spec test/unit/*.test.js",
|
|
98
|
+
"test:update": "node test/update-specs.js"
|
|
107
99
|
},
|
|
108
100
|
"engines": {
|
|
109
|
-
"node": ">=
|
|
101
|
+
"node": ">= 20"
|
|
110
102
|
}
|
|
111
103
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Name: @puppeteer/replay
|
|
2
2
|
Short Name: @puppeteer/replay
|
|
3
3
|
URL: https://github.com/puppeteer/replay
|
|
4
|
-
Version:
|
|
4
|
+
Version: 4.0.2
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
License File: package/LICENSE
|
|
7
|
-
Revision:
|
|
7
|
+
Revision: 23ab6bc760bc6982d0dcbf3f832a2a7d54571f72
|
|
8
8
|
Update Mechanism: Manual
|
|
9
9
|
Security Critical: no
|
|
10
10
|
Shipped: yes
|
|
@@ -1,29 +1,48 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { parse, createRunner, PuppeteerRunnerOwningBrowserExtension } from '../lib/main.js';
|
|
2
|
+
import { styleText, parseArgs } from 'node:util';
|
|
3
|
+
import { parse, PuppeteerRunnerOwningBrowserExtension, createRunner } from './main.js';
|
|
5
4
|
import { lstatSync, readFileSync, readdirSync } from 'fs';
|
|
6
|
-
import { extname, join,
|
|
5
|
+
import { extname, join, isAbsolute, relative } from 'path';
|
|
7
6
|
import { pathToFileURL } from 'url';
|
|
8
7
|
import { cwd } from 'process';
|
|
9
|
-
import Table from 'cli-table3';
|
|
10
|
-
import { bgGreen, bgRed, white } from 'colorette';
|
|
11
8
|
|
|
12
9
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
you may not use this file except in compliance with the License.
|
|
17
|
-
You may obtain a copy of the License at
|
|
18
|
-
|
|
19
|
-
https://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
-
|
|
21
|
-
Unless required by applicable law or agreed to in writing, software
|
|
22
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
23
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
|
-
See the License for the specific language governing permissions and
|
|
25
|
-
limitations under the License.
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2022 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
26
13
|
*/
|
|
14
|
+
class StatusReport extends Array {
|
|
15
|
+
toString() {
|
|
16
|
+
const headers = ['Title', 'Status', 'File', 'Duration'];
|
|
17
|
+
const allRows = [headers, ...this];
|
|
18
|
+
const colWidths = headers.map((_, colIndex) => {
|
|
19
|
+
return Math.max(...allRows.map((row) => (row[colIndex] || '').length));
|
|
20
|
+
});
|
|
21
|
+
return allRows
|
|
22
|
+
.map((row, rowIndex) => {
|
|
23
|
+
const paddedRow = row
|
|
24
|
+
.map((cell, colIndex) => {
|
|
25
|
+
const cellStr = cell || '';
|
|
26
|
+
let formattedCell = cellStr;
|
|
27
|
+
if (rowIndex > 0 && colIndex === 1) {
|
|
28
|
+
formattedCell =
|
|
29
|
+
cellStr === ' Success '
|
|
30
|
+
? styleText(['white', 'bgGreen'], cellStr)
|
|
31
|
+
: styleText(['white', 'bgRed'], cellStr);
|
|
32
|
+
}
|
|
33
|
+
const padding = ' '.repeat(Math.max(0, colWidths[colIndex] - cellStr.length));
|
|
34
|
+
return formattedCell + padding;
|
|
35
|
+
})
|
|
36
|
+
.join(' ');
|
|
37
|
+
if (rowIndex === 0) {
|
|
38
|
+
const separator = colWidths.map((w) => '═'.repeat(w)).join('══');
|
|
39
|
+
return `${paddedRow}\n${separator}`;
|
|
40
|
+
}
|
|
41
|
+
return paddedRow;
|
|
42
|
+
})
|
|
43
|
+
.join('\n');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
27
46
|
function getJSONFilesFromFolder(path) {
|
|
28
47
|
return readdirSync(path)
|
|
29
48
|
.filter((file) => extname(file) === '.json')
|
|
@@ -69,36 +88,11 @@ function getHeadlessEnvVar(headless) {
|
|
|
69
88
|
}
|
|
70
89
|
}
|
|
71
90
|
function createStatusReport(results) {
|
|
72
|
-
const table = new
|
|
73
|
-
head: ['Title', 'Status', 'File', 'Duration'],
|
|
74
|
-
chars: {
|
|
75
|
-
top: '═',
|
|
76
|
-
'top-mid': '╤',
|
|
77
|
-
'top-left': '╔',
|
|
78
|
-
'top-right': '╗',
|
|
79
|
-
bottom: '═',
|
|
80
|
-
'bottom-mid': '╧',
|
|
81
|
-
'bottom-left': '╚',
|
|
82
|
-
'bottom-right': '╝',
|
|
83
|
-
left: '║',
|
|
84
|
-
'left-mid': '╟',
|
|
85
|
-
mid: '─',
|
|
86
|
-
'mid-mid': '┼',
|
|
87
|
-
right: '║',
|
|
88
|
-
'right-mid': '╢',
|
|
89
|
-
middle: '│',
|
|
90
|
-
},
|
|
91
|
-
style: {
|
|
92
|
-
head: ['bold'],
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
const resultTextColor = white;
|
|
91
|
+
const table = new StatusReport();
|
|
96
92
|
for (const result of results) {
|
|
97
93
|
const row = [];
|
|
98
94
|
const duration = result.finishedAt?.getTime() - result.startedAt.getTime() || 0;
|
|
99
|
-
const status = result.success
|
|
100
|
-
? resultTextColor(bgGreen(' Success '))
|
|
101
|
-
: resultTextColor(bgRed(' Failure '));
|
|
95
|
+
const status = result.success ? ' Success ' : ' Failure ';
|
|
102
96
|
row.push(result.title);
|
|
103
97
|
row.push(status);
|
|
104
98
|
row.push(relative(process.cwd(), result.file));
|
|
@@ -165,39 +159,49 @@ async function runFiles(files, opts = {
|
|
|
165
159
|
}
|
|
166
160
|
|
|
167
161
|
/**
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
you may not use this file except in compliance with the License.
|
|
172
|
-
You may obtain a copy of the License at
|
|
173
|
-
|
|
174
|
-
https://www.apache.org/licenses/LICENSE-2.0
|
|
175
|
-
|
|
176
|
-
Unless required by applicable law or agreed to in writing, software
|
|
177
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
178
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
179
|
-
See the License for the specific language governing permissions and
|
|
180
|
-
limitations under the License.
|
|
162
|
+
* @license
|
|
163
|
+
* Copyright 2022 Google LLC
|
|
164
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
181
165
|
*/
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
.
|
|
166
|
+
const { values, positionals: files } = parseArgs({
|
|
167
|
+
options: {
|
|
168
|
+
headless: {
|
|
169
|
+
type: 'string',
|
|
170
|
+
},
|
|
171
|
+
extension: {
|
|
172
|
+
type: 'string',
|
|
173
|
+
},
|
|
174
|
+
ext: {
|
|
175
|
+
type: 'string',
|
|
176
|
+
},
|
|
177
|
+
help: {
|
|
178
|
+
type: 'boolean',
|
|
179
|
+
short: 'h',
|
|
180
|
+
default: false,
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
allowPositionals: true,
|
|
184
|
+
});
|
|
185
|
+
if (values.help) {
|
|
186
|
+
console.log(`
|
|
187
|
+
Usage: replay [options] <files..>
|
|
188
|
+
|
|
189
|
+
Options:
|
|
190
|
+
--headless Run using the browser's headless mode.
|
|
191
|
+
Choices: shell, true, 1, 0, false
|
|
192
|
+
--ext, --extension Run using an extension identified by the path.
|
|
193
|
+
-h, --help Show help
|
|
194
|
+
`);
|
|
195
|
+
process.exit(0);
|
|
196
|
+
}
|
|
197
|
+
if (files.length === 0) {
|
|
198
|
+
console.error('Error: Missing required argument: files');
|
|
199
|
+
process.exit(1);
|
|
200
|
+
}
|
|
201
|
+
const recordingPaths = getRecordingPaths(files);
|
|
202
|
+
await runFiles(recordingPaths, {
|
|
203
|
+
log: true,
|
|
204
|
+
headless: getHeadlessEnvVar(values.headless || process.env['PUPPETEER_HEADLESS']),
|
|
205
|
+
extension: values.extension || values.ext,
|
|
206
|
+
});
|
|
203
207
|
//# sourceMappingURL=cli.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sources":["../src/CLIUtils.ts","../src/cli.ts"],"sourcesContent":[null,null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sources":["../src/CLIUtils.ts","../src/cli.ts"],"sourcesContent":[null,null],"names":[],"mappings":";;;;;;;;AAAA;;;;AAIG;AAWG,MAAO,YAAa,SAAQ,KAAe,CAAA;IACtC,QAAQ,GAAA;QACf,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC;QACvD,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;QAElC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,QAAQ,KAAI;YAC5C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;AACxE,QAAA,CAAC,CAAC;AAEF,QAAA,OAAO;AACJ,aAAA,GAAG,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAI;YACrB,MAAM,SAAS,GAAG;AACf,iBAAA,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,KAAI;AACtB,gBAAA,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE;gBAC1B,IAAI,aAAa,GAAG,OAAO;gBAE3B,IAAI,QAAQ,GAAG,CAAC,IAAI,QAAQ,KAAK,CAAC,EAAE;oBAClC,aAAa;AACX,wBAAA,OAAO,KAAK;8BACR,SAAS,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO;8BACvC,SAAS,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC;gBAC9C;gBAEA,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,C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tension, createRunner, parse, stringify } from '../lib/main.js';
|
|
2
|
+
import { parseArgs } from 'node:util';
|
|
3
|
+
import { RunnerExtension, createRunner, parse, stringify } from './main.js';
|
|
5
4
|
import 'fs';
|
|
6
5
|
import { isAbsolute, join } from 'path';
|
|
7
6
|
import { pathToFileURL } from 'url';
|
|
8
7
|
import { cwd } from 'process';
|
|
9
|
-
import 'cli-table3';
|
|
10
|
-
import 'colorette';
|
|
11
8
|
import http from 'http';
|
|
12
9
|
import assert from 'assert/strict';
|
|
13
10
|
import { spawn } from 'child_process';
|
|
14
11
|
|
|
15
12
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
you may not use this file except in compliance with the License.
|
|
20
|
-
You may obtain a copy of the License at
|
|
21
|
-
|
|
22
|
-
https://www.apache.org/licenses/LICENSE-2.0
|
|
23
|
-
|
|
24
|
-
Unless required by applicable law or agreed to in writing, software
|
|
25
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
26
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
27
|
-
See the License for the specific language governing permissions and
|
|
28
|
-
limitations under the License.
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2022 Google LLC
|
|
15
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
29
16
|
*/
|
|
30
17
|
async function importExtensionFromPath(path) {
|
|
31
18
|
const module = await import(pathToFileURL(isAbsolute(path) ? path : join(cwd(), path)).toString());
|
|
@@ -223,19 +210,9 @@ const files = new Map([
|
|
|
223
210
|
]);
|
|
224
211
|
|
|
225
212
|
/**
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
you may not use this file except in compliance with the License.
|
|
230
|
-
You may obtain a copy of the License at
|
|
231
|
-
|
|
232
|
-
https://www.apache.org/licenses/LICENSE-2.0
|
|
233
|
-
|
|
234
|
-
Unless required by applicable law or agreed to in writing, software
|
|
235
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
236
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
237
|
-
See the License for the specific language governing permissions and
|
|
238
|
-
limitations under the License.
|
|
213
|
+
* @license
|
|
214
|
+
* Copyright 2023 Google LLC
|
|
215
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
239
216
|
*/
|
|
240
217
|
async function startServer() {
|
|
241
218
|
const log = {
|
|
@@ -279,56 +256,75 @@ async function startServer() {
|
|
|
279
256
|
});
|
|
280
257
|
});
|
|
281
258
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
259
|
+
const { values } = parseArgs({
|
|
260
|
+
options: {
|
|
261
|
+
extension: {
|
|
262
|
+
type: 'string',
|
|
263
|
+
},
|
|
264
|
+
ext: {
|
|
265
|
+
type: 'string',
|
|
266
|
+
},
|
|
267
|
+
help: {
|
|
268
|
+
type: 'boolean',
|
|
269
|
+
short: 'h',
|
|
270
|
+
default: false,
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
if (values.help) {
|
|
275
|
+
console.log(`
|
|
276
|
+
Usage: replay-extension-test [options]
|
|
277
|
+
|
|
278
|
+
Options:
|
|
279
|
+
--ext, --extension The path to the extension module. The default export will be used as a Stringify or Runner extension based on instanceOf checks.
|
|
280
|
+
-h, --help Show help
|
|
281
|
+
`);
|
|
282
|
+
process.exit(0);
|
|
283
|
+
}
|
|
284
|
+
const extensionPath = values.extension ?? values.ext;
|
|
285
|
+
if (!extensionPath) {
|
|
286
|
+
console.error('Error: Missing required argument: extension');
|
|
287
|
+
process.exit(1);
|
|
288
|
+
}
|
|
289
|
+
const Extension = await importExtensionFromPath(extensionPath);
|
|
290
|
+
const ext = new Extension();
|
|
291
|
+
let run = async () => { };
|
|
292
|
+
if (ext instanceof RunnerExtension) {
|
|
293
|
+
console.log('runner');
|
|
294
|
+
run = async () => {
|
|
295
|
+
const extension = new Extension();
|
|
296
|
+
const runner = await createRunner(parse(recording), extension);
|
|
297
|
+
await runner.run();
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
run = async () => {
|
|
302
|
+
const exported = await stringify(parse(recording), {
|
|
303
|
+
extension: new Extension(),
|
|
304
|
+
});
|
|
305
|
+
const childProcess = spawn('node', {
|
|
306
|
+
stdio: ['pipe', 'pipe', 'inherit'],
|
|
307
|
+
shell: true,
|
|
308
|
+
});
|
|
309
|
+
childProcess.stdin.write(exported);
|
|
310
|
+
childProcess.stdin.end();
|
|
311
|
+
await new Promise((resolve, reject) => {
|
|
312
|
+
childProcess.on('close', (code) => code
|
|
313
|
+
? reject(new Error(`Running node failed with code ${code}`))
|
|
314
|
+
: resolve());
|
|
315
|
+
});
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
const { server, log } = await startServer();
|
|
319
|
+
try {
|
|
320
|
+
await run();
|
|
321
|
+
}
|
|
322
|
+
catch (err) {
|
|
323
|
+
console.error(err);
|
|
324
|
+
}
|
|
325
|
+
finally {
|
|
326
|
+
server.close();
|
|
327
|
+
}
|
|
328
|
+
assert.equal(log.contents, expectedLog);
|
|
329
|
+
console.log('Run matches the expectations');
|
|
334
330
|
//# sourceMappingURL=extension-test.js.map
|