@storm-software/unbuild 0.47.8 → 0.48.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.
@@ -203,10 +203,10 @@ var isVerbose = (label = LogLevelLabel.SILENT) => {
203
203
  };
204
204
 
205
205
  // ../config/src/constants.ts
206
- var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
206
+ var STORM_DEFAULT_DOCS = "https://stormsoftware.com/docs";
207
207
  var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
208
208
  var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
209
- var STORM_DEFAULT_LICENSING = "https://license.stormsoftware.com";
209
+ var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
210
210
  var STORM_DEFAULT_LICENSE = "Apache-2.0";
211
211
  var STORM_DEFAULT_RELEASE_BANNER = "https://public.storm-cdn.com/brand-banner.png";
212
212
  var STORM_DEFAULT_ACCOUNT_TWITTER = "StormSoftwareHQ";
@@ -380,10 +380,13 @@ var stormWorkspaceConfigSchema = z.object({
380
380
  organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
381
381
  repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
382
382
  license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
383
- homepage: z.string().trim().url().default(STORM_DEFAULT_HOMEPAGE).describe("The homepage of the workspace"),
384
- docs: z.string().trim().url().default(STORM_DEFAULT_DOCS).describe("The base documentation site for the workspace"),
385
- licensing: z.string().trim().url().default(STORM_DEFAULT_LICENSING).describe("The base licensing site for the workspace"),
386
- contact: z.string().trim().url().default(STORM_DEFAULT_CONTACT).describe("The base contact site for the workspace"),
383
+ homepage: z.string().trim().url().optional().describe("The homepage of the workspace"),
384
+ docs: z.string().trim().url().optional().describe("The documentation site for the workspace"),
385
+ licensing: z.string().trim().url().optional().describe("The licensing site for the workspace"),
386
+ contact: z.string().trim().url().optional().describe("The contact site for the workspace"),
387
+ support: z.string().trim().url().optional().describe(
388
+ "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
389
+ ),
387
390
  branch: z.string().trim().default("main").describe("The branch of the workspace"),
388
391
  preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
389
392
  owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
@@ -579,9 +582,10 @@ var DEFAULT_COLOR_CONFIG = {
579
582
  negative: "#dc2626"
580
583
  }
581
584
  };
582
- var getDefaultConfig = async (root) => {
585
+ async function getPackageJsonConfig(root) {
583
586
  let license = STORM_DEFAULT_LICENSE;
584
- let homepage = STORM_DEFAULT_HOMEPAGE;
587
+ let homepage = void 0;
588
+ let support = void 0;
585
589
  let name = void 0;
586
590
  let namespace = void 0;
587
591
  let repository = void 0;
@@ -612,6 +616,13 @@ var getDefaultConfig = async (root) => {
612
616
  if (packageJson.homepage) {
613
617
  homepage = packageJson.homepage;
614
618
  }
619
+ if (packageJson.bugs) {
620
+ if (typeof packageJson.bugs === "string") {
621
+ support = packageJson.bugs;
622
+ } else if (packageJson.bugs.url) {
623
+ support = packageJson.bugs.url;
624
+ }
625
+ }
615
626
  }
616
627
  }
617
628
  return {
@@ -621,13 +632,38 @@ var getDefaultConfig = async (root) => {
621
632
  repository,
622
633
  license,
623
634
  homepage,
624
- docs: `${homepage || STORM_DEFAULT_HOMEPAGE}/docs`,
625
- licensing: `${homepage || STORM_DEFAULT_HOMEPAGE}/license`,
626
- error: {
627
- url: `${homepage || STORM_DEFAULT_HOMEPAGE}/errors`
628
- }
635
+ support
629
636
  };
630
- };
637
+ }
638
+ function applyDefaultConfig(config) {
639
+ if (!config.support && config.contact) {
640
+ config.support = config.contact;
641
+ }
642
+ if (!config.contact && config.support) {
643
+ config.contact = config.support;
644
+ }
645
+ if (config.homepage) {
646
+ if (!config.docs) {
647
+ config.docs = `${config.homepage}/docs`;
648
+ }
649
+ if (!config.license) {
650
+ config.license = `${config.homepage}/license`;
651
+ }
652
+ if (!config.support) {
653
+ config.support = `${config.homepage}/support`;
654
+ }
655
+ if (!config.contact) {
656
+ config.contact = `${config.homepage}/contact`;
657
+ }
658
+ if (!config.error?.codesFile || !config?.error?.url) {
659
+ config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
660
+ if (config.homepage) {
661
+ config.error.url ??= `${config.homepage}/errors`;
662
+ }
663
+ }
664
+ }
665
+ return config;
666
+ }
631
667
 
632
668
  // ../config-tools/src/logger/chalk.ts
633
669
  import chalk from "chalk";
@@ -822,7 +858,8 @@ export {
822
858
  correctPaths,
823
859
  joinPaths,
824
860
  findWorkspaceRoot,
825
- getDefaultConfig,
861
+ getPackageJsonConfig,
862
+ applyDefaultConfig,
826
863
  getLogLevel,
827
864
  getLogLevelLabel,
828
865
  isVerbose,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeError
3
- } from "./chunk-XQLLOGJZ.js";
3
+ } from "./chunk-RJSLIE4Z.js";
4
4
 
5
5
  // src/plugins/on-error.ts
6
6
  var onErrorPlugin = (options) => ({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeTrace
3
- } from "./chunk-XQLLOGJZ.js";
3
+ } from "./chunk-RJSLIE4Z.js";
4
4
 
5
5
  // src/plugins/tsc.ts
6
6
  import {
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkQ2G4VMOWcjs = require('./chunk-Q2G4VMOW.cjs');
4
+ var _chunkP2WBOEJEcjs = require('./chunk-P2WBOEJE.cjs');
5
5
 
6
6
  // src/clean.ts
7
7
  var _promises = require('fs/promises');
8
8
  async function clean(name = "Unbuild", directory, config) {
9
- _chunkQ2G4VMOWcjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
10
- const stopwatch = _chunkQ2G4VMOWcjs.getStopwatch.call(void 0, `${name} output clean`);
9
+ _chunkP2WBOEJEcjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
10
+ const stopwatch = _chunkP2WBOEJEcjs.getStopwatch.call(void 0, `${name} output clean`);
11
11
  await cleanDirectories(name, directory, config);
12
12
  stopwatch();
13
13
  }