silgi 0.41.44 → 0.41.46

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.41.44";
4
+ const version = "0.41.46";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
package/dist/cli/init.mjs CHANGED
@@ -5,6 +5,7 @@ import { defineCommand, runCommand } from 'citty';
5
5
  import consola from 'consola';
6
6
  import { dirname } from 'pathe';
7
7
  import { c as cancelOnCancel, a as command$1 } from './prepare.mjs';
8
+ import 'pkg-types';
8
9
  import 'silgi/meta';
9
10
  import './build.mjs';
10
11
  import 'hookable';
@@ -37,7 +38,6 @@ import 'klona/full';
37
38
  import 'std-env';
38
39
  import 'consola/utils';
39
40
  import 'escape-string-regexp';
40
- import 'pkg-types';
41
41
  import 'apiful/openapi';
42
42
  import '../_chunks/silgiApp.mjs';
43
43
  import 'unctx';
@@ -8,6 +8,7 @@ import { c as commonArgs } from './common.mjs';
8
8
  import { a as command$1 } from './prepare.mjs';
9
9
  import 'unctx';
10
10
  import 'pathe';
11
+ import 'pkg-types';
11
12
  import './build.mjs';
12
13
  import 'hookable';
13
14
  import 'silgi';
@@ -41,7 +42,6 @@ import 'klona/full';
41
42
  import 'std-env';
42
43
  import 'consola/utils';
43
44
  import 'escape-string-regexp';
44
- import 'pkg-types';
45
45
  import 'apiful/openapi';
46
46
  import 'pathe/utils';
47
47
  import 'untyped';
@@ -30,6 +30,10 @@ const SilgiCLIDefaults = {
30
30
  devServer: {
31
31
  watch: []
32
32
  },
33
+ package: {
34
+ name: "",
35
+ present: "npm-package"
36
+ },
33
37
  // Dirs
34
38
  scanDirs: [],
35
39
  build: {
@@ -580,6 +584,7 @@ async function _loadUserConfig(configOverrides = {}, opts = {}) {
580
584
  options._c12 = loadedConfig;
581
585
  const _presetName = (loadedConfig.layers || []).find((l) => l.config?._meta?.name)?.config?._meta?.name || presetOverride;
582
586
  options.preset = _presetName;
587
+ options.package.present = _presetName;
583
588
  options.compatibilityDate = resolveCompatibilityDates(
584
589
  compatibilityDate,
585
590
  options.compatibilityDate
@@ -1,5 +1,6 @@
1
1
  import { defineCommand, runCommand } from 'citty';
2
2
  import { resolve } from 'pathe';
3
+ import { readPackageJSON } from 'pkg-types';
3
4
  import { version } from 'silgi/meta';
4
5
  import { p as prepareEnv, c as createSilgiCLI, b as build } from './build.mjs';
5
6
  import { c as commonArgs } from './common.mjs';
@@ -157,13 +158,18 @@ const command = defineCommand({
157
158
  },
158
159
  async run({ args }) {
159
160
  const rootDir = resolve(args.dir || args._dir || ".");
161
+ const packageJson = await readPackageJSON(rootDir);
162
+ const packageName = packageJson.name || "";
160
163
  const silgi = await createSilgiCLI({
161
164
  rootDir,
162
165
  dev: args.dev || args.stub,
163
166
  stub: args.stub,
164
167
  preset: args.preset,
165
168
  commandType: args.commandType || "prepare",
166
- activeEnvironment: args.env
169
+ activeEnvironment: args.env,
170
+ package: {
171
+ name: packageName
172
+ }
167
173
  });
168
174
  await build(silgi);
169
175
  if (args.commandType !== "commands") {
@@ -1435,8 +1435,9 @@ type Schema = 'zod' | 'valibot' | 'arkType' | 'typebox';
1435
1435
  interface SilgiCLIOptions extends PresetOptions {
1436
1436
  _config: SilgiCLIConfig;
1437
1437
  _c12: ResolvedConfig<SilgiCLIConfig> | ConfigWatcher<SilgiCLIConfig>;
1438
- _cli?: {
1439
- command?: string;
1438
+ package: {
1439
+ present: PresetName;
1440
+ name: string;
1440
1441
  };
1441
1442
  commandType: CommandType;
1442
1443
  commands: Commands[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.41.44",
4
+ "version": "0.41.46",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {