@rindo/core 2.17.0 → 2.17.2-0

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 (49) hide show
  1. package/cli/config-flags.d.ts +110 -0
  2. package/cli/index.cjs +612 -220
  3. package/cli/index.d.ts +2 -1
  4. package/cli/index.js +612 -220
  5. package/cli/package.json +1 -1
  6. package/compiler/package.json +1 -1
  7. package/compiler/rindo.js +391 -178
  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 +11 -6
  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/index.js +2 -2
  25. package/internal/hydrate/package.json +1 -1
  26. package/internal/package.json +1 -1
  27. package/internal/rindo-private.d.ts +2 -2
  28. package/internal/rindo-public-compiler.d.ts +67 -48
  29. package/internal/testing/index.js +1 -1
  30. package/internal/testing/package.json +1 -1
  31. package/mock-doc/index.cjs +26 -3
  32. package/mock-doc/index.d.ts +10 -0
  33. package/mock-doc/index.js +26 -3
  34. package/mock-doc/package.json +1 -1
  35. package/package.json +5 -3
  36. package/screenshot/package.json +1 -1
  37. package/sys/node/index.js +4 -4
  38. package/sys/node/package.json +1 -1
  39. package/sys/node/worker.js +1 -1
  40. package/testing/index.d.ts +1 -1
  41. package/testing/index.js +49 -25
  42. package/testing/jest/jest-config.d.ts +1 -1
  43. package/testing/jest/jest-runner.d.ts +3 -2
  44. package/testing/jest/jest-screenshot.d.ts +1 -1
  45. package/testing/mocks.d.ts +27 -2
  46. package/testing/package.json +1 -1
  47. package/testing/puppeteer/puppeteer-browser.d.ts +2 -2
  48. package/testing/testing-utils.d.ts +74 -2
  49. package/testing/testing.d.ts +2 -2
@@ -1,5 +1,6 @@
1
1
  import type { JsonDocs } from './rindo-public-docs';
2
2
  import type { PrerenderUrlResults } from '../internal';
3
+ import type { ConfigFlags } from '../cli/config-flags';
3
4
  export * from './rindo-public-docs';
4
5
  /**
5
6
  * https://rindojs.web.app/docs/config/
@@ -356,6 +357,29 @@ declare type Loose<T extends Object> = Record<string, any> & Partial<T>;
356
357
  * and have type information carry though as we construct an object which is a valid `Config`.
357
358
  */
358
359
  export declare type UnvalidatedConfig = Loose<Config>;
360
+ /**
361
+ * Helper type to strip optional markers from keys in a type, while preserving other type information for the key.
362
+ * This type takes a union of keys, K, in type T to allow for the type T to be gradually updated.
363
+ *
364
+ * ```typescript
365
+ * type Foo { bar?: number, baz?: string }
366
+ * type ReqFieldFoo = RequireFields<Foo, 'bar'>; // { bar: number, baz?: string }
367
+ * ```
368
+ */
369
+ declare type RequireFields<T, K extends keyof T> = T & {
370
+ [P in K]-?: T[P];
371
+ };
372
+ /**
373
+ * Fields in {@link Config} to make required for {@link ValidatedConfig}
374
+ */
375
+ declare type StrictConfigFields = 'flags' | 'logger';
376
+ /**
377
+ * A version of {@link Config} that makes certain fields required. This type represents a valid configuration entity.
378
+ * When a configuration is received by the user, it is a bag of unverified data. In order to make stricter guarantees
379
+ * about the data from a type-safety perspective, this type is intended to be used throughout the codebase once
380
+ * validations have occurred at runtime.
381
+ */
382
+ export declare type ValidatedConfig = RequireFields<Config, StrictConfigFields>;
359
383
  export interface HydratedFlag {
360
384
  /**
361
385
  * Defaults to `hydrated`.
@@ -505,51 +529,6 @@ export interface DevServerEditor {
505
529
  supported?: boolean;
506
530
  priority?: number;
507
531
  }
508
- export interface ConfigFlags {
509
- task?: TaskCommand;
510
- args?: string[];
511
- knownArgs?: string[];
512
- unknownArgs?: string[];
513
- address?: string;
514
- build?: boolean;
515
- cache?: boolean;
516
- checkVersion?: boolean;
517
- ci?: boolean;
518
- compare?: boolean;
519
- config?: string;
520
- debug?: boolean;
521
- dev?: boolean;
522
- docs?: boolean;
523
- docsApi?: string;
524
- docsJson?: string;
525
- e2e?: boolean;
526
- emulate?: string;
527
- es5?: boolean;
528
- esm?: boolean;
529
- headless?: boolean;
530
- help?: boolean;
531
- log?: boolean;
532
- logLevel?: LogLevel;
533
- verbose?: boolean;
534
- maxWorkers?: number;
535
- open?: boolean;
536
- port?: number;
537
- prerender?: boolean;
538
- prod?: boolean;
539
- profile?: boolean;
540
- root?: string;
541
- screenshot?: boolean;
542
- screenshotConnector?: string;
543
- serve?: boolean;
544
- serviceWorker?: boolean;
545
- spec?: boolean;
546
- ssr?: boolean;
547
- stats?: boolean;
548
- updateScreenshot?: boolean;
549
- version?: boolean;
550
- watch?: boolean;
551
- devtools?: boolean;
552
- }
553
532
  export declare type TaskCommand = 'build' | 'docs' | 'generate' | 'g' | 'help' | 'info' | 'prerender' | 'serve' | 'telemetry' | 'test' | 'version';
554
533
  export declare type PageReloadStrategy = 'hmr' | 'pageReload' | null;
555
534
  /**
@@ -1653,7 +1632,29 @@ export interface EmulateViewport {
1653
1632
  */
1654
1633
  isLandscape?: boolean;
1655
1634
  }
1656
- export declare type LogLevel = 'debug' | 'info' | 'warn' | 'error';
1635
+ /**
1636
+ * This sets the log level hierarchy for our terminal logger, ranging from
1637
+ * most to least verbose.
1638
+ *
1639
+ * Ordering the levels like this lets us easily check whether we should log a
1640
+ * message at a given time. For instance, if the log level is set to `'warn'`,
1641
+ * then anything passed to the logger with level `'warn'` or `'error'` should
1642
+ * be logged, but we should _not_ log anything with level `'info'` or `'debug'`.
1643
+ *
1644
+ * If we have a current log level `currentLevel` and a message with level
1645
+ * `msgLevel` is passed to the logger, we can determine whether or not we should
1646
+ * log it by checking if the log level on the message is further up or at the
1647
+ * same level in the hierarchy than `currentLevel`, like so:
1648
+ *
1649
+ * ```ts
1650
+ * LOG_LEVELS.indexOf(msgLevel) >= LOG_LEVELS.indexOf(currentLevel)
1651
+ * ```
1652
+ *
1653
+ * NOTE: for the reasons described above, do not change the order of the entries
1654
+ * in this array without good reason!
1655
+ */
1656
+ export declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error"];
1657
+ export declare type LogLevel = typeof LOG_LEVELS[number];
1657
1658
  /**
1658
1659
  * Common logger to be used by the compiler, dev-server and CLI. The CLI will use a
1659
1660
  * NodeJS based console logging and colors, and the web will use browser based
@@ -1980,7 +1981,7 @@ export interface LoadConfigInit {
1980
1981
  * operations around the codebase.
1981
1982
  */
1982
1983
  export interface LoadConfigResults {
1983
- config: UnvalidatedConfig;
1984
+ config: ValidatedConfig;
1984
1985
  diagnostics: Diagnostic[];
1985
1986
  tsconfig: {
1986
1987
  path: string;
@@ -2048,14 +2049,32 @@ export interface PrerenderResults {
2048
2049
  duration: number;
2049
2050
  average: number;
2050
2051
  }
2052
+ /**
2053
+ * Input for CSS optimization functions, including the input CSS
2054
+ * string and a few boolean options which turn on or off various
2055
+ * optimizations.
2056
+ */
2051
2057
  export interface OptimizeCssInput {
2052
2058
  input: string;
2053
2059
  filePath?: string;
2054
- autoprefixer?: any;
2060
+ autoprefixer?: boolean | null | AutoprefixerOptions;
2055
2061
  minify?: boolean;
2056
2062
  sourceMap?: boolean;
2057
2063
  resolveUrl?: (url: string) => Promise<string> | string;
2058
2064
  }
2065
+ /**
2066
+ * This is not a real interface describing the options which can
2067
+ * be passed to autoprefixer, for that see the docs, here:
2068
+ * https://github.com/postcss/autoprefixer#options
2069
+ *
2070
+ * Instead, this basically just serves as a label type to track
2071
+ * that arguments are being passed consistently.
2072
+ */
2073
+ export declare type AutoprefixerOptions = Object;
2074
+ /**
2075
+ * Output from CSS optimization functions, wrapping up optimized
2076
+ * CSS and any diagnostics produced during optimization.
2077
+ */
2059
2078
  export interface OptimizeCssOutput {
2060
2079
  output: string;
2061
2080
  diagnostics: Diagnostic[];
@@ -1089,5 +1089,5 @@ exports.setMode = e => modeResolutionChain.push(e), exports.setPlatformHelpers =
1089
1089
  }), 100));
1090
1090
  }));
1091
1091
  }, exports.stopAutoApplyChanges = stopAutoApplyChanges, exports.styles = styles,
1092
- exports.supportsConstructibleStylesheets = !1, exports.supportsListenerOptions = !0,
1092
+ exports.supportsConstructableStylesheets = !1, exports.supportsListenerOptions = !0,
1093
1093
  exports.win = win, exports.writeTask = writeTask;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal/testing",
3
- "version": "2.17.0",
3
+ "version": "2.17.2-0",
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.17.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Mock Doc (CommonJS) v2.17.2-0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  var mockDoc = (function(exports) {
5
5
  'use strict';
@@ -689,6 +689,25 @@ class MockMouseEvent extends MockEvent {
689
689
  }
690
690
  }
691
691
  }
692
+ class MockUIEvent extends MockEvent {
693
+ constructor(type, uiEventInitDic) {
694
+ super(type);
695
+ this.detail = null;
696
+ this.view = null;
697
+ if (uiEventInitDic != null) {
698
+ Object.assign(this, uiEventInitDic);
699
+ }
700
+ }
701
+ }
702
+ class MockFocusEvent extends MockUIEvent {
703
+ constructor(type, focusEventInitDic) {
704
+ super(type);
705
+ this.relatedTarget = null;
706
+ if (focusEventInitDic != null) {
707
+ Object.assign(this, focusEventInitDic);
708
+ }
709
+ }
710
+ }
692
711
  class MockEventListener {
693
712
  constructor(type, handler) {
694
713
  this.type = type;
@@ -1603,7 +1622,7 @@ class MockElement extends MockNode {
1603
1622
  return shadowRoot;
1604
1623
  }
1605
1624
  blur() {
1606
- /**/
1625
+ dispatchEvent(this, new MockFocusEvent('blur', { relatedTarget: null, bubbles: true, cancelable: true, composed: true }));
1607
1626
  }
1608
1627
  get shadowRoot() {
1609
1628
  return this.__shadowRoot || null;
@@ -1673,7 +1692,9 @@ class MockElement extends MockNode {
1673
1692
  get firstElementChild() {
1674
1693
  return this.children[0] || null;
1675
1694
  }
1676
- focus(_options) { }
1695
+ focus(_options) {
1696
+ dispatchEvent(this, new MockFocusEvent('focus', { relatedTarget: null, bubbles: true, cancelable: true, composed: true }));
1697
+ }
1677
1698
  getAttribute(attrName) {
1678
1699
  if (attrName === 'style') {
1679
1700
  if (this.__style != null && this.__style.length > 0) {
@@ -3432,6 +3453,7 @@ const WINDOW_PROPS = [
3432
3453
  'HTMLElement',
3433
3454
  'Node',
3434
3455
  'NodeList',
3456
+ 'FocusEvent',
3435
3457
  'KeyboardEvent',
3436
3458
  'MouseEvent',
3437
3459
  ];
@@ -3439,6 +3461,7 @@ const GLOBAL_CONSTRUCTORS = [
3439
3461
  ['CustomEvent', MockCustomEvent],
3440
3462
  ['Event', MockEvent],
3441
3463
  ['Headers', MockHeaders],
3464
+ ['FocusEvent', MockFocusEvent],
3442
3465
  ['KeyboardEvent', MockKeyboardEvent],
3443
3466
  ['MouseEvent', MockMouseEvent],
3444
3467
  ['Request', MockRequest],
@@ -386,6 +386,15 @@ declare class MockMouseEvent extends MockEvent {
386
386
  relatedTarget: EventTarget;
387
387
  constructor(type: string, mouseEventInitDic?: MouseEventInit);
388
388
  }
389
+ declare class MockUIEvent extends MockEvent {
390
+ detail: number | null;
391
+ view: MockWindow | null;
392
+ constructor(type: string, uiEventInitDic?: UIEventInit);
393
+ }
394
+ declare class MockFocusEvent extends MockUIEvent {
395
+ relatedTarget: EventTarget | null;
396
+ constructor(type: 'blur' | 'focus', focusEventInitDic?: FocusEventInit);
397
+ }
389
398
  declare class MockEventListener {
390
399
  type: string;
391
400
  handler: (ev?: any) => void;
@@ -833,6 +842,7 @@ declare class MockWindow {
833
842
  CustomEvent: typeof MockCustomEvent;
834
843
  Event: typeof MockEvent;
835
844
  Headers: typeof MockHeaders;
845
+ FocusEvent: typeof MockFocusEvent;
836
846
  KeyboardEvent: typeof MockKeyboardEvent;
837
847
  MouseEvent: typeof MockMouseEvent;
838
848
  constructor(html?: string | boolean);
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Mock Doc v2.17.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Mock Doc v2.17.2-0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  const CONTENT_REF_ID = 'r';
5
5
  const ORG_LOCATION_ID = 'o';
@@ -686,6 +686,25 @@ class MockMouseEvent extends MockEvent {
686
686
  }
687
687
  }
688
688
  }
689
+ class MockUIEvent extends MockEvent {
690
+ constructor(type, uiEventInitDic) {
691
+ super(type);
692
+ this.detail = null;
693
+ this.view = null;
694
+ if (uiEventInitDic != null) {
695
+ Object.assign(this, uiEventInitDic);
696
+ }
697
+ }
698
+ }
699
+ class MockFocusEvent extends MockUIEvent {
700
+ constructor(type, focusEventInitDic) {
701
+ super(type);
702
+ this.relatedTarget = null;
703
+ if (focusEventInitDic != null) {
704
+ Object.assign(this, focusEventInitDic);
705
+ }
706
+ }
707
+ }
689
708
  class MockEventListener {
690
709
  constructor(type, handler) {
691
710
  this.type = type;
@@ -1600,7 +1619,7 @@ class MockElement extends MockNode {
1600
1619
  return shadowRoot;
1601
1620
  }
1602
1621
  blur() {
1603
- /**/
1622
+ dispatchEvent(this, new MockFocusEvent('blur', { relatedTarget: null, bubbles: true, cancelable: true, composed: true }));
1604
1623
  }
1605
1624
  get shadowRoot() {
1606
1625
  return this.__shadowRoot || null;
@@ -1670,7 +1689,9 @@ class MockElement extends MockNode {
1670
1689
  get firstElementChild() {
1671
1690
  return this.children[0] || null;
1672
1691
  }
1673
- focus(_options) { }
1692
+ focus(_options) {
1693
+ dispatchEvent(this, new MockFocusEvent('focus', { relatedTarget: null, bubbles: true, cancelable: true, composed: true }));
1694
+ }
1674
1695
  getAttribute(attrName) {
1675
1696
  if (attrName === 'style') {
1676
1697
  if (this.__style != null && this.__style.length > 0) {
@@ -3429,6 +3450,7 @@ const WINDOW_PROPS = [
3429
3450
  'HTMLElement',
3430
3451
  'Node',
3431
3452
  'NodeList',
3453
+ 'FocusEvent',
3432
3454
  'KeyboardEvent',
3433
3455
  'MouseEvent',
3434
3456
  ];
@@ -3436,6 +3458,7 @@ const GLOBAL_CONSTRUCTORS = [
3436
3458
  ['CustomEvent', MockCustomEvent],
3437
3459
  ['Event', MockEvent],
3438
3460
  ['Headers', MockHeaders],
3461
+ ['FocusEvent', MockFocusEvent],
3439
3462
  ['KeyboardEvent', MockKeyboardEvent],
3440
3463
  ['MouseEvent', MockMouseEvent],
3441
3464
  ['Request', MockRequest],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/mock-doc",
3
- "version": "2.17.0",
3
+ "version": "2.17.2-0",
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.17.0",
3
+ "version": "2.17.2-0",
4
4
  "license": "MIT",
5
5
  "main": "./internal/rindo-core/index.cjs",
6
6
  "module": "./internal/rindo-core/index.js",
@@ -26,8 +26,8 @@
26
26
  "scripts": {
27
27
  "build": "node scripts --prepare && npm run tsc.prod && npm run rollup.prod.ci",
28
28
  "changelog": "conventional-changelog -p angular -o -i CHANGELOG.md -s",
29
- "clean": "rm -rf build/ cli/ compiler/ dev-server/ internal/ mock-doc/ sys/ testing/ && npm run clean-scripts",
30
- "clean-scripts": "rm -rf scripts/build",
29
+ "clean": "rimraf build cli compiler dev-server internal mock-doc sys testing && npm run clean-scripts",
30
+ "clean-scripts": "rimraf scripts/build",
31
31
  "license": "node scripts --license",
32
32
  "lint": "eslint \"src/*.ts\" \"src/**/*.ts\"",
33
33
  "prettier": "npm run prettier.base -- --write",
@@ -87,6 +87,7 @@
87
87
  "dts-bundle-generator": "~5.3.0",
88
88
  "eslint": "^8.13.0",
89
89
  "eslint-config-prettier": "^8.5.0",
90
+ "eslint-plugin-jest": "^26.5.3",
90
91
  "eslint-plugin-jsdoc": "^39.3.1",
91
92
  "execa": "4.1.0",
92
93
  "exit": "^0.1.2",
@@ -116,6 +117,7 @@
116
117
  "puppeteer": "~10.0.0",
117
118
  "rollup": "2.42.3",
118
119
  "rollup-plugin-sourcemaps": "^0.6.3",
120
+ "rimraf": "^3.0.2",
119
121
  "semver": "7.3.4",
120
122
  "sizzle": "^2.3.6",
121
123
  "terser": "5.6.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/screenshot",
3
- "version": "2.17.0",
3
+ "version": "2.17.2-0",
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.17.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Node System v2.17.2-0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  function _interopDefaultLegacy(e) {
5
5
  return e && "object" == typeof e && "default" in e ? e : {
@@ -274,7 +274,7 @@ Object.defineProperty(exports, "__esModule", {
274
274
  value: !0
275
275
  });
276
276
 
277
- const fs = require("./graceful-fs.js"), path = require("path"), require$$1 = require("util"), glob = require("./glob.js"), require$$6 = require("os"), require$$3 = require("crypto"), require$$2 = require("fs"), require$$4 = require("stream"), require$$5 = require("assert"), require$$7 = require("events"), require$$8 = require("buffer"), require$$9 = require("tty"), cp = require("child_process"), fs__default = _interopDefaultLegacy(fs), path__default = _interopDefaultLegacy(path), require$$1__default = _interopDefaultLegacy(require$$1), glob__default = _interopDefaultLegacy(glob), require$$6__default = _interopDefaultLegacy(require$$6), require$$6__namespace = _interopNamespace(require$$6), require$$3__default = _interopDefaultLegacy(require$$3), require$$2__default = _interopDefaultLegacy(require$$2), require$$4__default = _interopDefaultLegacy(require$$4), require$$5__default = _interopDefaultLegacy(require$$5), require$$7__default = _interopDefaultLegacy(require$$7), require$$8__default = _interopDefaultLegacy(require$$8), require$$9__default = _interopDefaultLegacy(require$$9), cp__namespace = _interopNamespace(cp);
277
+ const fs = require("./graceful-fs.js"), path = require("path"), require$$1 = require("util"), glob = require("./glob.js"), require$$6 = require("os"), require$$3 = require("crypto"), require$$2 = require("fs"), require$$4 = require("stream"), require$$5 = require("assert"), require$$7 = require("events"), require$$8 = require("buffer"), require$$9 = require("tty"), cp = require("child_process"), fs__default = _interopDefaultLegacy(fs), path__default = _interopDefaultLegacy(path), require$$1__default = _interopDefaultLegacy(require$$1), glob__default = _interopDefaultLegacy(glob), require$$6__default = _interopDefaultLegacy(require$$6), require$$6__namespace = _interopNamespace(require$$6), require$$3__default = _interopDefaultLegacy(require$$3), require$$2__default = _interopDefaultLegacy(require$$2), require$$4__default = _interopDefaultLegacy(require$$4), require$$5__default = _interopDefaultLegacy(require$$5), require$$7__default = _interopDefaultLegacy(require$$7), require$$8__default = _interopDefaultLegacy(require$$8), require$$9__default = _interopDefaultLegacy(require$$9), cp__namespace = _interopNamespace(cp), LOG_LEVELS = [ "debug", "info", "warn", "error" ];
278
278
 
279
279
  symbols = createCommonjsModule((function(e) {
280
280
  const t = "Hyper" === process.env.TERM_PROGRAM, r = "win32" === process.platform, n = "linux" === process.platform, i = {
@@ -607,7 +607,7 @@ const createTerminalLogger = e => {
607
607
  red: ansiColors.red,
608
608
  yellow: ansiColors.yellow
609
609
  };
610
- }, LOG_LEVELS = [ "debug", "info", "warn", "error" ], shouldLog = (e, t) => LOG_LEVELS.indexOf(t) >= LOG_LEVELS.indexOf(e), formatPrefixTimestamp = () => {
610
+ }, shouldLog = (e, t) => LOG_LEVELS.indexOf(t) >= LOG_LEVELS.indexOf(e), formatPrefixTimestamp = () => {
611
611
  const e = new Date;
612
612
  return `[${clampTwoDigits(e.getMinutes())}:${clampTwoDigits(e.getSeconds())}.${Math.floor(e.getMilliseconds() / 1e3 * 10)}]`;
613
613
  }, clampTwoDigits = e => ("0" + e.toString()).slice(-2), wordWrap = (e, t) => {
@@ -5632,7 +5632,7 @@ exports.createNodeLogger = e => {
5632
5632
  getColumns: () => {
5633
5633
  var t, r;
5634
5634
  const n = null !== (r = null === (t = null == e ? void 0 : e.stdout) || void 0 === t ? void 0 : t.columns) && void 0 !== r ? r : 80;
5635
- return Math.max(Math.min(120, n), 60);
5635
+ return Math.max(Math.min(n, 120), 60);
5636
5636
  },
5637
5637
  memoryUsage: () => e.memoryUsage().rss,
5638
5638
  relativePath: (e, t) => path__default.default.relative(e, t),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/sys/node",
3
- "version": "2.17.0",
3
+ "version": "2.17.2-0",
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.17.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Node System Worker v2.17.2-0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  function _interopNamespace(e) {
5
5
  if (e && e.__esModule) return e;
@@ -3,7 +3,7 @@ export { createTesting } from './testing';
3
3
  export { createTestRunner } from './jest/jest-runner';
4
4
  export { jestPreprocessor } from './jest/jest-preprocessor';
5
5
  export { jestSetupTestFramework } from './jest/jest-setup-test-framework';
6
- export { mockBuildCtx, mockConfig, mockCompilerCtx, mockDocument, mockLogger, mockCompilerSystem, mockWindow, mockModule, } from './mocks';
6
+ export { mockBuildCtx, mockConfig, mockCompilerCtx, mockDocument, mockLoadConfigInit, mockValidatedConfig, mockLogger, mockCompilerSystem, mockWindow, mockModule, } from './mocks';
7
7
  export { MockHeaders, MockRequest, MockRequestInit, MockRequestInfo, MockResponse, MockResponseInit, mockFetch, } from './mock-fetch';
8
8
  export { newSpecPage } from './spec-page';
9
9
  export { shuffleArray } from './testing-utils';
package/testing/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Testing v2.17.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Testing v2.17.2-0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  function _lazyRequire(e) {
5
5
  return new Proxy({}, {
@@ -460,7 +460,7 @@ function mockConfig(e) {
460
460
  enableCache: !1,
461
461
  buildAppCore: !1,
462
462
  buildDist: !0,
463
- flags: {},
463
+ flags: createConfigFlags(),
464
464
  bundles: null,
465
465
  outputTargets: null,
466
466
  buildEs5: !1,
@@ -817,6 +817,10 @@ function mockCompilerCtx(e) {
817
817
  }), t;
818
818
  }
819
819
 
820
+ function mockLogger() {
821
+ return new TestingLogger;
822
+ }
823
+
820
824
  function findRootComponent(e, t) {
821
825
  if (null != t) {
822
826
  const r = t.children, s = r.length;
@@ -2162,15 +2166,14 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
2162
2166
  let o = s.shift();
2163
2167
  o.startsWith("@") && (o += "/" + s.shift());
2164
2168
  const i = s.join("/");
2165
- if ("@rindo/core" === o) {
2166
- return ((e, t) => {
2167
- let r = (t = normalizePath(t)).split("/");
2168
- const s = r.lastIndexOf("node_modules");
2169
- return s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
2170
- t = r.join("/")), new URL("./" + t, (e => new URL("../", e).href)(e)).href;
2171
- })(e.getCompilerExecutingPath(), i);
2172
- }
2173
- return e.getRemoteModuleUrl({
2169
+ return "@rindo/core" === o ? ((e, t) => {
2170
+ let r = (t = normalizePath(t)).split("/");
2171
+ const s = r.lastIndexOf("node_modules");
2172
+ s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
2173
+ t = r.join("/"));
2174
+ const n = new URL("../", e).href;
2175
+ return new URL("./" + t, n).href;
2176
+ })(e.getCompilerExecutingPath(), i) : e.getRemoteModuleUrl({
2174
2177
  moduleId: o,
2175
2178
  version: t.get(o),
2176
2179
  path: i
@@ -2182,7 +2185,7 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
2182
2185
  const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
2183
2186
  return !("node_modules" !== s || !isCommonDirModuleFile(n));
2184
2187
  })(n) || known404Urls.has(s) || (e => knownUrlSkips.some((t => e.endsWith(t))))(s))) try {
2185
- const o = await ((e, t, r) => (console.trace(t), e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r)))(e, s);
2188
+ const o = await ((e, t, r) => e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r))(e, s);
2186
2189
  if (o) {
2187
2190
  if (o.ok) {
2188
2191
  const i = await o.clone().text();
@@ -3041,7 +3044,7 @@ const createSystem = e => {
3041
3044
  u("/");
3042
3045
  const D = {
3043
3046
  name: "in-memory",
3044
- version: "2.17.0",
3047
+ version: "2.17.2-0",
3045
3048
  events: i,
3046
3049
  access: async e => c(e),
3047
3050
  accessSync: c,
@@ -3413,6 +3416,14 @@ class TestingLogger {
3413
3416
  printDiagnostics(e) {}
3414
3417
  }
3415
3418
 
3419
+ const createConfigFlags = (e = {}) => ({
3420
+ task: null,
3421
+ args: [],
3422
+ knownArgs: [],
3423
+ unknownArgs: [],
3424
+ ...e
3425
+ });
3426
+
3416
3427
  class EventSpy {
3417
3428
  constructor(e) {
3418
3429
  this.eventName = e, this.events = [], this.cursor = 0, this.queuedHandler = [];
@@ -3798,8 +3809,8 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3798
3809
  }, exports.createTesting = async e => {
3799
3810
  e = function t(e) {
3800
3811
  return e.buildEs5 = !1, e.devMode = !0, e.minifyCss = !1, e.minifyJs = !1, e.hashFileNames = !1,
3801
- e.validateTypes = !1, e._isTesting = !0, e.buildDist = !0, e.flags = e.flags || {},
3802
- e.flags.serve = !1, e.flags.open = !1, e.outputTargets.forEach((e => {
3812
+ e.validateTypes = !1, e._isTesting = !0, e.buildDist = !0, e.flags.serve = !1, e.flags.open = !1,
3813
+ e.outputTargets.forEach((e => {
3803
3814
  "www" === e.type && (e.serviceWorker = null);
3804
3815
  })), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
3805
3816
  }(e);
@@ -3937,9 +3948,14 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3937
3948
  return createTestingSystem();
3938
3949
  }, exports.mockConfig = mockConfig, exports.mockDocument = function mockDocument(e = null) {
3939
3950
  return new index_cjs.MockWindow(e).document;
3940
- }, exports.mockFetch = mockFetch, exports.mockLogger = function mockLogger() {
3941
- return new TestingLogger;
3942
- }, exports.mockModule = (e = {}) => ({
3951
+ }, exports.mockFetch = mockFetch, exports.mockLoadConfigInit = e => ({
3952
+ config: {},
3953
+ configPath: void 0,
3954
+ initTsConfig: !0,
3955
+ logger: void 0,
3956
+ sys: void 0,
3957
+ ...e
3958
+ }), exports.mockLogger = mockLogger, exports.mockModule = (e = {}) => ({
3943
3959
  cmps: [],
3944
3960
  coreRuntimeApis: [],
3945
3961
  collectionName: "",
@@ -3973,7 +3989,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3973
3989
  hasVdomText: !1,
3974
3990
  hasVdomXlink: !1,
3975
3991
  ...e
3976
- }), exports.mockWindow = function mockWindow(e = null) {
3992
+ }), exports.mockValidatedConfig = function mockValidatedConfig(e) {
3993
+ return {
3994
+ ...mockConfig(e),
3995
+ flags: createConfigFlags(),
3996
+ logger: mockLogger()
3997
+ };
3998
+ }, exports.mockWindow = function mockWindow(e = null) {
3977
3999
  return new index_cjs.MockWindow(e);
3978
4000
  }, exports.newE2EPage = async function newE2EPage(e = {}) {
3979
4001
  if (!global.__NEW_TEST_PAGE__) throw new Error("newE2EPage() is only available from E2E tests, and ran with the --e2e cmd line flag.");
@@ -4076,26 +4098,28 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
4076
4098
  };
4077
4099
  const o = !0 === e.failOnConsoleError, i = !0 === e.failOnNetworkError;
4078
4100
  t.on("console", (e => {
4079
- "error" === e.type() && (r.push({
4101
+ if ("error" === e.type() && (r.push({
4080
4102
  type: "error",
4081
4103
  message: e.text(),
4082
4104
  location: e.location().url
4083
- }), o && fail(new Error(serializeConsoleMessage(e)))), function t(e) {
4105
+ }), o)) throw new Error(serializeConsoleMessage(e));
4106
+ !function t(e) {
4084
4107
  const t = serializeConsoleMessage(e), r = e.type(), s = "warning" === r ? "warn" : r;
4085
4108
  "debug" !== s && ("function" == typeof console[s] ? console[s](t) : console.log(r, t));
4086
4109
  }(e);
4087
4110
  })), t.on("pageerror", (e => {
4088
- r.push({
4111
+ throw r.push({
4089
4112
  type: "pageerror",
4090
4113
  message: e.message,
4091
4114
  location: e.stack
4092
- }), fail(e);
4115
+ }), e;
4093
4116
  })), t.on("requestfailed", (e => {
4094
- r.push({
4117
+ if (r.push({
4095
4118
  type: "requestfailed",
4096
4119
  message: e.failure().errorText,
4097
4120
  location: e.url()
4098
- }), i ? fail(new Error(e.failure().errorText)) : console.error("requestfailed", e.url());
4121
+ }), i) throw new Error(e.failure().errorText);
4122
+ console.error("requestfailed", e.url());
4099
4123
  })), "string" == typeof e.html ? await e2eSetContent(t, e.html, {
4100
4124
  waitUntil: e.waitUntil
4101
4125
  }) : "string" == typeof e.url ? await e2eGoTo(t, e.url, {
@@ -5,7 +5,7 @@ import type { Config } from '@jest/types';
5
5
  * @param config the Rindo config to use while generating Jest CLI arguments
6
6
  * @returns the arguments to pass to the Jest CLI, wrapped in an object
7
7
  */
8
- export declare function buildJestArgv(config: d.Config): Config.Argv;
8
+ export declare function buildJestArgv(config: d.ValidatedConfig): Config.Argv;
9
9
  /**
10
10
  * Generate a Jest run configuration to be used as a part of the `argv` passed to the Jest CLI when it is invoked
11
11
  * programmatically
@@ -1,9 +1,10 @@
1
1
  import type * as d from '@rindo/core/internal';
2
- export declare function runJest(config: d.Config, env: d.E2EProcessEnv): Promise<boolean>;
2
+ import type { ConfigFlags } from '../../cli/config-flags';
3
+ export declare function runJest(config: d.ValidatedConfig, env: d.E2EProcessEnv): Promise<boolean>;
3
4
  /**
4
5
  * Creates a Rindo test runner
5
6
  * @returns the test runner
6
7
  */
7
8
  export declare function createTestRunner(): any;
8
9
  export declare function includeTestFile(testPath: string, env: d.E2EProcessEnv): boolean;
9
- export declare function getEmulateConfigs(testing: d.TestingConfig, flags: d.ConfigFlags): d.EmulateConfig[];
10
+ export declare function getEmulateConfigs(testing: d.TestingConfig, flags: ConfigFlags): d.EmulateConfig[];
@@ -1,2 +1,2 @@
1
1
  import type * as d from '@rindo/core/internal';
2
- export declare function runJestScreenshot(config: d.Config, env: d.E2EProcessEnv): Promise<boolean>;
2
+ export declare function runJestScreenshot(config: d.ValidatedConfig, env: d.E2EProcessEnv): Promise<boolean>;