@rindo/core 3.0.0-rc.0 → 3.0.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.
package/cli/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo CLI (CommonJS) v3.0.0-rc.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo CLI (CommonJS) v3.0.0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  'use strict';
5
5
 
@@ -987,7 +987,7 @@ const dereferenceAlias = (maybeAlias) => {
987
987
  const dependencies = [
988
988
  {
989
989
  name: "@rindo/core",
990
- version: "3.0.0-rc.0",
990
+ version: "3.0.0",
991
991
  main: "compiler/rindo.js",
992
992
  resources: [
993
993
  "package.json",
@@ -2552,16 +2552,20 @@ const run = async (init) => {
2552
2552
  * @public
2553
2553
  */
2554
2554
  const runTask = async (coreCompiler, config, task, sys) => {
2555
- var _a, _b, _c, _d, _e, _f;
2555
+ var _a, _b, _c, _d, _e, _f, _g;
2556
2556
  const logger = (_a = config.logger) !== null && _a !== void 0 ? _a : createLogger();
2557
+ const rootDir = (_b = config.rootDir) !== null && _b !== void 0 ? _b : '/';
2558
+ const configSys = (_c = sys !== null && sys !== void 0 ? sys : config.sys) !== null && _c !== void 0 ? _c : coreCompiler.createSystem({ logger });
2557
2559
  const strictConfig = {
2558
2560
  ...config,
2559
- flags: createConfigFlags((_b = config.flags) !== null && _b !== void 0 ? _b : { task }),
2561
+ flags: createConfigFlags((_d = config.flags) !== null && _d !== void 0 ? _d : { task }),
2562
+ hydratedFlag: (_e = config.hydratedFlag) !== null && _e !== void 0 ? _e : null,
2560
2563
  logger,
2561
- outputTargets: (_c = config.outputTargets) !== null && _c !== void 0 ? _c : [],
2562
- rootDir: (_d = config.rootDir) !== null && _d !== void 0 ? _d : '/',
2563
- sys: (_e = sys !== null && sys !== void 0 ? sys : config.sys) !== null && _e !== void 0 ? _e : coreCompiler.createSystem({ logger }),
2564
- testing: (_f = config.testing) !== null && _f !== void 0 ? _f : {},
2564
+ outputTargets: (_f = config.outputTargets) !== null && _f !== void 0 ? _f : [],
2565
+ packageJsonFilePath: configSys.platformPath.join(rootDir, 'package.json'),
2566
+ rootDir,
2567
+ sys: configSys,
2568
+ testing: (_g = config.testing) !== null && _g !== void 0 ? _g : {},
2565
2569
  };
2566
2570
  switch (task) {
2567
2571
  case 'build':
package/cli/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo CLI v3.0.0-rc.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo CLI v3.0.0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  /**
5
5
  * Convert a string from dash-case / kebab-case to PascalCase (or CamelCase,
@@ -963,7 +963,7 @@ const dereferenceAlias = (maybeAlias) => {
963
963
  const dependencies = [
964
964
  {
965
965
  name: "@rindo/core",
966
- version: "3.0.0-rc.0",
966
+ version: "3.0.0",
967
967
  main: "compiler/rindo.js",
968
968
  resources: [
969
969
  "package.json",
@@ -2528,16 +2528,20 @@ const run = async (init) => {
2528
2528
  * @public
2529
2529
  */
2530
2530
  const runTask = async (coreCompiler, config, task, sys) => {
2531
- var _a, _b, _c, _d, _e, _f;
2531
+ var _a, _b, _c, _d, _e, _f, _g;
2532
2532
  const logger = (_a = config.logger) !== null && _a !== void 0 ? _a : createLogger();
2533
+ const rootDir = (_b = config.rootDir) !== null && _b !== void 0 ? _b : '/';
2534
+ const configSys = (_c = sys !== null && sys !== void 0 ? sys : config.sys) !== null && _c !== void 0 ? _c : coreCompiler.createSystem({ logger });
2533
2535
  const strictConfig = {
2534
2536
  ...config,
2535
- flags: createConfigFlags((_b = config.flags) !== null && _b !== void 0 ? _b : { task }),
2537
+ flags: createConfigFlags((_d = config.flags) !== null && _d !== void 0 ? _d : { task }),
2538
+ hydratedFlag: (_e = config.hydratedFlag) !== null && _e !== void 0 ? _e : null,
2536
2539
  logger,
2537
- outputTargets: (_c = config.outputTargets) !== null && _c !== void 0 ? _c : [],
2538
- rootDir: (_d = config.rootDir) !== null && _d !== void 0 ? _d : '/',
2539
- sys: (_e = sys !== null && sys !== void 0 ? sys : config.sys) !== null && _e !== void 0 ? _e : coreCompiler.createSystem({ logger }),
2540
- testing: (_f = config.testing) !== null && _f !== void 0 ? _f : {},
2540
+ outputTargets: (_f = config.outputTargets) !== null && _f !== void 0 ? _f : [],
2541
+ packageJsonFilePath: configSys.platformPath.join(rootDir, 'package.json'),
2542
+ rootDir,
2543
+ sys: configSys,
2544
+ testing: (_g = config.testing) !== null && _g !== void 0 ? _g : {},
2541
2545
  };
2542
2546
  switch (task) {
2543
2547
  case 'build':
package/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/cli",
3
- "version": "3.0.0-rc.0",
3
+ "version": "3.0.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": "3.0.0-rc.0",
3
+ "version": "3.0.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 v3.0.0-rc.0 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Compiler v3.0.0 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  (function(exports) {
5
5
  'use strict';
@@ -1047,21 +1047,24 @@ const loadTypeScriptDiagnostics = (tsDiagnostics) => {
1047
1047
  * @returns a Rindo diagnostic, suitable for showing an error to the user
1048
1048
  */
1049
1049
  const loadTypeScriptDiagnostic = (tsDiagnostic) => {
1050
+ var _a;
1050
1051
  const d = {
1051
- level: 'warn',
1052
- type: 'typescript',
1053
- language: 'typescript',
1054
- header: 'TypeScript',
1052
+ absFilePath: undefined,
1055
1053
  code: tsDiagnostic.code.toString(),
1056
- messageText: flattenDiagnosticMessageText(tsDiagnostic, tsDiagnostic.messageText),
1057
- relFilePath: null,
1058
- absFilePath: null,
1054
+ columnNumber: undefined,
1055
+ header: 'TypeScript',
1056
+ language: 'typescript',
1057
+ level: 'warn',
1058
+ lineNumber: undefined,
1059
1059
  lines: [],
1060
+ messageText: flattenDiagnosticMessageText(tsDiagnostic, tsDiagnostic.messageText),
1061
+ relFilePath: undefined,
1062
+ type: 'typescript',
1060
1063
  };
1061
1064
  if (tsDiagnostic.category === 1) {
1062
1065
  d.level = 'error';
1063
1066
  }
1064
- if (tsDiagnostic.file) {
1067
+ if (tsDiagnostic.file && typeof tsDiagnostic.start === 'number') {
1065
1068
  d.absFilePath = tsDiagnostic.file.fileName;
1066
1069
  const sourceText = tsDiagnostic.file.text;
1067
1070
  const srcLines = splitLineBreaks(sourceText);
@@ -1071,7 +1074,7 @@ const loadTypeScriptDiagnostic = (tsDiagnostic) => {
1071
1074
  lineNumber: posData.line + 1,
1072
1075
  text: srcLines[posData.line],
1073
1076
  errorCharStart: posData.character,
1074
- errorLength: Math.max(tsDiagnostic.length, 1),
1077
+ errorLength: Math.max((_a = tsDiagnostic.length) !== null && _a !== void 0 ? _a : 0, 1),
1075
1078
  };
1076
1079
  d.lineNumber = errorLine.lineNumber;
1077
1080
  d.columnNumber = errorLine.errorCharStart + 1;
@@ -2098,7 +2101,7 @@ const process$3 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), p
2098
2101
  'default': process_1
2099
2102
  });
2100
2103
 
2101
- const buildId = '20230405135121';
2104
+ const buildId = '20230405141918';
2102
2105
  const minfyJsId = 'terser5.16.1_7';
2103
2106
  const optimizeCssId = 'autoprefixer10.4.13_postcss8.4.21_7';
2104
2107
  const parse5Version = '7.1.2';
@@ -2106,8 +2109,8 @@ const rollupVersion = '2.42.3';
2106
2109
  const sizzleVersion = '2.42.3';
2107
2110
  const terserVersion = '5.16.1';
2108
2111
  const typescriptVersion = '4.9.4';
2109
- const vermoji = '🦄';
2110
- const version$3 = '3.0.0-rc.0';
2112
+ const vermoji = '📣';
2113
+ const version$3 = '3.0.0';
2111
2114
  const versions = {
2112
2115
  rindo: version$3,
2113
2116
  parse5: parse5Version,
@@ -4839,6 +4842,7 @@ const autoprefixCss = async (cssText, opts) => {
4839
4842
  messageText: warning.text,
4840
4843
  level: 'warn',
4841
4844
  type: 'css',
4845
+ lines: [],
4842
4846
  });
4843
4847
  });
4844
4848
  output.output = result.css;
@@ -4849,6 +4853,7 @@ const autoprefixCss = async (cssText, opts) => {
4849
4853
  messageText: `CSS Error` + e,
4850
4854
  level: `error`,
4851
4855
  type: `css`,
4856
+ lines: [],
4852
4857
  };
4853
4858
  if (typeof e.name === 'string') {
4854
4859
  diagnostic.header = e.name;
@@ -57216,6 +57221,7 @@ const bundleCustomElements$1 = async (config, compilerCtx, buildCtx, outputTarge
57216
57221
  level: 'error',
57217
57222
  type: 'build',
57218
57223
  messageText: 'dist-custom-elements output target provided with no output target directory!',
57224
+ lines: [],
57219
57225
  });
57220
57226
  return;
57221
57227
  }
@@ -65099,8 +65105,9 @@ function generateBuildStats(config, buildCtx) {
65099
65105
  }
65100
65106
  catch (e) {
65101
65107
  const diagnostic = {
65102
- messageText: `Generate Build Stats Error: ` + e,
65103
65108
  level: `error`,
65109
+ lines: [],
65110
+ messageText: `Generate Build Stats Error: ` + e,
65104
65111
  type: `build`,
65105
65112
  };
65106
65113
  jsonData = {
@@ -66483,15 +66490,18 @@ const createConfigFlags = (init = {}) => {
66483
66490
  };
66484
66491
 
66485
66492
  const getConfig = (userConfig) => {
66486
- var _a, _b, _c, _d, _e;
66493
+ var _a, _b, _c, _d, _e, _f;
66487
66494
  const logger = (_a = userConfig.logger) !== null && _a !== void 0 ? _a : createLogger();
66495
+ const rootDir = (_b = userConfig.rootDir) !== null && _b !== void 0 ? _b : '/';
66488
66496
  const config = {
66489
66497
  ...userConfig,
66490
- flags: createConfigFlags((_b = userConfig.flags) !== null && _b !== void 0 ? _b : {}),
66498
+ flags: createConfigFlags((_c = userConfig.flags) !== null && _c !== void 0 ? _c : {}),
66499
+ hydratedFlag: (_d = userConfig.hydratedFlag) !== null && _d !== void 0 ? _d : null,
66491
66500
  logger,
66492
- outputTargets: (_c = userConfig.outputTargets) !== null && _c !== void 0 ? _c : [],
66493
- rootDir: (_d = userConfig.rootDir) !== null && _d !== void 0 ? _d : '/',
66494
- sys: (_e = userConfig.sys) !== null && _e !== void 0 ? _e : createSystem({ logger }),
66501
+ outputTargets: (_e = userConfig.outputTargets) !== null && _e !== void 0 ? _e : [],
66502
+ packageJsonFilePath: join(rootDir, 'package.json'),
66503
+ rootDir,
66504
+ sys: (_f = userConfig.sys) !== null && _f !== void 0 ? _f : createSystem({ logger }),
66495
66505
  testing: userConfig !== null && userConfig !== void 0 ? userConfig : {},
66496
66506
  };
66497
66507
  setPlatformPath(config.sys.platformPath);
@@ -68660,26 +68670,28 @@ const validateDevServer = (config, diagnostics) => {
68660
68670
  };
68661
68671
 
68662
68672
  /**
68663
- * Check the provided `.hydratedFlag` prop and return a properly-validated value.
68673
+ * Validate the `.hydratedFlag` property on the supplied config object and
68674
+ * return a properly-validated value.
68664
68675
  *
68665
68676
  * @param config the configuration we're examining
68666
68677
  * @returns a suitable value for the hydratedFlag property
68667
68678
  */
68668
68679
  const validateHydrated = (config) => {
68680
+ var _a;
68669
68681
  /**
68670
68682
  * If `config.hydratedFlag` is set to `null` that is an explicit signal that we
68671
68683
  * should _not_ create a default configuration when validating and should instead
68672
- * just return `undefined`. It may also have been set to `false`; this is an invalid
68684
+ * just return `null`. It may also have been set to `false`; this is an invalid
68673
68685
  * value as far as the type system is concerned, but users may ignore this.
68674
68686
  *
68675
68687
  * See {@link HydratedFlag} for more details.
68676
68688
  */
68677
68689
  if (config.hydratedFlag === null || config.hydratedFlag === false) {
68678
- return undefined;
68690
+ return null;
68679
68691
  }
68680
68692
  // Here we start building up a default config since `.hydratedFlag` wasn't set to
68681
68693
  // `null` on the provided config.
68682
- const hydratedFlag = { ...config.hydratedFlag };
68694
+ const hydratedFlag = { ...((_a = config.hydratedFlag) !== null && _a !== void 0 ? _a : {}) };
68683
68695
  if (!isString$1(hydratedFlag.name) || hydratedFlag.property === '') {
68684
68696
  hydratedFlag.name = `hydrated`;
68685
68697
  }
@@ -69052,13 +69064,16 @@ const validateConfig = (userConfig = {}, bootstrapConfig) => {
69052
69064
  const config = Object.assign({}, userConfig); // not positive it's json safe
69053
69065
  const diagnostics = [];
69054
69066
  const logger = bootstrapConfig.logger || config.logger || createLogger();
69067
+ const rootDir = typeof config.rootDir === 'string' ? config.rootDir : '/';
69055
69068
  const validatedConfig = {
69056
69069
  ...config,
69057
69070
  // flags _should_ be JSON safe
69058
69071
  flags: JSON.parse(JSON.stringify(config.flags || {})),
69072
+ hydratedFlag: validateHydrated(config),
69059
69073
  logger,
69060
69074
  outputTargets: (_a = config.outputTargets) !== null && _a !== void 0 ? _a : [],
69061
- rootDir: typeof config.rootDir === 'string' ? config.rootDir : '/',
69075
+ packageJsonFilePath: join(rootDir, 'package.json'),
69076
+ rootDir,
69062
69077
  sys: (_c = (_b = config.sys) !== null && _b !== void 0 ? _b : bootstrapConfig.sys) !== null && _c !== void 0 ? _c : createSystem({ logger }),
69063
69078
  testing: (_d = config.testing) !== null && _d !== void 0 ? _d : {},
69064
69079
  };
@@ -69137,8 +69152,6 @@ const validateConfig = (userConfig = {}, bootstrapConfig) => {
69137
69152
  validatedConfig.devServer = validateDevServer(validatedConfig, diagnostics);
69138
69153
  // testing
69139
69154
  validateTesting(validatedConfig, diagnostics);
69140
- // hydrate flag
69141
- validatedConfig.hydratedFlag = validateHydrated(validatedConfig);
69142
69155
  // bundles
69143
69156
  if (Array.isArray(validatedConfig.bundles)) {
69144
69157
  validatedConfig.bundles = sortBy(validatedConfig.bundles, (a) => a.components.length);
@@ -69995,7 +70008,7 @@ const getComponentPathContent = (componentGraph, outputTarget) => {
69995
70008
  const dependencies = [
69996
70009
  {
69997
70010
  name: "@rindo/core",
69998
- version: "3.0.0-rc.0",
70011
+ version: "3.0.0",
69999
70012
  main: "compiler/rindo.js",
70000
70013
  resources: [
70001
70014
  "package.json",