@rindo/core 4.18.2 → 4.18.3-dev.1734304270.ca7046f

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 (42) hide show
  1. package/cli/index.cjs +27 -12
  2. package/cli/index.js +27 -12
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/rindo.js +939 -679
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +2 -2
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +52 -40
  12. package/dev-server/ws.js +1 -1
  13. package/internal/app-data/package.json +1 -1
  14. package/internal/client/index.js +38 -17
  15. package/internal/client/package.json +1 -1
  16. package/internal/client/patch-browser.js +1 -1
  17. package/internal/hydrate/index.js +36 -17
  18. package/internal/hydrate/package.json +1 -1
  19. package/internal/hydrate/runner.js +70 -60
  20. package/internal/package.json +1 -1
  21. package/internal/rindo-private.d.ts +13 -7
  22. package/internal/rindo-public-compiler.d.ts +10 -3
  23. package/internal/testing/index.js +35 -16
  24. package/internal/testing/package.json +1 -1
  25. package/mock-doc/index.cjs +70 -60
  26. package/mock-doc/index.d.ts +36 -30
  27. package/mock-doc/index.js +70 -60
  28. package/mock-doc/package.json +1 -1
  29. package/package.json +18 -21
  30. package/screenshot/index.js +1 -1
  31. package/screenshot/package.json +1 -1
  32. package/screenshot/pixel-match.js +4 -1
  33. package/sys/node/autoprefixer.js +2 -2
  34. package/sys/node/glob.js +1 -1
  35. package/sys/node/index.js +2 -2
  36. package/sys/node/node-fetch.js +10 -2
  37. package/sys/node/package.json +1 -1
  38. package/sys/node/worker.js +1 -1
  39. package/testing/index.js +33 -15
  40. package/testing/mock-fetch.d.ts +4 -4
  41. package/testing/mocks.d.ts +9 -9
  42. package/testing/package.json +1 -1
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Mock Doc v4.18.2 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Mock Doc v4.18.3-dev.1734304270.ca7046f | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
 
5
5
  // src/runtime/runtime-constants.ts
@@ -8149,67 +8149,75 @@ var MockUListElement = class extends MockHTMLElement {
8149
8149
  super(ownerDocument, "ul");
8150
8150
  }
8151
8151
  };
8152
+ var CanvasRenderingContext = class {
8153
+ constructor(context, contextAttributes) {
8154
+ this.context = context;
8155
+ this.contextAttributes = contextAttributes;
8156
+ }
8157
+ fillRect() {
8158
+ return;
8159
+ }
8160
+ clearRect() {
8161
+ }
8162
+ getImageData(_, __, w, h) {
8163
+ return {
8164
+ data: new Array(w * h * 4)
8165
+ };
8166
+ }
8167
+ toDataURL() {
8168
+ return "data:,";
8169
+ }
8170
+ putImageData() {
8171
+ }
8172
+ createImageData() {
8173
+ return {};
8174
+ }
8175
+ setTransform() {
8176
+ }
8177
+ drawImage() {
8178
+ }
8179
+ save() {
8180
+ }
8181
+ fillText() {
8182
+ }
8183
+ restore() {
8184
+ }
8185
+ beginPath() {
8186
+ }
8187
+ moveTo() {
8188
+ }
8189
+ lineTo() {
8190
+ }
8191
+ closePath() {
8192
+ }
8193
+ stroke() {
8194
+ }
8195
+ translate() {
8196
+ }
8197
+ scale() {
8198
+ }
8199
+ rotate() {
8200
+ }
8201
+ arc() {
8202
+ }
8203
+ fill() {
8204
+ }
8205
+ measureText() {
8206
+ return { width: 0 };
8207
+ }
8208
+ transform() {
8209
+ }
8210
+ rect() {
8211
+ }
8212
+ clip() {
8213
+ }
8214
+ };
8152
8215
  var MockCanvasElement = class extends MockHTMLElement {
8153
8216
  constructor(ownerDocument) {
8154
8217
  super(ownerDocument, "canvas");
8155
8218
  }
8156
- getContext() {
8157
- return {
8158
- fillRect() {
8159
- return;
8160
- },
8161
- clearRect() {
8162
- },
8163
- getImageData: function(_, __, w, h) {
8164
- return {
8165
- data: new Array(w * h * 4)
8166
- };
8167
- },
8168
- putImageData() {
8169
- },
8170
- createImageData: function() {
8171
- return [];
8172
- },
8173
- setTransform() {
8174
- },
8175
- drawImage() {
8176
- },
8177
- save() {
8178
- },
8179
- fillText() {
8180
- },
8181
- restore() {
8182
- },
8183
- beginPath() {
8184
- },
8185
- moveTo() {
8186
- },
8187
- lineTo() {
8188
- },
8189
- closePath() {
8190
- },
8191
- stroke() {
8192
- },
8193
- translate() {
8194
- },
8195
- scale() {
8196
- },
8197
- rotate() {
8198
- },
8199
- arc() {
8200
- },
8201
- fill() {
8202
- },
8203
- measureText() {
8204
- return { width: 0 };
8205
- },
8206
- transform() {
8207
- },
8208
- rect() {
8209
- },
8210
- clip() {
8211
- }
8212
- };
8219
+ getContext(context, contextAttributes) {
8220
+ return new CanvasRenderingContext(context, contextAttributes);
8213
8221
  }
8214
8222
  };
8215
8223
  function fullUrl(elm, attrName) {
@@ -8679,14 +8687,16 @@ var WINDOW_PROPS = [
8679
8687
  ];
8680
8688
  var GLOBAL_CONSTRUCTORS = [
8681
8689
  ["CustomEvent", MockCustomEvent],
8690
+ ["DocumentFragment", MockDocumentFragment],
8691
+ ["DOMParser", MockDOMParser],
8682
8692
  ["Event", MockEvent],
8683
- ["Headers", MockHeaders],
8684
8693
  ["FocusEvent", MockFocusEvent],
8694
+ ["Headers", MockHeaders],
8685
8695
  ["KeyboardEvent", MockKeyboardEvent],
8686
8696
  ["MouseEvent", MockMouseEvent],
8687
8697
  ["Request", MockRequest],
8688
8698
  ["Response", MockResponse],
8689
- ["DOMParser", MockDOMParser],
8699
+ ["ShadowRoot", MockDocumentFragment],
8690
8700
  ["HTMLAnchorElement", MockAnchorElement],
8691
8701
  ["HTMLBaseElement", MockBaseElement],
8692
8702
  ["HTMLButtonElement", MockButtonElement],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/mock-doc",
3
- "version": "4.18.2",
3
+ "version": "4.18.3-dev.1734304270.ca7046f",
4
4
  "description": "Mock window, document and DOM outside of a browser environment.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core",
3
- "version": "4.18.2",
3
+ "version": "4.18.3-dev.1734304270.ca7046f",
4
4
  "license": "MIT",
5
5
  "main": "./internal/rindo-core/index.cjs",
6
6
  "module": "./internal/rindo-core/index.js",
@@ -23,25 +23,23 @@
23
23
  "testing/"
24
24
  ],
25
25
  "scripts": {
26
- "build": "npm run clean && npm run tsc.scripts && npm run tsc.prod && node scripts/build --prod --ci",
26
+ "build": "npm run clean && npm run tsc.prod && npm run ts scripts/index.ts -- --prod --ci",
27
27
  "build.watch": "npm run build -- --watch",
28
- "build.updateSelectorEngine": "node scripts/build/updateSelectorEngine.js",
29
- "clean": "rm -rf build/ cli/ compiler/ dev-server/ internal/ mock-doc/ sys/ testing/ && npm run clean.scripts && npm run clean.screenshots",
30
- "clean.scripts": "rm -rf scripts/build",
28
+ "build.updateSelectorEngine": "npm run ts scripts/updateSelectorEngine.ts",
29
+ "clean": "rm -rf build/ cli/ compiler/ dev-server/ internal/ mock-doc/ sys/ testing/ && npm run clean:scripts && npm run clean.screenshots",
31
30
  "clean.screenshots": "rm -rf test/end-to-end/screenshot/builds test/end-to-end/screenshot/images",
31
+ "clean:scripts": "rm -rf scripts/build",
32
32
  "lint": "eslint \"bin/*\" \"scripts/*.ts\" \"scripts/**/*.ts\" \"src/*.ts\" \"src/**/*.ts\" \"src/**/*.tsx\"",
33
33
  "install.jest": "bash ./src/testing/jest/install-dependencies.sh",
34
34
  "prettier": "npm run prettier.base -- --write",
35
35
  "prettier.base": "prettier --cache \"./({bin,scripts,src,test}/**/*.{ts,tsx,js,jsx})|bin/rindo|.github/(**/)?*.(yml|yaml)|*.js\"",
36
36
  "prettier.dry-run": "npm run prettier.base -- --list-different",
37
- "release.ci.prepare": "npm run tsc.scripts && node scripts/build --release --ci-prepare",
38
- "release.ci": "npm run tsc.scripts && NODE_OPTIONS=--max-old-space-size=4096 node scripts/build --release --ci-publish",
39
- "rollup.prod.ci": "rollup --config --config-prod --config-ci",
40
- "rollup.watch": "rollup --watch --config",
37
+ "release.ci.prepare": "npm run ts scripts/index.ts -- --release --ci-prepare",
38
+ "release.ci": "NODE_OPTIONS=--max-old-space-size=4096 npm run ts scripts/index.ts -- --release --ci-publish",
41
39
  "test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --coverage",
42
40
  "test.analysis": "cd test && npm run analysis.build-and-analyze",
43
41
  "test.bundlers": "cd test && npm run bundlers",
44
- "test.dist": "node scripts/build --validate-build",
42
+ "test.dist": "npm run ts scripts/index.ts -- --validate-build",
45
43
  "test.end-to-end": "cd test/end-to-end && npm ci && npm test && npm run test.dist",
46
44
  "test.jest": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js",
47
45
  "test.prod": "npm run test.dist && npm run test.end-to-end && npm run test.jest && npm run test.testing && npm run test.analysis",
@@ -49,17 +47,15 @@
49
47
  "test.docs-build": "cd test && npm run build.docs-json && npm run build.docs-readme",
50
48
  "test.watch": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --watch",
51
49
  "test.watch-all": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --watchAll --coverage",
52
- "tsc": "tsc --incremental",
53
50
  "tsc.prod": "tsc",
54
- "tsc.scripts": "tsc --build --force scripts/tsconfig.json",
55
- "tsc.watch": "tsc --incremental --watch"
51
+ "ts": "tsc --noEmit --project scripts/tsconfig.json && tsx"
56
52
  },
57
53
  "devDependencies": {
58
54
  "@familyjs/prettier-config": "^4.0.0",
59
55
  "@rollup/plugin-commonjs": "21.1.0",
60
56
  "@rollup/plugin-json": "6.1.0",
61
57
  "@rollup/plugin-node-resolve": "9.0.0",
62
- "@rollup/plugin-replace": "5.0.5",
58
+ "@rollup/plugin-replace": "5.0.7",
63
59
  "@rollup/pluginutils": "5.1.0",
64
60
  "@types/eslint": "^8.4.6",
65
61
  "@types/exit": "^0.1.31",
@@ -79,7 +75,7 @@
79
75
  "@yarnpkg/lockfile": "^1.1.0",
80
76
  "ansi-colors": "4.1.3",
81
77
  "autoprefixer": "10.4.19",
82
- "conventional-changelog-cli": "^4.0.0",
78
+ "conventional-changelog-cli": "^5.0.0",
83
79
  "dts-bundle-generator": "~9.5.0",
84
80
  "esbuild": "^0.21.0",
85
81
  "esbuild-plugin-replace": "^1.4.0",
@@ -91,7 +87,7 @@
91
87
  "execa": "8.0.1",
92
88
  "exit": "^0.1.2",
93
89
  "fs-extra": "^11.0.0",
94
- "glob": "10.3.15",
90
+ "glob": "10.4.1",
95
91
  "graceful-fs": "~4.2.6",
96
92
  "jest": "^27.4.5",
97
93
  "jest-cli": "^27.4.5",
@@ -108,15 +104,16 @@
108
104
  "parse5": "7.1.2",
109
105
  "pixelmatch": "5.3.0",
110
106
  "postcss": "^8.2.8",
111
- "prettier": "3.2.4",
107
+ "prettier": "3.3.1",
112
108
  "prompts": "2.4.2",
113
109
  "puppeteer": "^21.0.0",
114
110
  "rollup": "2.56.3",
115
111
  "semver": "^7.3.7",
116
- "terser": "5.31.0",
112
+ "terser": "5.31.1",
113
+ "tsx": "^4.10.3",
117
114
  "typescript": "~5.4.0",
118
115
  "webpack": "^5.75.0",
119
- "ws": "8.17.0"
116
+ "ws": "8.17.1"
120
117
  },
121
118
  "engines": {
122
119
  "node": ">=16.0.0",
@@ -141,7 +138,7 @@
141
138
  ],
142
139
  "prettier": "@familyjs/prettier-config",
143
140
  "volta": {
144
- "node": "22.1.0",
145
- "npm": "10.7.0"
141
+ "node": "22.2.0",
142
+ "npm": "10.8.1"
146
143
  }
147
144
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Screenshot v4.18.2 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Screenshot v4.18.3-dev.1734304270.ca7046f | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/screenshot",
3
- "version": "4.18.2",
3
+ "version": "4.18.3-dev.1734304270.ca7046f",
4
4
  "description": "Rindo Screenshot.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Screenshot Pixel Match v4.18.2 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Screenshot Pixel Match v4.18.3-dev.1734304270.ca7046f | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;
@@ -2306,6 +2306,9 @@ function getMismatchedPixels(pixelMatchInput) {
2306
2306
  threshold: pixelMatchInput.pixelmatchThreshold,
2307
2307
  includeAA: false
2308
2308
  });
2309
+ if (typeof process.send !== "function") {
2310
+ throw new Error("`getMismatchedPixels` must be run in a child process.");
2311
+ }
2309
2312
  process.send(mismatchedPixels);
2310
2313
  }
2311
2314
  }