silgi 0.7.9 → 0.7.11

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.9";
1
+ const version = "0.7.11";
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';
@@ -234,7 +234,6 @@ async function readCoreFile(silgi) {
234
234
  debug: silgi.options.debug,
235
235
  alias: silgi.options.alias
236
236
  });
237
- console.log("injectedResult", silgi.options.conditions);
238
237
  const coreFile = await jiti.evalModule(
239
238
  injectedResult.code,
240
239
  {
@@ -1630,8 +1629,7 @@ const prepare = defineCommand({
1630
1629
  const silgi = await createSilgiCLI({
1631
1630
  rootDir,
1632
1631
  dev: args.stub,
1633
- stub: args.stub,
1634
- typescript: { internalPaths: args.stub }
1632
+ stub: args.stub
1635
1633
  });
1636
1634
  await prepare$1();
1637
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),
@@ -432,26 +430,6 @@ async function resolvePathOptions(options) {
432
430
  options.appConfigFiles.push(configFile);
433
431
  }
434
432
  }
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
433
  }
456
434
  function _tryResolve(path, base = ".", extensions = ["", ".js", ".ts", ".mjs", ".cjs", ".json"]) {
457
435
  path = resolve(base, path);
@@ -665,22 +643,6 @@ async function silgiGenerateType(silgi) {
665
643
  }
666
644
  return acc;
667
645
  }, {})
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
646
  }
685
647
  },
686
648
  include: [...include],
@@ -1,3 +1,3 @@
1
- const version = "0.7.9";
1
+ const version = "0.7.11";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "0.7.9";
1
+ const version = "0.7.11";
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.9",
4
+ "version": "0.7.11",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {
@@ -173,7 +173,7 @@
173
173
  "lint": "eslint .",
174
174
  "lint:fix": "eslint . --fix",
175
175
  "silgi": "tsx cli/index.ts",
176
- "pb": "pnpm unbuild && pnpm publish --no-git-checks --access public",
176
+ "release": "pnpm unbuild && pnpm publish --no-git-checks --access public",
177
177
  "generate": "pnpm --filter './examples/**' silgi:prepare",
178
178
  "gen-presets": "pnpm jiti scripts/gen-presets.ts",
179
179
  "all:delete": "find . -type d \\( -name \"node_modules\" -o -name \"dist\" \\) -prune -exec rm -rf {} +"