@storm-software/tsdown 0.22.2 → 0.22.4

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.
@@ -118,6 +118,8 @@ var ColorConfigMapSchema = z.union([
118
118
  }),
119
119
  z.record(z.string(), ColorConfigSchema)
120
120
  ]);
121
+ var ExtendsItemSchema = z.string().trim().describe("The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration.");
122
+ var ExtendsSchema = ExtendsItemSchema.or(z.array(ExtendsItemSchema)).describe("The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration.");
121
123
  var WorkspaceBotConfigSchema = z.object({
122
124
  name: z.string().trim().default("Stormie-Bot").describe("The workspace bot user's name (this is the bot that will be used to perform various tasks)"),
123
125
  email: z.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
@@ -132,11 +134,11 @@ var WorkspaceDirectoryConfigSchema = z.object({
132
134
  }).describe("Various directories used by the workspace to store data, cache, and configuration files");
133
135
  var StormConfigSchema = z.object({
134
136
  $schema: z.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
135
- extends: z.string().trim().optional().describe("The path to a base JSON file to use as a configuration preset file"),
137
+ extends: ExtendsSchema.optional(),
136
138
  name: z.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
137
139
  namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
138
140
  organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
139
- repository: z.string().trim().url().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
141
+ repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
140
142
  license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
141
143
  homepage: z.string().trim().url().default(STORM_DEFAULT_HOMEPAGE).describe("The homepage of the workspace"),
142
144
  docs: z.string().trim().url().default(STORM_DEFAULT_DOCS).describe("The base documentation site for the workspace"),
@@ -199,7 +201,8 @@ var COLOR_KEYS = [
199
201
  ];
200
202
 
201
203
  // ../config-tools/src/utilities/get-default-config.ts
202
- import { existsSync as existsSync2, readFileSync } from "node:fs";
204
+ import { existsSync as existsSync2 } from "node:fs";
205
+ import { readFile } from "node:fs/promises";
203
206
  import { join as join2 } from "node:path";
204
207
 
205
208
  // ../config-tools/src/utilities/correct-paths.ts
@@ -321,17 +324,15 @@ var DEFAULT_COLOR_CONFIG = {
321
324
  "negative": "#dc2626"
322
325
  }
323
326
  };
324
- var getDefaultConfig = /* @__PURE__ */ __name((root) => {
327
+ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
325
328
  let license = STORM_DEFAULT_LICENSE;
326
329
  let homepage = STORM_DEFAULT_HOMEPAGE;
327
- let name;
328
- let namespace;
329
- let repository;
330
+ let name = void 0;
331
+ let namespace = void 0;
332
+ let repository = void 0;
330
333
  const workspaceRoot = findWorkspaceRoot(root);
331
334
  if (existsSync2(join2(workspaceRoot, "package.json"))) {
332
- const file = readFileSync(join2(workspaceRoot, "package.json"), {
333
- encoding: "utf8"
334
- });
335
+ const file = await readFile(joinPaths(workspaceRoot, "package.json"), "utf8");
335
336
  if (file) {
336
337
  const packageJson = JSON.parse(file);
337
338
  if (packageJson.name) {
@@ -340,8 +341,12 @@ var getDefaultConfig = /* @__PURE__ */ __name((root) => {
340
341
  if (packageJson.namespace) {
341
342
  namespace = packageJson.namespace;
342
343
  }
343
- if (packageJson.repository?.url) {
344
- repository = packageJson.repository?.url;
344
+ if (packageJson.repository) {
345
+ if (typeof packageJson.repository === "string") {
346
+ repository = packageJson.repository;
347
+ } else if (packageJson.repository.url) {
348
+ repository = packageJson.repository.url;
349
+ }
345
350
  }
346
351
  if (packageJson.license) {
347
352
  license = packageJson.license;
@@ -548,7 +553,6 @@ var writeWarning = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel
548
553
  var writeSuccess = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
549
554
  var writeDebug = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
550
555
  var writeTrace = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
551
- var writeSystem = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
552
556
  var getStopwatch = /* @__PURE__ */ __name((name) => {
553
557
  const start = process.hrtime();
554
558
  return () => {
@@ -598,6 +602,7 @@ export {
598
602
  STORM_DEFAULT_DOCS,
599
603
  STORM_DEFAULT_HOMEPAGE,
600
604
  STORM_DEFAULT_LICENSING,
605
+ StormConfigSchema,
601
606
  COLOR_KEYS,
602
607
  correctPaths,
603
608
  joinPaths,
@@ -611,7 +616,6 @@ export {
611
616
  writeSuccess,
612
617
  writeDebug,
613
618
  writeTrace,
614
- writeSystem,
615
619
  getStopwatch,
616
620
  formatLogMessage,
617
621
  clean