@rindo/core 3.1.0 → 3.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.
@@ -272,8 +272,17 @@ export interface ConfigExtras {
272
272
  * loading components when using a bundler such as Wite or Parcel. Setting this flag to `true` will change how Rindo
273
273
  * lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase
274
274
  * the size of the compiled output. Defaults to `false`.
275
+ * @deprecated This flag has been deprecated in favor of `enableImportInjection`, which provides the same
276
+ * functionality. `experimentalImportInjection` will be removed in a future major version of Rindo.
275
277
  */
276
278
  experimentalImportInjection?: boolean;
279
+ /**
280
+ * Projects that use a Rindo library built using the `dist` output target may have trouble lazily
281
+ * loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Rindo
282
+ * lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase
283
+ * the size of the compiled output. Defaults to `false`.
284
+ */
285
+ enableImportInjection?: boolean;
277
286
  /**
278
287
  * Dispatches component lifecycle events. Mainly used for testing. Defaults to `false`.
279
288
  */
@@ -1082,7 +1091,23 @@ export interface CompilerSystem {
1082
1091
  statSync(p: string): CompilerFsStats;
1083
1092
  tmpDirSync(): string;
1084
1093
  watchDirectory?(p: string, callback: CompilerFileWatcherCallback, recursive?: boolean): CompilerFileWatcher;
1085
- watchFile?(p: string, callback: CompilerFileWatcherCallback): CompilerFileWatcher;
1094
+ /**
1095
+ * A `watchFile` implementation in order to hook into the rest of the {@link CompilerSystem} implementation that is
1096
+ * used when running Rindo's compiler in "watch mode".
1097
+ *
1098
+ * It is analogous to TypeScript's `watchFile` implementation.
1099
+ *
1100
+ * Note, this function may be called for full builds of Rindo projects by the TypeScript compiler. It should not
1101
+ * assume that it will only be called in watch mode.
1102
+ *
1103
+ * This function should not perform any file watcher registration itself. Each `path` provided to it when called
1104
+ * should already have been registered as a file to watch.
1105
+ *
1106
+ * @param path the path to the file that is being watched
1107
+ * @param callback a callback to invoke when a file that is being watched has changed in some way
1108
+ * @returns an object with a method for unhooking the file watcher from the system
1109
+ */
1110
+ watchFile?(path: string, callback: CompilerFileWatcherCallback): CompilerFileWatcher;
1086
1111
  /**
1087
1112
  * How many milliseconds to wait after a change before calling watch callbacks.
1088
1113
  */
@@ -1259,7 +1284,16 @@ export interface CompilerBuildStart {
1259
1284
  buildId: number;
1260
1285
  timestamp: string;
1261
1286
  }
1287
+ /**
1288
+ * A type describing a function to call when an event is emitted by a file watcher
1289
+ * @param fileName the path of the file tied to event
1290
+ * @param eventKind a variant describing the type of event that was emitter (added, edited, etc.)
1291
+ */
1262
1292
  export type CompilerFileWatcherCallback = (fileName: string, eventKind: CompilerFileWatcherEvent) => void;
1293
+ /**
1294
+ * A type describing the different types of events that Rindo expects may happen when a file being watched is altered
1295
+ * in some way
1296
+ */
1263
1297
  export type CompilerFileWatcherEvent = CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventFileUpdate | CompilerEventDirAdd | CompilerEventDirDelete;
1264
1298
  export type CompilerEventName = CompilerEventFsChange | CompilerEventFileUpdate | CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventDirAdd | CompilerEventDirDelete | CompilerEventBuildStart | CompilerEventBuildFinish | CompilerEventBuildNoChange | CompilerEventBuildLog;
1265
1299
  export type CompilerEventFsChange = 'fsChange';
@@ -1862,6 +1896,12 @@ export interface OutputTargetDocsReadme extends OutputTargetBase {
1862
1896
  export interface OutputTargetDocsJson extends OutputTargetBase {
1863
1897
  type: 'docs-json';
1864
1898
  file: string;
1899
+ /**
1900
+ * Set an optional file path where Rindo should write a `d.ts` file to disk
1901
+ * at build-time containing type declarations for {@link JsonDocs} and related
1902
+ * interfaces. If this is omitted or set to `null` Rindo will not write such
1903
+ * a file.
1904
+ */
1865
1905
  typesFile?: string | null;
1866
1906
  strict?: boolean;
1867
1907
  }
@@ -2180,9 +2220,17 @@ export interface LazyRequire {
2180
2220
  require(fromDir: string, moduleId: string): any;
2181
2221
  getModulePath(fromDir: string, moduleId: string): string;
2182
2222
  }
2223
+ /**
2224
+ * @deprecated This interface is no longer used by Rindo
2225
+ * TODO: Remove this interface
2226
+ */
2183
2227
  export interface FsWatcherItem {
2184
2228
  close(): void;
2185
2229
  }
2230
+ /**
2231
+ * @deprecated This interface is no longer used by Rindo
2232
+ * TODO: Remove this interface
2233
+ */
2186
2234
  export interface MakeDirectoryOptions {
2187
2235
  /**
2188
2236
  * Indicates whether parent folders should be created.
@@ -2195,6 +2243,10 @@ export interface MakeDirectoryOptions {
2195
2243
  */
2196
2244
  mode?: number;
2197
2245
  }
2246
+ /**
2247
+ * @deprecated This interface is no longer used by Rindo
2248
+ * TODO: Remove this interface
2249
+ */
2198
2250
  export interface FsStats {
2199
2251
  isFile(): boolean;
2200
2252
  isDirectory(): boolean;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal/testing",
3
- "version": "3.1.0",
3
+ "version": "3.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) v3.1.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Mock Doc (CommonJS) v3.2.0 | 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 v3.1.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Mock Doc v3.2.0 | 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": "3.1.0",
3
+ "version": "3.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": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "license": "MIT",
5
5
  "main": "./internal/rindo-core/index.cjs",
6
6
  "module": "./internal/rindo-core/index.js",
@@ -91,7 +91,7 @@
91
91
  "jest-cli": "^27.4.5",
92
92
  "jest-environment-node": "^27.4.4",
93
93
  "listr": "^0.14.3",
94
- "magic-string": "^0.29.0",
94
+ "magic-string": "^0.30.0",
95
95
  "merge-source-map": "^1.1.0",
96
96
  "mime-db": "^1.46.0",
97
97
  "minimatch": "5.1.2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/screenshot",
3
- "version": "3.1.0",
3
+ "version": "3.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 v3.1.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Node System v3.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 : {
@@ -1282,7 +1282,7 @@ lockfile = createCommonjsModule((function(e) {
1282
1282
  }
1283
1283
  })), function e(t, r) {
1284
1284
  return R.apply(this, arguments);
1285
- }), z = t.walk = (N = (0, (d || n()).default)((function*(e, t, r = new Set) {
1285
+ }), W = 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 z(f, u, r)));
1304
+ }), h.isDirectory() && (l = l.concat(yield W(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 W = (P = (0, (d || n()).default)((function*(e) {
1316
+ let z = (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 W(e)) || (y || o()).default.EOL;
1327
+ const r = (yield z(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);
@@ -5992,7 +5992,10 @@ exports.createNodeLogger = e => {
5992
5992
  e = normalizePath(e), n === t.FileWatcherEventKind.Created ? (r(e, "fileAdd"), f.events.emit("fileAdd", e)) : n === t.FileWatcherEventKind.Changed ? (r(e, "fileUpdate"),
5993
5993
  f.events.emit("fileUpdate", e)) : n === t.FileWatcherEventKind.Deleted && (r(e, "fileDelete"),
5994
5994
  f.events.emit("fileDelete", e));
5995
- })), o = () => {
5995
+ }), 250, {
5996
+ watchFile: t.WatchFileKind.FixedPollingInterval,
5997
+ fallbackPolling: t.PollingWatchKind.FixedInterval
5998
+ }), o = () => {
5996
5999
  i.close();
5997
6000
  };
5998
6001
  return f.addDestroy(o), {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/sys/node",
3
- "version": "3.1.0",
3
+ "version": "3.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 v3.1.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Node System Worker v3.2.0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  function _interopNamespace(e) {
5
5
  if (e && e.__esModule) return e;
package/testing/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Testing v3.1.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Testing v3.2.0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  function _lazyRequire(e) {
5
5
  return new Proxy({}, {
@@ -3154,7 +3154,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
3154
3154
  d("/");
3155
3155
  const D = {
3156
3156
  name: "in-memory",
3157
- version: "3.1.0",
3157
+ version: "3.2.0",
3158
3158
  events: a,
3159
3159
  access: async e => u(e),
3160
3160
  accessSync: u,
@@ -31,7 +31,7 @@ module.exports = {
31
31
  testPathIgnorePatterns: ['/.cache', '/.rindo', '/.vscode', '/dist', '/node_modules', '/www'],
32
32
  testRegex: '(/__tests__/.*|\\.?(test|spec))\\.' + moduleExtensionRegexp + '$',
33
33
  transform: {
34
- '^.+\\.(ts|tsx|jsx|css)$': path.join(testingDir, 'jest-preprocessor.js'),
34
+ '^.+\\.(ts|tsx|jsx|css|mjs)$': path.join(testingDir, 'jest-preprocessor.js'),
35
35
  },
36
36
  watchPathIgnorePatterns: ['^.+\\.d\\.ts$'],
37
37
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/testing",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Rindo testing suite.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",