@rindo/core 2.17.1 → 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.
@@ -94,9 +94,17 @@ declare type LogLevelFlags = ObjectFromKeys<typeof LOG_LEVEL_CLI_ARGS, LogLevel>
94
94
  * on actual flags passed by the user.
95
95
  */
96
96
  export interface ConfigFlags extends BooleanConfigFlags, StringConfigFlags, NumberConfigFlags, StringNumberConfigFlags, LogLevelFlags {
97
- task?: TaskCommand | null;
98
- args?: string[];
99
- knownArgs?: string[];
100
- unknownArgs?: string[];
97
+ task: TaskCommand | null;
98
+ args: string[];
99
+ knownArgs: string[];
100
+ unknownArgs: string[];
101
101
  }
102
+ /**
103
+ * Helper function for initializing a `ConfigFlags` object. Provide any overrides
104
+ * for default values and off you go!
105
+ *
106
+ * @param init an object with any overrides for default values
107
+ * @returns a complete CLI flag object
108
+ */
109
+ export declare const createConfigFlags: (init?: Partial<ConfigFlags>) => ConfigFlags;
102
110
  export {};
package/cli/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo CLI (CommonJS) v2.17.1 | MIT Licensed | https://rindojs.web.app
2
+ Rindo CLI (CommonJS) v2.17.2-0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  'use strict';
5
5
 
@@ -521,6 +521,23 @@ const CLI_ARG_ALIASES = {
521
521
  help: 'h',
522
522
  port: 'p',
523
523
  version: 'v',
524
+ };
525
+ /**
526
+ * Helper function for initializing a `ConfigFlags` object. Provide any overrides
527
+ * for default values and off you go!
528
+ *
529
+ * @param init an object with any overrides for default values
530
+ * @returns a complete CLI flag object
531
+ */
532
+ const createConfigFlags = (init = {}) => {
533
+ const flags = {
534
+ task: null,
535
+ args: [],
536
+ knownArgs: [],
537
+ unknownArgs: [],
538
+ ...init,
539
+ };
540
+ return flags;
524
541
  };
525
542
 
526
543
  /**
@@ -531,12 +548,7 @@ const CLI_ARG_ALIASES = {
531
548
  * @returns a structured ConfigFlags object
532
549
  */
533
550
  const parseFlags = (args, sys) => {
534
- const flags = {
535
- task: null,
536
- args: [],
537
- knownArgs: [],
538
- unknownArgs: [],
539
- };
551
+ const flags = createConfigFlags();
540
552
  // cmd line has more priority over npm scripts cmd
541
553
  flags.args = Array.isArray(args) ? args.slice() : [];
542
554
  if (flags.args.length > 0 && flags.args[0] && !flags.args[0].startsWith('-')) {
@@ -808,7 +820,7 @@ const getNpmConfigEnvArgs = (sys) => {
808
820
  const dependencies = [
809
821
  {
810
822
  name: "@rindo/core",
811
- version: "2.17.1",
823
+ version: "2.17.2-0",
812
824
  main: "compiler/rindo.js",
813
825
  resources: [
814
826
  "package.json",
@@ -1142,6 +1154,7 @@ const isInteractive = (sys, flags, object) => {
1142
1154
  return terminalInfo.tty && !terminalInfo.ci;
1143
1155
  };
1144
1156
  const UUID_REGEX = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i);
1157
+ // Plucked from https://github.com/navify/jigra/blob/HEAD/cli/src/util/uuid.ts
1145
1158
  function uuidv4() {
1146
1159
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
1147
1160
  const r = (Math.random() * 16) | 0;
@@ -2161,7 +2174,7 @@ const run = async (init) => {
2161
2174
  sys.applyGlobalPatch(sys.getCurrentDirectory());
2162
2175
  }
2163
2176
  if (task === 'help' || flags.help) {
2164
- await taskHelp({ task: 'help', args }, logger, sys);
2177
+ await taskHelp(createConfigFlags({ task: 'help', args }), logger, sys);
2165
2178
  return;
2166
2179
  }
2167
2180
  startupLog(logger, task);
@@ -2187,7 +2200,7 @@ const run = async (init) => {
2187
2200
  startupLogVersion(logger, task, coreCompiler);
2188
2201
  loadedCompilerLog(sys, logger, flags, coreCompiler);
2189
2202
  if (task === 'info') {
2190
- await telemetryAction(sys, { flags: { task: 'info' }, logger }, coreCompiler, async () => {
2203
+ await telemetryAction(sys, { flags: createConfigFlags({ task: 'info' }), logger }, coreCompiler, async () => {
2191
2204
  await taskInfo(coreCompiler, sys, logger);
2192
2205
  });
2193
2206
  return;
@@ -2225,7 +2238,7 @@ const run = async (init) => {
2225
2238
  const runTask = async (coreCompiler, config, task, sys) => {
2226
2239
  var _a, _b;
2227
2240
  const logger = (_a = config.logger) !== null && _a !== void 0 ? _a : createLogger();
2228
- const strictConfig = { ...config, flags: (_b = { ...config.flags }) !== null && _b !== void 0 ? _b : { task }, logger };
2241
+ const strictConfig = { ...config, flags: createConfigFlags((_b = config.flags) !== null && _b !== void 0 ? _b : { task }), logger };
2229
2242
  strictConfig.outputTargets = strictConfig.outputTargets || [];
2230
2243
  switch (task) {
2231
2244
  case 'build':
package/cli/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo CLI v2.17.1 | MIT Licensed | https://rindojs.web.app
2
+ Rindo CLI v2.17.2-0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  /**
5
5
  * This sets the log level hierarchy for our terminal logger, ranging from
@@ -497,6 +497,23 @@ const CLI_ARG_ALIASES = {
497
497
  help: 'h',
498
498
  port: 'p',
499
499
  version: 'v',
500
+ };
501
+ /**
502
+ * Helper function for initializing a `ConfigFlags` object. Provide any overrides
503
+ * for default values and off you go!
504
+ *
505
+ * @param init an object with any overrides for default values
506
+ * @returns a complete CLI flag object
507
+ */
508
+ const createConfigFlags = (init = {}) => {
509
+ const flags = {
510
+ task: null,
511
+ args: [],
512
+ knownArgs: [],
513
+ unknownArgs: [],
514
+ ...init,
515
+ };
516
+ return flags;
500
517
  };
501
518
 
502
519
  /**
@@ -507,12 +524,7 @@ const CLI_ARG_ALIASES = {
507
524
  * @returns a structured ConfigFlags object
508
525
  */
509
526
  const parseFlags = (args, sys) => {
510
- const flags = {
511
- task: null,
512
- args: [],
513
- knownArgs: [],
514
- unknownArgs: [],
515
- };
527
+ const flags = createConfigFlags();
516
528
  // cmd line has more priority over npm scripts cmd
517
529
  flags.args = Array.isArray(args) ? args.slice() : [];
518
530
  if (flags.args.length > 0 && flags.args[0] && !flags.args[0].startsWith('-')) {
@@ -784,7 +796,7 @@ const getNpmConfigEnvArgs = (sys) => {
784
796
  const dependencies = [
785
797
  {
786
798
  name: "@rindo/core",
787
- version: "2.17.1",
799
+ version: "2.17.2-0",
788
800
  main: "compiler/rindo.js",
789
801
  resources: [
790
802
  "package.json",
@@ -1118,6 +1130,7 @@ const isInteractive = (sys, flags, object) => {
1118
1130
  return terminalInfo.tty && !terminalInfo.ci;
1119
1131
  };
1120
1132
  const UUID_REGEX = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i);
1133
+ // Plucked from https://github.com/navify/jigra/blob/HEAD/cli/src/util/uuid.ts
1121
1134
  function uuidv4() {
1122
1135
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
1123
1136
  const r = (Math.random() * 16) | 0;
@@ -2137,7 +2150,7 @@ const run = async (init) => {
2137
2150
  sys.applyGlobalPatch(sys.getCurrentDirectory());
2138
2151
  }
2139
2152
  if (task === 'help' || flags.help) {
2140
- await taskHelp({ task: 'help', args }, logger, sys);
2153
+ await taskHelp(createConfigFlags({ task: 'help', args }), logger, sys);
2141
2154
  return;
2142
2155
  }
2143
2156
  startupLog(logger, task);
@@ -2163,7 +2176,7 @@ const run = async (init) => {
2163
2176
  startupLogVersion(logger, task, coreCompiler);
2164
2177
  loadedCompilerLog(sys, logger, flags, coreCompiler);
2165
2178
  if (task === 'info') {
2166
- await telemetryAction(sys, { flags: { task: 'info' }, logger }, coreCompiler, async () => {
2179
+ await telemetryAction(sys, { flags: createConfigFlags({ task: 'info' }), logger }, coreCompiler, async () => {
2167
2180
  await taskInfo(coreCompiler, sys, logger);
2168
2181
  });
2169
2182
  return;
@@ -2201,7 +2214,7 @@ const run = async (init) => {
2201
2214
  const runTask = async (coreCompiler, config, task, sys) => {
2202
2215
  var _a, _b;
2203
2216
  const logger = (_a = config.logger) !== null && _a !== void 0 ? _a : createLogger();
2204
- const strictConfig = { ...config, flags: (_b = { ...config.flags }) !== null && _b !== void 0 ? _b : { task }, logger };
2217
+ const strictConfig = { ...config, flags: createConfigFlags((_b = config.flags) !== null && _b !== void 0 ? _b : { task }), logger };
2205
2218
  strictConfig.outputTargets = strictConfig.outputTargets || [];
2206
2219
  switch (task) {
2207
2220
  case 'build':
package/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/cli",
3
- "version": "2.17.1",
3
+ "version": "2.17.2-0",
4
4
  "description": "Rindo CLI.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/compiler",
3
- "version": "2.17.1",
3
+ "version": "2.17.2-0",
4
4
  "description": "Rindo Compiler.",
5
5
  "main": "./rindo.js",
6
6
  "types": "./rindo.d.ts",
package/compiler/rindo.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Compiler v2.17.1 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Compiler v2.17.2-0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  (function(exports) {
5
5
  'use strict';
@@ -4575,7 +4575,7 @@ const createCustomResolverAsync = (sys, inMemoryFs, exts) => {
4575
4575
  };
4576
4576
  };
4577
4577
 
4578
- const buildId = '20230111074933';
4578
+ const buildId = '20230111105534';
4579
4579
  const minfyJsId = 'terser5.6.1_7';
4580
4580
  const optimizeCssId = 'autoprefixer10.2.5_postcss8.4.16_7';
4581
4581
  const parse5Version = '6.0.1';
@@ -4583,8 +4583,8 @@ const rollupVersion = '2.42.3';
4583
4583
  const sizzleVersion = '2.42.3';
4584
4584
  const terserVersion = '5.6.1';
4585
4585
  const typescriptVersion = '4.5.4';
4586
- const vermoji = '🍏';
4587
- const version$3 = '2.17.1';
4586
+ const vermoji = '📬';
4587
+ const version$3 = '2.17.2-0';
4588
4588
  const versions = {
4589
4589
  rindo: version$3,
4590
4590
  parse5: parse5Version,
@@ -15460,6 +15460,25 @@ class MockMouseEvent extends MockEvent {
15460
15460
  }
15461
15461
  }
15462
15462
  }
15463
+ class MockUIEvent extends MockEvent {
15464
+ constructor(type, uiEventInitDic) {
15465
+ super(type);
15466
+ this.detail = null;
15467
+ this.view = null;
15468
+ if (uiEventInitDic != null) {
15469
+ Object.assign(this, uiEventInitDic);
15470
+ }
15471
+ }
15472
+ }
15473
+ class MockFocusEvent extends MockUIEvent {
15474
+ constructor(type, focusEventInitDic) {
15475
+ super(type);
15476
+ this.relatedTarget = null;
15477
+ if (focusEventInitDic != null) {
15478
+ Object.assign(this, focusEventInitDic);
15479
+ }
15480
+ }
15481
+ }
15463
15482
  class MockEventListener {
15464
15483
  constructor(type, handler) {
15465
15484
  this.type = type;
@@ -16374,7 +16393,7 @@ class MockElement extends MockNode {
16374
16393
  return shadowRoot;
16375
16394
  }
16376
16395
  blur() {
16377
- /**/
16396
+ dispatchEvent(this, new MockFocusEvent('blur', { relatedTarget: null, bubbles: true, cancelable: true, composed: true }));
16378
16397
  }
16379
16398
  get shadowRoot() {
16380
16399
  return this.__shadowRoot || null;
@@ -16444,7 +16463,9 @@ class MockElement extends MockNode {
16444
16463
  get firstElementChild() {
16445
16464
  return this.children[0] || null;
16446
16465
  }
16447
- focus(_options) { }
16466
+ focus(_options) {
16467
+ dispatchEvent(this, new MockFocusEvent('focus', { relatedTarget: null, bubbles: true, cancelable: true, composed: true }));
16468
+ }
16448
16469
  getAttribute(attrName) {
16449
16470
  if (attrName === 'style') {
16450
16471
  if (this.__style != null && this.__style.length > 0) {
@@ -18094,6 +18115,7 @@ const GLOBAL_CONSTRUCTORS = [
18094
18115
  ['CustomEvent', MockCustomEvent],
18095
18116
  ['Event', MockEvent],
18096
18117
  ['Headers', MockHeaders],
18118
+ ['FocusEvent', MockFocusEvent],
18097
18119
  ['KeyboardEvent', MockKeyboardEvent],
18098
18120
  ['MouseEvent', MockMouseEvent],
18099
18121
  ['Request', MockRequest],
@@ -56655,7 +56677,7 @@ const addCustomElementInputs = (buildCtx, bundleOpts) => {
56655
56677
  exp.push(`import { ${importName} as ${importAs}, defineCustomElement as cmpDefCustomEle } from '${cmp.sourceFilePath}';`);
56656
56678
  exp.push(`export const ${exportName} = ${importAs};`);
56657
56679
  exp.push(`export const defineCustomElement = cmpDefCustomEle;`);
56658
- // Here we push an export (with a rename for `defineCustomElement` for
56680
+ // Here we push an export (with a rename for `defineCustomElement`) for
56659
56681
  // this component onto our array which references the `coreKey` (prefixed
56660
56682
  // with `\0`). We have to do this so that our import is referencing the
56661
56683
  // correct virtual module, if we instead referenced, for instance,
@@ -60707,7 +60729,7 @@ const generateCustomElementsTypesOutput = async (config, compilerCtx, buildCtx,
60707
60729
  // the path where we're going to write the typedef for the whole dist-custom-elements output
60708
60730
  const customElementsDtsPath = join(outputTarget.dir, 'index.d.ts');
60709
60731
  // the directory where types for the individual components are written
60710
- const componentsTypeDirectoryPath = relative$1(outputTarget.dir, join(typesDir, 'components'));
60732
+ const componentsTypeDirectoryRelPath = relative$1(outputTarget.dir, typesDir);
60711
60733
  const components = buildCtx.components.filter((m) => !m.isCollectionDependency);
60712
60734
  const code = [
60713
60735
  `/* ${config.namespace} custom elements */`,
@@ -60716,7 +60738,14 @@ const generateCustomElementsTypesOutput = async (config, compilerCtx, buildCtx,
60716
60738
  const importName = component.componentClassName;
60717
60739
  // typedefs for individual components can be found under paths like
60718
60740
  // $TYPES_DIR/components/my-component/my-component.d.ts
60719
- const componentDTSPath = join(componentsTypeDirectoryPath, component.tagName, component.tagName);
60741
+ //
60742
+ // To construct this path we:
60743
+ //
60744
+ // - get the relative path to the component's source file from the source directory
60745
+ // - join that relative path to the relative path from the `index.d.ts` file to the
60746
+ // directory where typedefs are saved
60747
+ const componentSourceRelPath = relative$1(config.srcDir, component.sourceFilePath).replace('.tsx', '');
60748
+ const componentDTSPath = join(componentsTypeDirectoryRelPath, componentSourceRelPath);
60720
60749
  return `export { ${importName} as ${exportName} } from '${componentDTSPath}';`;
60721
60750
  }),
60722
60751
  ``,
@@ -64917,11 +64946,31 @@ const updateCompilerCtxCache = (config, compilerCtx, path, kind) => {
64917
64946
  }
64918
64947
  };
64919
64948
 
64949
+ /**
64950
+ * All the Boolean options supported by the Rindo CLI
64951
+ */
64952
+ /**
64953
+ * Helper function for initializing a `ConfigFlags` object. Provide any overrides
64954
+ * for default values and off you go!
64955
+ *
64956
+ * @param init an object with any overrides for default values
64957
+ * @returns a complete CLI flag object
64958
+ */
64959
+ const createConfigFlags = (init = {}) => {
64960
+ const flags = {
64961
+ task: null,
64962
+ args: [],
64963
+ knownArgs: [],
64964
+ unknownArgs: [],
64965
+ ...init,
64966
+ };
64967
+ return flags;
64968
+ };
64969
+
64920
64970
  const getConfig = (userConfig) => {
64921
64971
  var _a, _b;
64922
- const flags = (_a = userConfig.flags) !== null && _a !== void 0 ? _a : {};
64923
- const logger = (_b = userConfig.logger) !== null && _b !== void 0 ? _b : createLogger();
64924
- const config = { ...userConfig, flags, logger };
64972
+ const logger = (_a = userConfig.logger) !== null && _a !== void 0 ? _a : createLogger();
64973
+ const config = { ...userConfig, flags: createConfigFlags((_b = userConfig.flags) !== null && _b !== void 0 ? _b : {}), logger };
64925
64974
  if (!config.sys) {
64926
64975
  config.sys = createSystem({ logger: config.logger });
64927
64976
  }
@@ -65630,7 +65679,7 @@ const getComponentPathContent = (componentGraph, outputTarget) => {
65630
65679
  const dependencies = [
65631
65680
  {
65632
65681
  name: "@rindo/core",
65633
- version: "2.17.1",
65682
+ version: "2.17.2-0",
65634
65683
  main: "compiler/rindo.js",
65635
65684
  resources: [
65636
65685
  "package.json",