@rindo/core 2.22.3 → 3.0.0-alpha.1

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 (41) hide show
  1. package/bin/rindo +3 -3
  2. package/cli/index.cjs +3 -5
  3. package/cli/index.d.ts +3 -3
  4. package/cli/index.js +3 -5
  5. package/cli/package.json +1 -1
  6. package/compiler/package.json +1 -1
  7. package/compiler/rindo.js +190 -308
  8. package/compiler/rindo.min.js +2 -2
  9. package/dependencies.json +1 -1
  10. package/dev-server/client/index.js +1 -1
  11. package/dev-server/client/package.json +1 -1
  12. package/dev-server/connector.html +2 -2
  13. package/dev-server/index.js +1 -1
  14. package/dev-server/package.json +1 -1
  15. package/dev-server/server-process.js +2 -2
  16. package/internal/app-data/package.json +1 -1
  17. package/internal/client/css-shim.js +1 -1
  18. package/internal/client/dom.js +1 -1
  19. package/internal/client/index.js +1 -1
  20. package/internal/client/package.json +1 -1
  21. package/internal/client/patch-browser.js +1 -1
  22. package/internal/client/patch-esm.js +1 -1
  23. package/internal/client/shadow-css.js +1 -1
  24. package/internal/hydrate/package.json +1 -1
  25. package/internal/package.json +1 -1
  26. package/internal/rindo-private.d.ts +1 -0
  27. package/internal/rindo-public-compiler.d.ts +32 -43
  28. package/internal/rindo-public-runtime.d.ts +12 -12
  29. package/internal/testing/package.json +1 -1
  30. package/mock-doc/index.cjs +1 -1
  31. package/mock-doc/index.js +1 -1
  32. package/mock-doc/package.json +1 -1
  33. package/package.json +5 -5
  34. package/screenshot/package.json +1 -1
  35. package/sys/node/index.js +16 -19
  36. package/sys/node/package.json +1 -1
  37. package/sys/node/worker.js +1 -1
  38. package/testing/index.js +310 -123
  39. package/testing/package.json +1 -1
  40. package/testing/puppeteer/puppeteer-declarations.d.ts +1 -27
  41. package/testing/puppeteer/puppeteer-element.d.ts +3 -3
@@ -856,7 +856,7 @@ export interface CompilerSystem {
856
856
  /**
857
857
  * Add a callback which will be ran when destroy() is called.
858
858
  */
859
- addDestory(cb: () => void): void;
859
+ addDestroy(cb: () => void): void;
860
860
  /**
861
861
  * Always returns a boolean, does not throw.
862
862
  */
@@ -1020,7 +1020,7 @@ export interface CompilerSystem {
1020
1020
  /**
1021
1021
  * Remove a callback which will be ran when destroy() is called.
1022
1022
  */
1023
- removeDestory(cb: () => void): void;
1023
+ removeDestroy(cb: () => void): void;
1024
1024
  /**
1025
1025
  * Rename old path to new path. Does not throw.
1026
1026
  */
@@ -1056,23 +1056,7 @@ export interface CompilerSystem {
1056
1056
  statSync(p: string): CompilerFsStats;
1057
1057
  tmpDirSync(): string;
1058
1058
  watchDirectory?(p: string, callback: CompilerFileWatcherCallback, recursive?: boolean): CompilerFileWatcher;
1059
- /**
1060
- * A `watchFile` implementation in order to hook into the rest of the {@link CompilerSystem} implementation that is
1061
- * used when running Rindo's compiler in "watch mode".
1062
- *
1063
- * It is analogous to TypeScript's `watchFile` implementation.
1064
- *
1065
- * Note, this function may be called for full builds of Rindo projects by the TypeScript compiler. It should not
1066
- * assume that it will only be called in watch mode.
1067
- *
1068
- * This function should not perform any file watcher registration itself. Each `path` provided to it when called
1069
- * should already have been registered as a file to watch.
1070
- *
1071
- * @param path the path to the file that is being watched
1072
- * @param callback a callback to invoke when a file that is being watched has changed in some way
1073
- * @returns an object with a method for unhooking the file watcher from the system
1074
- */
1075
- watchFile?(path: string, callback: CompilerFileWatcherCallback): CompilerFileWatcher;
1059
+ watchFile?(p: string, callback: CompilerFileWatcherCallback): CompilerFileWatcher;
1076
1060
  /**
1077
1061
  * How many milliseconds to wait after a change before calling watch callbacks.
1078
1062
  */
@@ -1249,16 +1233,7 @@ export interface CompilerBuildStart {
1249
1233
  buildId: number;
1250
1234
  timestamp: string;
1251
1235
  }
1252
- /**
1253
- * A type describing a function to call when an event is emitted by a file watcher
1254
- * @param fileName the path of the file tied to event
1255
- * @param eventKind a variant describing the type of event that was emitter (added, edited, etc.)
1256
- */
1257
1236
  export type CompilerFileWatcherCallback = (fileName: string, eventKind: CompilerFileWatcherEvent) => void;
1258
- /**
1259
- * A type describing the different types of events that Rindo expects may happen when a file being watched is altered
1260
- * in some way
1261
- */
1262
1237
  export type CompilerFileWatcherEvent = CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventFileUpdate | CompilerEventDirAdd | CompilerEventDirDelete;
1263
1238
  export type CompilerEventName = CompilerEventFsChange | CompilerEventFileUpdate | CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventDirAdd | CompilerEventDirDelete | CompilerEventBuildStart | CompilerEventBuildFinish | CompilerEventBuildNoChange | CompilerEventBuildLog;
1264
1239
  export type CompilerEventFsChange = 'fsChange';
@@ -1877,6 +1852,28 @@ export interface OutputTargetBaseNext {
1877
1852
  type: string;
1878
1853
  dir?: string;
1879
1854
  }
1855
+ /**
1856
+ * The collection of valid export behaviors.
1857
+ * Used to generate a type for typed configs as well as output target validation
1858
+ * for the `dist-custom-elements` output target.
1859
+ *
1860
+ * Adding a value to this const array will automatically add it as a valid option on the
1861
+ * output target configuration for `customElementsExportBehavior`.
1862
+ *
1863
+ * - `default`: No additional export or definition behavior will happen.
1864
+ * - `auto-define-custom-elements`: Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This
1865
+ * functionality allows consumers to bypass the explicit call to define a component, its children, its children's
1866
+ * children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.
1867
+ * - `bundle`: A `defineCustomElements` function will be exported from the distribution directory. This behavior was added to allow easy migration
1868
+ * from `dist-custom-elements-bundle` to `dist-custom-elements`.
1869
+ * - `single-export-module`: All components will be re-exported from the specified directory's root `index.js` file.
1870
+ */
1871
+ export declare const CustomElementsExportBehaviorOptions: readonly ["default", "auto-define-custom-elements", "bundle", "single-export-module"];
1872
+ /**
1873
+ * This type is auto-generated based on the values in `CustomElementsExportBehaviorOptions` array.
1874
+ * This is used on the output target config for intellisense in typed configs.
1875
+ */
1876
+ export type CustomElementsExportBehavior = (typeof CustomElementsExportBehaviorOptions)[number];
1880
1877
  export interface OutputTargetDistCustomElements extends OutputTargetBaseNext {
1881
1878
  type: 'dist-custom-elements';
1882
1879
  empty?: boolean;
@@ -1891,16 +1888,16 @@ export interface OutputTargetDistCustomElements extends OutputTargetBaseNext {
1891
1888
  inlineDynamicImports?: boolean;
1892
1889
  includeGlobalScripts?: boolean;
1893
1890
  minify?: boolean;
1894
- /**
1895
- * Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This
1896
- * functionality allows consumers to bypass the explicit call to define a component, its children, its children's
1897
- * children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.
1898
- */
1899
- autoDefineCustomElements?: boolean;
1900
1891
  /**
1901
1892
  * Enables the generation of type definition files for the output target.
1902
1893
  */
1903
1894
  generateTypeDeclarations?: boolean;
1895
+ /**
1896
+ * Define the export/definition behavior for the output target's generated output.
1897
+ * This controls if/how custom elements will be defined or where components will be exported from.
1898
+ * If omitted, no auto-definition behavior or re-exporting will happen.
1899
+ */
1900
+ customElementsExportBehavior?: CustomElementsExportBehavior;
1904
1901
  }
1905
1902
  export interface OutputTargetDistCustomElementsBundle extends OutputTargetBaseNext {
1906
1903
  type: 'dist-custom-elements-bundle';
@@ -1921,14 +1918,6 @@ export interface OutputTargetBase {
1921
1918
  type: string;
1922
1919
  }
1923
1920
  export type OutputTargetBuild = OutputTargetDistCollection | OutputTargetDistLazy;
1924
- export interface OutputTargetAngular extends OutputTargetBase {
1925
- type: 'angular';
1926
- componentCorePackage: string;
1927
- directivesProxyFile?: string;
1928
- directivesArrayFile?: string;
1929
- directivesUtilsFile?: string;
1930
- excludeComponents?: string[];
1931
- }
1932
1921
  export interface OutputTargetCopy extends OutputTargetBase {
1933
1922
  type: 'copy';
1934
1923
  dir: string;
@@ -2008,7 +1997,7 @@ export interface OutputTargetWww extends OutputTargetBase {
2008
1997
  serviceWorker?: ServiceWorkerConfig | null | false;
2009
1998
  appDir?: string;
2010
1999
  }
2011
- export type OutputTarget = OutputTargetAngular | OutputTargetCopy | OutputTargetCustom | OutputTargetDist | OutputTargetDistCollection | OutputTargetDistCustomElements | OutputTargetDistCustomElementsBundle | OutputTargetDistLazy | OutputTargetDistGlobalStyles | OutputTargetDistLazyLoader | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetWww | OutputTargetHydrate | OutputTargetStats | OutputTargetDistTypes;
2000
+ export type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetDist | OutputTargetDistCollection | OutputTargetDistCustomElements | OutputTargetDistCustomElementsBundle | OutputTargetDistLazy | OutputTargetDistGlobalStyles | OutputTargetDistLazyLoader | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetWww | OutputTargetHydrate | OutputTargetStats | OutputTargetDistTypes;
2012
2001
  export interface ServiceWorkerConfig {
2013
2002
  unregister?: boolean;
2014
2003
  swDest?: string;
@@ -892,8 +892,8 @@ export declare namespace JSXBase {
892
892
  accept?: string;
893
893
  allowdirs?: boolean;
894
894
  alt?: string;
895
- autoCapitalize?: any;
896
- autocapitalize?: any;
895
+ autoCapitalize?: string;
896
+ autocapitalize?: string;
897
897
  autoComplete?: string;
898
898
  autocomplete?: string;
899
899
  autoFocus?: boolean;
@@ -1217,8 +1217,8 @@ export declare namespace JSXBase {
1217
1217
  resource?: string;
1218
1218
  typeof?: string;
1219
1219
  vocab?: string;
1220
- autoCapitalize?: any;
1221
- autocapitalize?: any;
1220
+ autoCapitalize?: string;
1221
+ autocapitalize?: string;
1222
1222
  autoCorrect?: string;
1223
1223
  autocorrect?: string;
1224
1224
  autoSave?: string;
@@ -1509,12 +1509,12 @@ export declare namespace JSXBase {
1509
1509
  onCutCapture?: (event: ClipboardEvent) => void;
1510
1510
  onPaste?: (event: ClipboardEvent) => void;
1511
1511
  onPasteCapture?: (event: ClipboardEvent) => void;
1512
- onCompositionEnd?: (event: CompositionEvent) => void;
1513
- onCompositionEndCapture?: (event: CompositionEvent) => void;
1514
- onCompositionStart?: (event: CompositionEvent) => void;
1515
- onCompositionStartCapture?: (event: CompositionEvent) => void;
1516
- onCompositionUpdate?: (event: CompositionEvent) => void;
1517
- onCompositionUpdateCapture?: (event: CompositionEvent) => void;
1512
+ onCompositionend?: (event: CompositionEvent) => void;
1513
+ onCompositionendCapture?: (event: CompositionEvent) => void;
1514
+ onCompositionstart?: (event: CompositionEvent) => void;
1515
+ onCompositionstartCapture?: (event: CompositionEvent) => void;
1516
+ onCompositionupdate?: (event: CompositionEvent) => void;
1517
+ onCompositionupdateCapture?: (event: CompositionEvent) => void;
1518
1518
  onFocus?: (event: FocusEvent) => void;
1519
1519
  onFocusCapture?: (event: FocusEvent) => void;
1520
1520
  onFocusin?: (event: FocusEvent) => void;
@@ -1525,8 +1525,8 @@ export declare namespace JSXBase {
1525
1525
  onBlurCapture?: (event: FocusEvent) => void;
1526
1526
  onChange?: (event: Event) => void;
1527
1527
  onChangeCapture?: (event: Event) => void;
1528
- onInput?: (event: Event) => void;
1529
- onInputCapture?: (event: Event) => void;
1528
+ onInput?: (event: InputEvent) => void;
1529
+ onInputCapture?: (event: InputEvent) => void;
1530
1530
  onReset?: (event: Event) => void;
1531
1531
  onResetCapture?: (event: Event) => void;
1532
1532
  onSubmit?: (event: Event) => void;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal/testing",
3
- "version": "2.22.3",
3
+ "version": "3.0.0-alpha.1",
4
4
  "description": "Rindo internal testing platform to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Mock Doc (CommonJS) v2.22.3 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Mock Doc (CommonJS) v3.0.0-alpha.1 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  var mockDoc = (function(exports) {
5
5
  'use strict';
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Mock Doc v2.22.3 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Mock Doc v3.0.0-alpha.1 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  const CONTENT_REF_ID = 'r';
5
5
  const ORG_LOCATION_ID = 'o';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/mock-doc",
3
- "version": "2.22.3",
3
+ "version": "3.0.0-alpha.1",
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": "2.22.3",
3
+ "version": "3.0.0-alpha.1",
4
4
  "license": "MIT",
5
5
  "main": "./internal/rindo-core/index.cjs",
6
6
  "module": "./internal/rindo-core/index.js",
@@ -33,8 +33,8 @@
33
33
  "prettier": "npm run prettier.base -- --write",
34
34
  "prettier.base": "prettier --cache \"./({bin,scripts,src}/**/*.{ts,tsx,js,jsx})|bin/rindo|.github/(**/)?*.(yml|yaml)|*.js\"",
35
35
  "prettier.dry-run": "npm run prettier.base -- --list-different",
36
- "release": "npm run tsc.scripts && node scripts/build --any-branch --release --publish",
37
- "release.prepare": "npm run tsc.scripts && node scripts/build --any-branch --release --prepare",
36
+ "release": "npm run tsc.scripts && node scripts/build --release --publish",
37
+ "release.prepare": "npm run tsc.scripts && node scripts/build --release --prepare",
38
38
  "rollup": "rollup --config",
39
39
  "rollup.prod": "rollup --config --config-prod",
40
40
  "rollup.prod.ci": "rollup --config --config-prod --config-ci",
@@ -105,7 +105,7 @@
105
105
  "postcss": "^8.2.8",
106
106
  "prettier": "2.8.3",
107
107
  "prompts": "2.4.2",
108
- "puppeteer": "~10.0.0",
108
+ "puppeteer": "^19.3.0",
109
109
  "rollup": "2.42.3",
110
110
  "rollup-plugin-sourcemaps": "^0.6.3",
111
111
  "semver": "^7.3.7",
@@ -116,7 +116,7 @@
116
116
  "ws": "8.12.0"
117
117
  },
118
118
  "engines": {
119
- "node": ">=12.10.0",
119
+ "node": ">=14.10.0",
120
120
  "npm": ">=6.0.0"
121
121
  },
122
122
  "repository": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/screenshot",
3
- "version": "2.22.3",
3
+ "version": "3.0.0-alpha.1",
4
4
  "description": "Rindo Screenshot.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
package/sys/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Node System v2.22.3 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Node System v3.0.0-alpha.1 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  function _interopDefaultLegacy(e) {
5
5
  return e && "object" == typeof e && "default" in e ? e : {
@@ -1282,7 +1282,7 @@ lockfile = createCommonjsModule((function(e) {
1282
1282
  }
1283
1283
  })), function e(t, r) {
1284
1284
  return R.apply(this, arguments);
1285
- }), W = t.walk = (N = (0, (d || n()).default)((function*(e, t, r = new Set) {
1285
+ }), z = t.walk = (N = (0, (d || n()).default)((function*(e, t, r = new Set) {
1286
1286
  var n, i, o, a;
1287
1287
  let l = [], c = yield ne(e);
1288
1288
  for (r.size && (c = c.filter((function(e) {
@@ -1301,7 +1301,7 @@ lockfile = createCommonjsModule((function(e) {
1301
1301
  basename: c,
1302
1302
  absolute: f,
1303
1303
  mtime: +h.mtime
1304
- }), h.isDirectory() && (l = l.concat(yield W(f, u, r)));
1304
+ }), h.isDirectory() && (l = l.concat(yield z(f, u, r)));
1305
1305
  }
1306
1306
  return l;
1307
1307
  })), function e(t, r) {
@@ -1313,7 +1313,7 @@ lockfile = createCommonjsModule((function(e) {
1313
1313
  })), function e(t) {
1314
1314
  return I.apply(this, arguments);
1315
1315
  });
1316
- let z = (P = (0, (d || n()).default)((function*(e) {
1316
+ let W = (P = (0, (d || n()).default)((function*(e) {
1317
1317
  if (!(yield se(e))) return;
1318
1318
  const t = yield J(e);
1319
1319
  for (let e = 0; e < t.length; ++e) {
@@ -1324,7 +1324,7 @@ lockfile = createCommonjsModule((function(e) {
1324
1324
  return P.apply(this, arguments);
1325
1325
  });
1326
1326
  t.writeFilePreservingEol = (j = (0, (d || n()).default)((function*(e, t) {
1327
- const r = (yield z(e)) || (y || o()).default.EOL;
1327
+ const r = (yield W(e)) || (y || o()).default.EOL;
1328
1328
  "\n" !== r && (t = t.replace(/\n/g, r)), yield ee(e, t);
1329
1329
  })), function e(t, r) {
1330
1330
  return j.apply(this, arguments);
@@ -5673,10 +5673,10 @@ exports.createNodeLogger = e => {
5673
5673
  } catch (e) {}
5674
5674
  return t;
5675
5675
  },
5676
- addDestory(e) {
5676
+ addDestroy(e) {
5677
5677
  n.add(e);
5678
5678
  },
5679
- removeDestory(e) {
5679
+ removeDestroy(e) {
5680
5680
  n.delete(e);
5681
5681
  },
5682
5682
  applyPrerenderGlobalPatch(e) {
@@ -5979,9 +5979,9 @@ exports.createNodeLogger = e => {
5979
5979
  }), n), o = () => {
5980
5980
  i.close();
5981
5981
  };
5982
- return f.addDestory(o), {
5982
+ return f.addDestroy(o), {
5983
5983
  close() {
5984
- f.removeDestory(o), i.close();
5984
+ f.removeDestroy(o), i.close();
5985
5985
  }
5986
5986
  };
5987
5987
  }, f.watchFile = (e, r) => {
@@ -5989,15 +5989,12 @@ exports.createNodeLogger = e => {
5989
5989
  e = normalizePath(e), n === t.FileWatcherEventKind.Created ? (r(e, "fileAdd"), f.events.emit("fileAdd", e)) : n === t.FileWatcherEventKind.Changed ? (r(e, "fileUpdate"),
5990
5990
  f.events.emit("fileUpdate", e)) : n === t.FileWatcherEventKind.Deleted && (r(e, "fileDelete"),
5991
5991
  f.events.emit("fileDelete", e));
5992
- }), 250, {
5993
- watchFile: t.WatchFileKind.FixedPollingInterval,
5994
- fallbackPolling: t.PollingWatchKind.FixedInterval
5995
- }), o = () => {
5992
+ })), o = () => {
5996
5993
  i.close();
5997
5994
  };
5998
- return f.addDestory(o), {
5995
+ return f.addDestroy(o), {
5999
5996
  close() {
6000
- f.removeDestory(o), i.close();
5997
+ f.removeDestroy(o), i.close();
6001
5998
  }
6002
5999
  };
6003
6000
  };
@@ -6101,12 +6098,12 @@ exports.createNodeLogger = e => {
6101
6098
  maxVersion: "27.0.0"
6102
6099
  },
6103
6100
  puppeteer: {
6104
- minVersion: "1.19.0",
6105
- recommendedVersion: "10.0.0"
6101
+ minVersion: "10.0.0",
6102
+ recommendedVersion: "19"
6106
6103
  },
6107
6104
  "puppeteer-core": {
6108
- minVersion: "1.19.0",
6109
- recommendedVersion: "5.2.1"
6105
+ minVersion: "10.0.0",
6106
+ recommendedVersion: "19"
6110
6107
  },
6111
6108
  "workbox-build": {
6112
6109
  minVersion: "4.3.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/sys/node",
3
- "version": "2.22.3",
3
+ "version": "3.0.0-alpha.1",
4
4
  "description": "Rindo Node System.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Node System Worker v2.22.3 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Node System Worker v3.0.0-alpha.1 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  function _interopNamespace(e) {
5
5
  if (e && e.__esModule) return e;