silgi 0.7.10 → 0.7.12

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,4 +1,4 @@
1
- const version = "0.7.10";
1
+ const version = "0.7.12";
2
2
  const packageJson = {
3
3
  version: version};
4
4
 
@@ -9,7 +9,6 @@ import 'pathe';
9
9
  import 'escape-string-regexp';
10
10
  import 'mlly';
11
11
  import 'node:fs';
12
- import 'node:url';
13
12
  import 'pkg-types';
14
13
  import 'silgi/kit';
15
14
  import 'silgi/runtime/meta';
@@ -1629,8 +1629,7 @@ const prepare = defineCommand({
1629
1629
  const silgi = await createSilgiCLI({
1630
1630
  rootDir,
1631
1631
  dev: args.stub,
1632
- stub: args.stub,
1633
- typescript: { internalPaths: args.stub }
1632
+ stub: args.stub
1634
1633
  });
1635
1634
  await prepare$1();
1636
1635
  for (const framework of frameworkSetup) {
@@ -4,15 +4,14 @@ import { klona } from 'klona/full';
4
4
  import { isDebug, isTest } from 'std-env';
5
5
  import consola from 'consola';
6
6
  import { colors } from 'consola/utils';
7
- import { relative, join, resolve, isAbsolute, dirname } from 'pathe';
7
+ import { relative, join, resolve, dirname, isAbsolute } from 'pathe';
8
8
  import escapeRE from 'escape-string-regexp';
9
- import { resolveModuleExportNames, resolvePath as resolvePath$1 } from 'mlly';
9
+ import { resolveModuleExportNames } from 'mlly';
10
10
  import { existsSync, promises, lstatSync } from 'node:fs';
11
- import { pathToFileURL } from 'node:url';
12
11
  import { findWorkspaceDir, readPackageJSON } from 'pkg-types';
13
- import { resolveSilgiPath, resolveAlias, resolvePath, relativeWithDot, resolveSilgiModule } from 'silgi/kit';
12
+ import { resolveSilgiPath, relativeWithDot, resolveSilgiModule } from 'silgi/kit';
14
13
  import { runtimeDir, pkgDir } from 'silgi/runtime/meta';
15
- import { isRelative, withLeadingSlash, withTrailingSlash } from 'ufo';
14
+ import { withLeadingSlash, withTrailingSlash } from 'ufo';
16
15
  import { defu } from 'defu';
17
16
 
18
17
  const SilgiCLIDefaults = {
@@ -91,7 +90,6 @@ const SilgiCLIDefaults = {
91
90
  generateTsConfig: true,
92
91
  // generateRuntimeConfigTypes: true,
93
92
  tsconfigPath: "types/silgi.tsconfig.json",
94
- internalPaths: false,
95
93
  tsConfig: {},
96
94
  customConditions: []
97
95
  },
@@ -308,7 +306,7 @@ async function resolvePathOptions(options) {
308
306
  options.alias[packageJson.name] = join(options.rootDir, "src/module.ts");
309
307
  options.alias[`${packageJson.name}/runtime/`] = join(options.rootDir, "src/runtime/");
310
308
  }
311
- if (options.typescript?.internalPaths || options.stub) {
309
+ if (options.stub) {
312
310
  options.alias = {
313
311
  ...options.alias,
314
312
  "silgi/runtime": join(runtimeDir),
@@ -316,12 +314,6 @@ async function resolvePathOptions(options) {
316
314
  "silgi/runtime/*": join(runtimeDir, "*"),
317
315
  "#internal/silgi/*": join(runtimeDir, "*")
318
316
  };
319
- options.typescript.customConditions = [
320
- ...options.typescript.customConditions,
321
- "silgiTypes"
322
- ];
323
- options.conditions ||= [];
324
- options.conditions.push("silgi");
325
317
  }
326
318
  options.alias = {
327
319
  ...options.alias,
@@ -432,26 +424,6 @@ async function resolvePathOptions(options) {
432
424
  options.appConfigFiles.push(configFile);
433
425
  }
434
426
  }
435
- const modulesRuntimePaths = {};
436
- if (options.preset === "npm-package") {
437
- for (let i of options.modules) {
438
- if (typeof i === "string") {
439
- i = resolveAlias(i, options.alias);
440
- if (isRelative(i)) {
441
- i = resolve(options.rootDir, i);
442
- }
443
- const src = isAbsolute(i) ? pathToFileURL(await resolvePath(i, { fallbackToOriginal: false, extensions: options.extensions })).href : await resolvePath$1(i, { url: options.modulesDir.map((m) => pathToFileURL(m.replace(/\/node_modules\/?$/, ""))), extensions: options.extensions });
444
- const cleanPath = src.replace(/(\/(?:src|dist)(?:\/runtime)?(?:\/.*)?$)/, "");
445
- modulesRuntimePaths[`${i}/runtime`] = `${cleanPath}/src/runtime`;
446
- }
447
- }
448
- for (const [key, value] of Object.entries(modulesRuntimePaths)) {
449
- options.alias = {
450
- ...options.alias,
451
- [`${key}`]: value
452
- };
453
- }
454
- }
455
427
  }
456
428
  function _tryResolve(path, base = ".", extensions = ["", ".js", ".ts", ".mjs", ".cjs", ".json"]) {
457
429
  path = resolve(base, path);
@@ -647,7 +619,7 @@ async function silgiGenerateType(silgi) {
647
619
  jsxFactory: "h",
648
620
  jsxFragmentFactory: "Fragment",
649
621
  allowImportingTsExtensions: true,
650
- ...silgi.options.typescript.customConditions ? { customConditions: ["silgiTypes"] } : {},
622
+ customConditions: silgi.options.typescript.customConditions,
651
623
  paths: {
652
624
  "#silgiImports": [
653
625
  relativeWithDot(tsconfigDir, join(silgi.options.build.typesDir, "silgi-imports"))
@@ -665,22 +637,6 @@ async function silgiGenerateType(silgi) {
665
637
  }
666
638
  return acc;
667
639
  }, {})
668
- // ...(silgi.options.typescript?.internalPaths
669
- // ? {
670
- // 'silgi/runtime': [
671
- // relativeWithDot(tsconfigDir, join(runtimeDir, 'index')),
672
- // ],
673
- // '#internal/silgi': [
674
- // relativeWithDot(tsconfigDir, join(runtimeDir, 'index')),
675
- // ],
676
- // 'silgi/runtime/*': [
677
- // relativeWithDot(tsconfigDir, join(runtimeDir, '*')),
678
- // ],
679
- // '#internal/silgi/*': [
680
- // relativeWithDot(tsconfigDir, join(runtimeDir, '*')),
681
- // ],
682
- // }
683
- // : {}),
684
640
  }
685
641
  },
686
642
  include: [...include],
@@ -1,3 +1,3 @@
1
- const version = "0.7.10";
1
+ const version = "0.7.12";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "0.7.10";
1
+ const version = "0.7.12";
2
2
 
3
3
  export { version };
@@ -679,10 +679,6 @@ interface SilgiCLIOptions extends PresetOptions {
679
679
  * @default true
680
680
  */
681
681
  generateTsConfig: boolean;
682
- /**
683
- * @default false
684
- */
685
- internalPaths?: boolean;
686
682
  /**
687
683
  * @default ['silgiTypes']
688
684
  */
@@ -679,10 +679,6 @@ interface SilgiCLIOptions extends PresetOptions {
679
679
  * @default true
680
680
  */
681
681
  generateTsConfig: boolean;
682
- /**
683
- * @default false
684
- */
685
- internalPaths?: boolean;
686
682
  /**
687
683
  * @default ['silgiTypes']
688
684
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.7.10",
4
+ "version": "0.7.12",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {