@theholocron/cli 2.0.0-alpha.30 → 2.0.0-alpha.32

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/dist/cli.mjs CHANGED
@@ -3581,6 +3581,52 @@ function vaultProviderName(loader) {
3581
3581
  }
3582
3582
  //#endregion
3583
3583
  //#region src/commands/setup.ts
3584
+ const EDITORCONFIG = `\
3585
+ root = true
3586
+
3587
+ [*]
3588
+ end_of_line = lf
3589
+ charset = utf-8
3590
+ trim_trailing_whitespace = true
3591
+ insert_final_newline = true
3592
+ indent_style = tab
3593
+ indent_size = 4
3594
+
3595
+ [.gitattributes]
3596
+ indent_style = space
3597
+ indent_size = 2
3598
+
3599
+ [*.{json,yml,yaml}]
3600
+ indent_style = space
3601
+ indent_size = 2
3602
+
3603
+ [*.md]
3604
+ trim_trailing_whitespace = false
3605
+
3606
+ [.*{rc,ignore}]
3607
+ indent_style = space
3608
+ indent_size = 2
3609
+ `;
3610
+ const EDITORCONFIG_CHECKER_CONFIG = JSON.stringify({
3611
+ Version: "v3.7.0",
3612
+ Verbose: false,
3613
+ Format: "",
3614
+ Debug: false,
3615
+ IgnoreDefaults: false,
3616
+ SpacesAfterTabs: false,
3617
+ NoColor: false,
3618
+ Exclude: ["(^|.+/)LICENSE$", "^public/.*"],
3619
+ AllowedContentTypes: [],
3620
+ PassedFiles: [],
3621
+ Disable: {
3622
+ EndOfLine: false,
3623
+ Indentation: false,
3624
+ InsertFinalNewline: false,
3625
+ TrimTrailingWhitespace: false,
3626
+ IndentSize: false,
3627
+ MaxLineLength: false
3628
+ }
3629
+ }, null, 2) + "\n";
3584
3630
  const ALEX_CONFIG = JSON.stringify({ allow: [
3585
3631
  "dead",
3586
3632
  "failure",
@@ -3861,6 +3907,14 @@ async function runSetup(input) {
3861
3907
  await source.writeRepoFile(".alexrc.json", ALEX_CONFIG);
3862
3908
  }));
3863
3909
  print(formatStep(steps[steps.length - 1]));
3910
+ steps.push(await runStep("source", "write .editorconfig", dryRun, async () => {
3911
+ await source.writeRepoFile(".editorconfig", EDITORCONFIG);
3912
+ }));
3913
+ print(formatStep(steps[steps.length - 1]));
3914
+ steps.push(await runStep("source", "write .editorconfig-checker.json", dryRun, async () => {
3915
+ await source.writeRepoFile(".editorconfig-checker.json", EDITORCONFIG_CHECKER_CONFIG);
3916
+ }));
3917
+ print(formatStep(steps[steps.length - 1]));
3864
3918
  }
3865
3919
  if (loader.has("environments")) {
3866
3920
  const envs = loader.get("environments");
@@ -4057,7 +4111,8 @@ async function loadTs(filepath) {
4057
4111
  return extractAndResolve(filepath, await tsImport(pathToFileURL(filepath).href, import.meta.url));
4058
4112
  }
4059
4113
  function extractAndResolve(filepath, mod) {
4060
- const raw = mod.default;
4114
+ const outer = mod.default;
4115
+ const raw = outer?.__esModule === true ? outer.default : outer;
4061
4116
  if (raw === void 0 || raw === null) throw new ConfigFileError(`${filepath} must have a default export (use \`export default defineConfig({…})\`)`);
4062
4117
  return resolveConfig(raw);
4063
4118
  }
package/dist/index.mjs CHANGED
@@ -263,7 +263,8 @@ async function loadTs(filepath) {
263
263
  return extractAndResolve(filepath, await tsImport(pathToFileURL(filepath).href, import.meta.url));
264
264
  }
265
265
  function extractAndResolve(filepath, mod) {
266
- const raw = mod.default;
266
+ const outer = mod.default;
267
+ const raw = outer?.__esModule === true ? outer.default : outer;
267
268
  if (raw === void 0 || raw === null) throw new ConfigFileError(`${filepath} must have a default export (use \`export default defineConfig({…})\`)`);
268
269
  return resolveConfig(raw);
269
270
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/cli",
3
- "version": "2.0.0-alpha.30",
3
+ "version": "2.0.0-alpha.32",
4
4
  "description": "The Holocron CLI — a pluggable, capability-based orchestrator for spinning up and operating software projects.",
5
5
  "homepage": "https://github.com/theholocron/holocron/tree/main/packages/cli#readme",
6
6
  "bugs": "https://github.com/theholocron/holocron/issues",