node-liblzma 2.0.0 → 2.0.3

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 (40) hide show
  1. package/.release-it.json +1 -0
  2. package/.release-it.manual.json +7 -0
  3. package/.release-it.retry.json +3 -0
  4. package/CHANGELOG.md +62 -0
  5. package/binding.gyp +7 -2
  6. package/package.json +6 -6
  7. package/prebuilds/darwin-x64/node-liblzma.node +0 -0
  8. package/prebuilds/linux-x64/node-liblzma.node +0 -0
  9. package/prebuilds/win32-x64/node-liblzma.node +0 -0
  10. package/scripts/download_xz_from_github.py +14 -13
  11. package/vitest.config.ts +13 -5
  12. package/.claude/settings.local.json +0 -92
  13. package/coverage/base.css +0 -224
  14. package/coverage/block-navigation.js +0 -87
  15. package/coverage/errors.ts.html +0 -586
  16. package/coverage/favicon.png +0 -0
  17. package/coverage/index.html +0 -146
  18. package/coverage/lcov-report/base.css +0 -224
  19. package/coverage/lcov-report/block-navigation.js +0 -87
  20. package/coverage/lcov-report/errors.ts.html +0 -586
  21. package/coverage/lcov-report/favicon.png +0 -0
  22. package/coverage/lcov-report/index.html +0 -146
  23. package/coverage/lcov-report/lzma.ts.html +0 -2596
  24. package/coverage/lcov-report/pool.ts.html +0 -769
  25. package/coverage/lcov-report/prettify.css +0 -1
  26. package/coverage/lcov-report/prettify.js +0 -2
  27. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  28. package/coverage/lcov-report/sorter.js +0 -210
  29. package/coverage/lcov.info +0 -636
  30. package/coverage/lzma.ts.html +0 -2596
  31. package/coverage/pool.ts.html +0 -769
  32. package/coverage/prettify.css +0 -1
  33. package/coverage/prettify.js +0 -2
  34. package/coverage/sort-arrow-sprite.png +0 -0
  35. package/coverage/sorter.js +0 -210
  36. package/coverage-reports/assets/monocart-coverage-app.js +0 -2
  37. package/coverage-reports/coverage-data.js +0 -1
  38. package/coverage-reports/index.html +0 -48
  39. package/err.log +0 -26
  40. package/scripts/prebuildify.py +0 -13
package/.release-it.json CHANGED
@@ -1,4 +1,5 @@
1
1
  {
2
+ "extends": "@oorabona/release-it-preset/config/default",
2
3
  "git": {
3
4
  "requireBranch": "master",
4
5
  "requireCleanWorkingDir": true
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "@oorabona/release-it-preset/config/manual-changelog",
3
+ "git": {
4
+ "requireBranch": "master",
5
+ "requireCleanWorkingDir": true
6
+ }
7
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "@oorabona/release-it-preset/config/retry-publish"
3
+ }
package/CHANGELOG.md CHANGED
@@ -7,6 +7,60 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.0.3] - 2025-10-07
11
+
12
+ ### Fixed
13
+ - create dedicated .release-it.retry.json for publish workflow (ci) ([007ec61](https://github.com/oorabona/node-liblzma/commit/007ec61))
14
+ - ignore local .release-it.json in publish workflow (ci) ([0958cc3](https://github.com/oorabona/node-liblzma/commit/0958cc3))
15
+ - use correct release-it-preset CLI syntax (ci) ([210343e](https://github.com/oorabona/node-liblzma/commit/210343e))
16
+ - use npm config set for authentication (ci) ([8e6abcc](https://github.com/oorabona/node-liblzma/commit/8e6abcc))
17
+ - configure npm authentication in publish workflow (ci) ([5b085e4](https://github.com/oorabona/node-liblzma/commit/5b085e4))
18
+ - use tar.gz archives for cross-platform prebuild distribution (ci) ([bc6c213](https://github.com/oorabona/node-liblzma/commit/bc6c213))
19
+ - preserve prebuild directory structure to prevent file overwriting (ci) ([ac8f364](https://github.com/oorabona/node-liblzma/commit/ac8f364))
20
+ - remove build duplication and fix release-it command in publish workflow (ci) ([b0588ca](https://github.com/oorabona/node-liblzma/commit/b0588ca))
21
+ - skip build scripts in publish workflow (ci) ([eb7ab76](https://github.com/oorabona/node-liblzma/commit/eb7ab76))
22
+ - force bash shell for XZ download step on Windows (ci) ([73b6839](https://github.com/oorabona/node-liblzma/commit/73b6839))
23
+
24
+ ## [2.0.2] - 2025-10-07
25
+
26
+ ### Added
27
+ - refactor release workflow to use Pull Request strategy (ci) ([b2797fd](https://github.com/oorabona/node-liblzma/commit/b2797fd))
28
+ - optimize XZ management with artifacts and move prebuildify to CI-only (ci) ([de7d825](https://github.com/oorabona/node-liblzma/commit/de7d825))
29
+ - optimize XZ source management with artifacts and fix prebuildify PATH (ci) ([3984e19](https://github.com/oorabona/node-liblzma/commit/3984e19))
30
+ - optimize XZ source management with GitHub Actions artifacts (ci) ([0dec8f8](https://github.com/oorabona/node-liblzma/commit/0dec8f8))
31
+ - simplify republish workflow by removing target options and using boolean for npm publish (workflows) ([d1e188d](https://github.com/oorabona/node-liblzma/commit/d1e188d))
32
+
33
+ ### Fixed
34
+ - remove CHANGELOG update and dry-run validation steps since default handles both directly (release) ([8ff80f8](https://github.com/oorabona/node-liblzma/commit/8ff80f8))
35
+ - skip native module compilation in release workflow (ci) ([53fc871](https://github.com/oorabona/node-liblzma/commit/53fc871))
36
+ - correct gyp staleness detection to prevent unconditional XZ downloads (build) ([6ed20dd](https://github.com/oorabona/node-liblzma/commit/6ed20dd))
37
+ - prevent double compilation and ensure prebuildify executes (ci) ([4dece66](https://github.com/oorabona/node-liblzma/commit/4dece66))
38
+ - add tag normalization and fix checkout refs for reproducible builds (workflows) ([2c7beee](https://github.com/oorabona/node-liblzma/commit/2c7beee))
39
+ - add automatic 'v' prefix normalization to prevent tag mismatch (workflows) ([862dd89](https://github.com/oorabona/node-liblzma/commit/862dd89))
40
+
41
+ ## [2.0.1] - 2025-10-07
42
+
43
+ ### Changed
44
+ - **Vitest Configuration**: Universal fork-based worker pool with increased timeouts to resolve Vitest bug #8201
45
+ - Changed from conditional forks (macOS only) to universal forks for all platforms
46
+ - Increased testTimeout from 5000ms to 10000ms
47
+ - Added hookTimeout of 10000ms
48
+ - Configured singleFork and isolate options for better stability
49
+ - Increased workflow retry attempts from 3 to 5 for better reliability
50
+ - **CI/CD Workflow Architecture**:
51
+ - Extracted hardcoded Node.js version to environment variable (NODE_VERSION: '22')
52
+ - Added retry mechanism for all test executions (5 attempts with 10-minute timeout)
53
+ - Changed `tags-ignore` to `tags` in ci-unified.yml to allow CI validation before releases
54
+ - Removed duplicate test execution from release.yml (violates DRY and SRP principles)
55
+ - Added check-ci job to verify CI passed before building prebuilds and publishing
56
+
57
+ ### Fixed
58
+ - **Test Stability**: Fixed "Channel closed" (ERR_IPC_CHANNEL_CLOSED) errors on GitHub Actions macOS runners
59
+ - **Workflow Duplication**: Eliminated duplicate test execution between ci-unified.yml and release.yml
60
+ - **Release Safety**: Added CI verification step to ensure all checks pass before publishing to npm
61
+
62
+ ## [2.0.0] - 2025-10-06
63
+
10
64
  ### Added
11
65
  - **TypeScript Support**: Complete migration from CoffeeScript to TypeScript for better type safety and developer experience
12
66
  - **Promise APIs**: New async functions `xzAsync()` and `unxzAsync()` with Promise support
@@ -207,3 +261,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
207
261
  - Initial version
208
262
  - C++ binding support ENCODE/DECODE
209
263
  - Async support
264
+
265
+ [Unreleased]: https://github.com/oorabona/node-liblzma/compare/v2.0.3...HEAD
266
+ [v2.0.1]: https://github.com/oorabona/node-liblzma/releases/tag/v2.0.1
267
+ [2.0.1]: https://github.com/oorabona/node-liblzma/releases/tag/v2.0.1
268
+ [v2.0.2]: https://github.com/oorabona/node-liblzma/releases/tag/v2.0.2
269
+ [2.0.2]: https://github.com/oorabona/node-liblzma/releases/tag/v2.0.2
270
+ [v2.0.3]: https://github.com/oorabona/node-liblzma/releases/tag/v2.0.3
271
+ [2.0.3]: https://github.com/oorabona/node-liblzma/releases/tag/v2.0.3
package/binding.gyp CHANGED
@@ -122,8 +122,13 @@
122
122
  "hard_dependency": 1,
123
123
  "actions": [{
124
124
  "action_name": "download_and_extract_xz",
125
- "inputs": [""],
126
- "outputs": ["<(xz_vendor_dir)/CMakeLists.txt"],
125
+ "inputs": [
126
+ "<(module_root_dir)/xz-version.json",
127
+ "<(module_root_dir)/scripts/download_xz_from_github.py"
128
+ ],
129
+ "outputs": [
130
+ "<(xz_vendor_dir)/CMakeLists.txt"
131
+ ],
127
132
  "action": [
128
133
  "<(py3)",
129
134
  "<(module_root_dir)/scripts/download_xz_from_github.py",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-liblzma",
3
- "version": "2.0.0",
3
+ "version": "2.0.3",
4
4
  "description": "NodeJS wrapper for liblzma",
5
5
  "type": "module",
6
6
  "main": "./lib/lzma.js",
@@ -11,12 +11,12 @@
11
11
  }
12
12
  },
13
13
  "scripts": {
14
- "install": "node-gyp-build",
14
+ "postinstall": "node-gyp-build",
15
15
  "build": "tsc",
16
16
  "build:watch": "tsc --watch",
17
17
  "prepare": "simple-git-hooks && pnpm run build",
18
- "prebuildify": "pnpm exec prebuildify --napi --strip -t $(node -v)",
19
- "prebuildify:win": "for /f \"usebackq tokens=*\" %v in (`node -v`) do pnpm exec prebuildify -t %v --napi --strip",
18
+ "prebuildify": "prebuildify --napi --strip -t $(node -v)",
19
+ "prebuildify:win": "for /f \"usebackq tokens=*\" %v in (`node -v`) do prebuildify -t %v --napi --strip",
20
20
  "test": "vitest run",
21
21
  "test:watch": "vitest",
22
22
  "test:coverage": "vitest run --config vitest.config.monocart.ts --coverage",
@@ -30,7 +30,7 @@
30
30
  "check": "biome check",
31
31
  "check:write": "biome check --write",
32
32
  "release": "release-it-preset default",
33
- "release:manual": "release-it-preset manual-changelog",
33
+ "release:manual": "release-it-preset --config .release-it.manual.json",
34
34
  "release:hotfix": "release-it-preset hotfix",
35
35
  "changelog:update": "release-it-preset changelog-only"
36
36
  },
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@biomejs/biome": "^2.2.3",
43
- "@oorabona/release-it-preset": "^0.8.0",
43
+ "@oorabona/release-it-preset": "^0.9.0",
44
44
  "@oorabona/vitest-monocart-coverage": "^2.0.1",
45
45
  "@types/node": "^24.3.1",
46
46
  "@vitest/coverage-istanbul": "^3.2.4",
@@ -311,43 +311,44 @@ Examples:
311
311
 
312
312
  # Determine version to use
313
313
  version = determine_version()
314
-
315
- # Validate version exists
316
- validated_version = validate_version(version)
317
- if not validated_version:
318
- print(f"[ERROR] Version {version} not found, falling back to v5.4.0")
319
- validated_version = 'v5.4.0'
320
-
314
+
321
315
  # Prepare and validate paths
322
316
  tarball = os.path.abspath(args.tarball)
323
317
  dirname = os.path.abspath(args.dirname)
324
-
318
+
325
319
  # Additional security validation for output paths
326
320
  if not tarball or not dirname:
327
321
  print("[ERROR] Invalid paths provided")
328
322
  return 1
329
-
323
+
330
324
  # Ensure paths don't contain suspicious patterns
331
325
  suspicious_patterns = ['..', '~', '$']
332
326
  for pattern in suspicious_patterns:
333
327
  if pattern in args.tarball or pattern in args.dirname:
334
328
  print(f"[ERROR] Suspicious pattern '{pattern}' detected in paths")
335
329
  return 1
336
-
330
+
337
331
  # Ensure we're using .tar.gz extension (GitHub uses gzip, not xz)
338
332
  if tarball.endswith('.tar.xz'):
339
333
  tarball = tarball.replace('.tar.xz', '.tar.gz')
340
334
  print(f"[NOTE] Adjusted tarball name to: {tarball}")
341
-
335
+
342
336
  # Create directories if needed
343
337
  os.makedirs(os.path.dirname(tarball), exist_ok=True)
344
338
  os.makedirs(dirname, exist_ok=True)
345
339
 
346
340
  # Check if already extracted with correct version (smart cache)
347
- if is_xz_already_extracted(dirname, validated_version):
348
- print(f"[SKIP] XZ {validated_version} already available, skipping download")
341
+ # Do this BEFORE any GitHub API calls to avoid rate limiting
342
+ if is_xz_already_extracted(dirname, version):
343
+ print(f"[SKIP] XZ {version} already available, skipping download")
349
344
  return 0
350
345
 
346
+ # Only validate version if we need to download (avoids GitHub API call when cached)
347
+ validated_version = validate_version(version)
348
+ if not validated_version:
349
+ print(f"[ERROR] Version {version} not found, falling back to v5.4.0")
350
+ validated_version = 'v5.4.0'
351
+
351
352
  # Download if not cached
352
353
  if os.path.exists(tarball):
353
354
  print(f"[CACHED] Using cached tarball: {tarball}")
package/vitest.config.ts CHANGED
@@ -6,14 +6,22 @@ export default defineConfig({
6
6
  include: ['test/**/*.{ts,js,tsx,jsx}'],
7
7
  exclude: ['test/**/*.utils.{ts,js}'],
8
8
 
9
- // Timeout for tests (similar to Mocha config)
10
- testTimeout: 5000,
9
+ // Increased timeout to prevent premature termination
10
+ testTimeout: 10000,
11
+ hookTimeout: 10000,
11
12
 
12
- // Use forks instead of threads on macOS to avoid IPC channel issues
13
- pool: process.platform === 'darwin' ? 'forks' : 'threads',
13
+ // Retry failed tests once to handle intermittent race conditions
14
+ retry: 1,
15
+
16
+ // Use forks universally to avoid IPC channel issues (Vitest #8201)
17
+ // This resolves "Channel closed" errors on GitHub Actions
18
+ pool: 'forks',
14
19
  poolOptions: {
15
20
  forks: {
16
- singleFork: true,
21
+ singleFork: true, // Run tests sequentially in single fork
22
+ isolate: true, // Isolate test environment
23
+ maxThreads: 1, // Explicit thread control for shutdown stability
24
+ minThreads: 1,
17
25
  },
18
26
  },
19
27
 
@@ -1,92 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(node:*)",
5
- "WebSearch",
6
- "Bash(npm run build:*)",
7
- "Bash(pnpm install:*)",
8
- "Bash(pnpm run:*)",
9
- "Bash(pnpm add:*)",
10
- "Bash(pnpm test:*)",
11
- "Bash(xz:*)",
12
- "Bash(pnpm exec:*)",
13
- "Bash(pnpm lint:*)",
14
- "Bash(pnpm check:write:*)",
15
- "Bash(pnpm build:*)",
16
- "Bash(pnpm type-check:*)",
17
- "Bash(pnpm check:*)",
18
- "Bash(pnpm format:write:*)",
19
- "Bash(pnpm tsc:*)",
20
- "Bash(sed:*)",
21
- "Bash(grep:*)",
22
- "WebFetch(domain:github.com)",
23
- "Bash(git rm:*)",
24
- "Bash(git add:*)",
25
- "WebFetch(domain:api.github.com)",
26
- "Bash(python3:*)",
27
- "Bash(chmod:*)",
28
- "WebFetch(domain:raw.githubusercontent.com)",
29
- "Bash(cmake:*)",
30
- "Bash(USE_GLOBAL=false RUNTIME_LINK=static ENABLE_THREAD_SUPPORT=yes pnpm install)",
31
- "Bash(gh act:*)",
32
- "Bash(npx node-gyp:*)",
33
- "Bash(USE_GLOBAL=false RUNTIME_LINK=static ENABLE_THREAD_SUPPORT=no pnpm install --frozen-lockfile)",
34
- "Bash(USE_GLOBAL=false RUNTIME_LINK=shared ENABLE_THREAD_SUPPORT=yes pnpm install --frozen-lockfile)",
35
- "mcp__github__get_job_logs",
36
- "Bash(XZ_VERSION=v5.4.0 python3 scripts/download_xz_from_github.py /tmp/test_xz.tar.gz /tmp/test_extract --verbose)",
37
- "Bash(RUNTIME_LINK=shared node -p \"process.env.RUNTIME_LINK || ''static''\")",
38
- "Bash(RUNTIME_LINK=shared rm -rf build/Release deps)",
39
- "Bash(USE_GLOBAL=false RUNTIME_LINK=shared rm -rf build/Release deps prebuilds)",
40
- "Bash(pnpm rebuild:*)",
41
- "Bash(RUNTIME_LINK=shared ENABLE_THREAD_SUPPORT=yes python3 scripts/build_xz_with_cmake.py --help)",
42
- "Bash(gh run view:*)",
43
- "Bash(RUNTIME_LINK=shared ENABLE_THREAD_SUPPORT=yes python3 scripts/build_xz_with_cmake.py deps/xz build/liblzma_test --verbose)",
44
- "Bash(USE_GLOBAL=true pnpm test)",
45
- "Bash(RUNTIME_LINK=shared ENABLE_THREAD_SUPPORT=no USE_GLOBAL=false pnpm run build)",
46
- "Bash(RUNTIME_LINK=shared ENABLE_THREAD_SUPPORT=yes USE_GLOBAL=false python3 scripts/build_xz_with_cmake.py /tmp/test_cmake /tmp/test_install --verbose)",
47
- "Bash(npx tsc:*)",
48
- "Bash(yamllint:*)",
49
- "Bash(./test-ci-logic.sh:*)",
50
- "Bash(find:*)",
51
- "Read(/tmp/**)",
52
- "Read(/tmp/**)",
53
- "Read(/tmp/**)",
54
- "Read(/tmp/**)",
55
- "Bash(USE_GLOBAL=false RUNTIME_LINK=static ENABLE_THREAD_SUPPORT=yes pnpm install --frozen-lockfile)",
56
- "Bash(USE_GLOBAL=false RUNTIME_LINK=static ENABLE_THREAD_SUPPORT=yes rm -rf build/Release deps)",
57
- "Bash(USE_GLOBAL=false RUNTIME_LINK=static ENABLE_THREAD_SUPPORT=yes rm -rf build/Release)",
58
- "Bash(USE_GLOBAL=false RUNTIME_LINK=static ENABLE_THREAD_SUPPORT=no rm -rf build/Release)",
59
- "Bash(USE_GLOBAL=false RUNTIME_LINK=static ENABLE_THREAD_SUPPORT=no pnpm rebuild)",
60
- "WebFetch(domain:www.npmjs.com)",
61
- "Bash(xargs ls:*)",
62
- "Bash(pnpm vitest run:*)",
63
- "Bash(pnpm outdated:*)",
64
- "Bash(pnpm audit:*)",
65
- "Bash(pnpm test:coverage:*)",
66
- "Bash(cat:*)",
67
- "mcp__github__get_workflow_run",
68
- "mcp__github__list_workflow_runs",
69
- "mcp__github__list_workflows",
70
- "Bash(gh run list:*)",
71
- "Bash(node-gyp rebuild:*)",
72
- "Bash(USE_GLOBAL=true RUNTIME_LINK=shared ENABLE_THREAD_SUPPORT=yes pnpm rebuild)",
73
- "Bash(export USE_GLOBAL=true RUNTIME_LINK=shared ENABLE_THREAD_SUPPORT=yes)",
74
- "Bash(npm:*)",
75
- "Bash(pnpm list:*)",
76
- "Read(//home/o2/.cache/node-gyp/22.15.0/include/node/**)",
77
- "Bash(pkg-config:*)",
78
- "Bash(g++:*)",
79
- "Read(//home/o2/.cache/node-gyp/22.15.0/**)",
80
- "Read(//tmp/**)",
81
- "mcp__github__list_workflow_jobs",
82
- "Bash(otool:*)",
83
- "Bash(git log:*)",
84
- "mcp__github__get_me",
85
- "mcp__github__list_tags",
86
- "mcp__github__get_commit",
87
- "mcp__github__get_file_contents"
88
- ],
89
- "deny": [],
90
- "ask": []
91
- }
92
- }
package/coverage/base.css DELETED
@@ -1,224 +0,0 @@
1
- body, html {
2
- margin:0; padding: 0;
3
- height: 100%;
4
- }
5
- body {
6
- font-family: Helvetica Neue, Helvetica, Arial;
7
- font-size: 14px;
8
- color:#333;
9
- }
10
- .small { font-size: 12px; }
11
- *, *:after, *:before {
12
- -webkit-box-sizing:border-box;
13
- -moz-box-sizing:border-box;
14
- box-sizing:border-box;
15
- }
16
- h1 { font-size: 20px; margin: 0;}
17
- h2 { font-size: 14px; }
18
- pre {
19
- font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
20
- margin: 0;
21
- padding: 0;
22
- -moz-tab-size: 2;
23
- -o-tab-size: 2;
24
- tab-size: 2;
25
- }
26
- a { color:#0074D9; text-decoration:none; }
27
- a:hover { text-decoration:underline; }
28
- .strong { font-weight: bold; }
29
- .space-top1 { padding: 10px 0 0 0; }
30
- .pad2y { padding: 20px 0; }
31
- .pad1y { padding: 10px 0; }
32
- .pad2x { padding: 0 20px; }
33
- .pad2 { padding: 20px; }
34
- .pad1 { padding: 10px; }
35
- .space-left2 { padding-left:55px; }
36
- .space-right2 { padding-right:20px; }
37
- .center { text-align:center; }
38
- .clearfix { display:block; }
39
- .clearfix:after {
40
- content:'';
41
- display:block;
42
- height:0;
43
- clear:both;
44
- visibility:hidden;
45
- }
46
- .fl { float: left; }
47
- @media only screen and (max-width:640px) {
48
- .col3 { width:100%; max-width:100%; }
49
- .hide-mobile { display:none!important; }
50
- }
51
-
52
- .quiet {
53
- color: #7f7f7f;
54
- color: rgba(0,0,0,0.5);
55
- }
56
- .quiet a { opacity: 0.7; }
57
-
58
- .fraction {
59
- font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
60
- font-size: 10px;
61
- color: #555;
62
- background: #E8E8E8;
63
- padding: 4px 5px;
64
- border-radius: 3px;
65
- vertical-align: middle;
66
- }
67
-
68
- div.path a:link, div.path a:visited { color: #333; }
69
- table.coverage {
70
- border-collapse: collapse;
71
- margin: 10px 0 0 0;
72
- padding: 0;
73
- }
74
-
75
- table.coverage td {
76
- margin: 0;
77
- padding: 0;
78
- vertical-align: top;
79
- }
80
- table.coverage td.line-count {
81
- text-align: right;
82
- padding: 0 5px 0 20px;
83
- }
84
- table.coverage td.line-coverage {
85
- text-align: right;
86
- padding-right: 10px;
87
- min-width:20px;
88
- }
89
-
90
- table.coverage td span.cline-any {
91
- display: inline-block;
92
- padding: 0 5px;
93
- width: 100%;
94
- }
95
- .missing-if-branch {
96
- display: inline-block;
97
- margin-right: 5px;
98
- border-radius: 3px;
99
- position: relative;
100
- padding: 0 4px;
101
- background: #333;
102
- color: yellow;
103
- }
104
-
105
- .skip-if-branch {
106
- display: none;
107
- margin-right: 10px;
108
- position: relative;
109
- padding: 0 4px;
110
- background: #ccc;
111
- color: white;
112
- }
113
- .missing-if-branch .typ, .skip-if-branch .typ {
114
- color: inherit !important;
115
- }
116
- .coverage-summary {
117
- border-collapse: collapse;
118
- width: 100%;
119
- }
120
- .coverage-summary tr { border-bottom: 1px solid #bbb; }
121
- .keyline-all { border: 1px solid #ddd; }
122
- .coverage-summary td, .coverage-summary th { padding: 10px; }
123
- .coverage-summary tbody { border: 1px solid #bbb; }
124
- .coverage-summary td { border-right: 1px solid #bbb; }
125
- .coverage-summary td:last-child { border-right: none; }
126
- .coverage-summary th {
127
- text-align: left;
128
- font-weight: normal;
129
- white-space: nowrap;
130
- }
131
- .coverage-summary th.file { border-right: none !important; }
132
- .coverage-summary th.pct { }
133
- .coverage-summary th.pic,
134
- .coverage-summary th.abs,
135
- .coverage-summary td.pct,
136
- .coverage-summary td.abs { text-align: right; }
137
- .coverage-summary td.file { white-space: nowrap; }
138
- .coverage-summary td.pic { min-width: 120px !important; }
139
- .coverage-summary tfoot td { }
140
-
141
- .coverage-summary .sorter {
142
- height: 10px;
143
- width: 7px;
144
- display: inline-block;
145
- margin-left: 0.5em;
146
- background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
147
- }
148
- .coverage-summary .sorted .sorter {
149
- background-position: 0 -20px;
150
- }
151
- .coverage-summary .sorted-desc .sorter {
152
- background-position: 0 -10px;
153
- }
154
- .status-line { height: 10px; }
155
- /* yellow */
156
- .cbranch-no { background: yellow !important; color: #111; }
157
- /* dark red */
158
- .red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
159
- .low .chart { border:1px solid #C21F39 }
160
- .highlighted,
161
- .highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
162
- background: #C21F39 !important;
163
- }
164
- /* medium red */
165
- .cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
166
- /* light red */
167
- .low, .cline-no { background:#FCE1E5 }
168
- /* light green */
169
- .high, .cline-yes { background:rgb(230,245,208) }
170
- /* medium green */
171
- .cstat-yes { background:rgb(161,215,106) }
172
- /* dark green */
173
- .status-line.high, .high .cover-fill { background:rgb(77,146,33) }
174
- .high .chart { border:1px solid rgb(77,146,33) }
175
- /* dark yellow (gold) */
176
- .status-line.medium, .medium .cover-fill { background: #f9cd0b; }
177
- .medium .chart { border:1px solid #f9cd0b; }
178
- /* light yellow */
179
- .medium { background: #fff4c2; }
180
-
181
- .cstat-skip { background: #ddd; color: #111; }
182
- .fstat-skip { background: #ddd; color: #111 !important; }
183
- .cbranch-skip { background: #ddd !important; color: #111; }
184
-
185
- span.cline-neutral { background: #eaeaea; }
186
-
187
- .coverage-summary td.empty {
188
- opacity: .5;
189
- padding-top: 4px;
190
- padding-bottom: 4px;
191
- line-height: 1;
192
- color: #888;
193
- }
194
-
195
- .cover-fill, .cover-empty {
196
- display:inline-block;
197
- height: 12px;
198
- }
199
- .chart {
200
- line-height: 0;
201
- }
202
- .cover-empty {
203
- background: white;
204
- }
205
- .cover-full {
206
- border-right: none !important;
207
- }
208
- pre.prettyprint {
209
- border: none !important;
210
- padding: 0 !important;
211
- margin: 0 !important;
212
- }
213
- .com { color: #999 !important; }
214
- .ignore-none { color: #999; font-weight: normal; }
215
-
216
- .wrapper {
217
- min-height: 100%;
218
- height: auto !important;
219
- height: 100%;
220
- margin: 0 auto -48px;
221
- }
222
- .footer, .push {
223
- height: 48px;
224
- }
@@ -1,87 +0,0 @@
1
- /* eslint-disable */
2
- var jumpToCode = (function init() {
3
- // Classes of code we would like to highlight in the file view
4
- var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
5
-
6
- // Elements to highlight in the file listing view
7
- var fileListingElements = ['td.pct.low'];
8
-
9
- // We don't want to select elements that are direct descendants of another match
10
- var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
11
-
12
- // Selector that finds elements on the page to which we can jump
13
- var selector =
14
- fileListingElements.join(', ') +
15
- ', ' +
16
- notSelector +
17
- missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
18
-
19
- // The NodeList of matching elements
20
- var missingCoverageElements = document.querySelectorAll(selector);
21
-
22
- var currentIndex;
23
-
24
- function toggleClass(index) {
25
- missingCoverageElements
26
- .item(currentIndex)
27
- .classList.remove('highlighted');
28
- missingCoverageElements.item(index).classList.add('highlighted');
29
- }
30
-
31
- function makeCurrent(index) {
32
- toggleClass(index);
33
- currentIndex = index;
34
- missingCoverageElements.item(index).scrollIntoView({
35
- behavior: 'smooth',
36
- block: 'center',
37
- inline: 'center'
38
- });
39
- }
40
-
41
- function goToPrevious() {
42
- var nextIndex = 0;
43
- if (typeof currentIndex !== 'number' || currentIndex === 0) {
44
- nextIndex = missingCoverageElements.length - 1;
45
- } else if (missingCoverageElements.length > 1) {
46
- nextIndex = currentIndex - 1;
47
- }
48
-
49
- makeCurrent(nextIndex);
50
- }
51
-
52
- function goToNext() {
53
- var nextIndex = 0;
54
-
55
- if (
56
- typeof currentIndex === 'number' &&
57
- currentIndex < missingCoverageElements.length - 1
58
- ) {
59
- nextIndex = currentIndex + 1;
60
- }
61
-
62
- makeCurrent(nextIndex);
63
- }
64
-
65
- return function jump(event) {
66
- if (
67
- document.getElementById('fileSearch') === document.activeElement &&
68
- document.activeElement != null
69
- ) {
70
- // if we're currently focused on the search input, we don't want to navigate
71
- return;
72
- }
73
-
74
- switch (event.which) {
75
- case 78: // n
76
- case 74: // j
77
- goToNext();
78
- break;
79
- case 66: // b
80
- case 75: // k
81
- case 80: // p
82
- goToPrevious();
83
- break;
84
- }
85
- };
86
- })();
87
- window.addEventListener('keydown', jumpToCode);