silgi 0.29.23 → 0.29.24

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.29.23";
4
+ const version = "0.29.24";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -1789,7 +1789,7 @@ async function scanExportFile(silgi) {
1789
1789
  return { exportName, path, _name, type: "context" };
1790
1790
  }));
1791
1791
  }
1792
- silgi.hook("prepare:scan.ts", (options) => {
1792
+ silgi.hook("before:scan.ts", (options) => {
1793
1793
  for (const { exportName, path, _name, type } of scanTS) {
1794
1794
  if (!path.includes("vfs")) {
1795
1795
  silgi.options.devServer.watch.push(path);
@@ -1989,11 +1989,7 @@ async function prepareScanFile(silgi) {
1989
1989
  const scanned = {
1990
1990
  uris: {},
1991
1991
  services: [],
1992
- shareds: [
1993
- `createShared({
1994
- modulesURIs,
1995
- })`
1996
- ],
1992
+ shareds: [],
1997
1993
  schemas: [],
1998
1994
  modulesURIs: {},
1999
1995
  addImportItem,
@@ -2003,9 +1999,14 @@ async function prepareScanFile(silgi) {
2003
1999
  defu(scanned.uris, silgi.uris);
2004
2000
  }
2005
2001
  if (silgi.modulesURIs) {
2002
+ scanned.shareds.push(
2003
+ `createShared({
2004
+ modulesURIs,
2005
+ })`
2006
+ );
2006
2007
  defu(scanned.modulesURIs, silgi.modulesURIs);
2007
2008
  }
2008
- await silgi.callHook("prepare:scan.ts", scanned);
2009
+ await silgi.callHook("before:scan.ts", scanned);
2009
2010
  if (scanned.services.length > 0) {
2010
2011
  addImportItem({
2011
2012
  specifier: "silgi",
@@ -2063,7 +2064,7 @@ async function prepareScanFile(silgi) {
2063
2064
  scanned.shareds.length > 0 ? "])" : "}",
2064
2065
  ""
2065
2066
  ];
2066
- await silgi.callHook("after:prepare:scan.ts", importData);
2067
+ await silgi.callHook("after:scan.ts", importData);
2067
2068
  importData.unshift(...importsContent);
2068
2069
  importData.unshift(...baseHeaderBannerComment);
2069
2070
  return importData;
@@ -2080,7 +2081,7 @@ async function writeScanFiles(silgi) {
2080
2081
  await readScanFile(silgi);
2081
2082
  buildUriMap(silgi);
2082
2083
  parseServices(silgi);
2083
- silgi.hook("prepare:scan.ts", (file) => {
2084
+ silgi.hook("before:scan.ts", (file) => {
2084
2085
  file.uris = {
2085
2086
  ...file.uris,
2086
2087
  ...silgi.uris
@@ -200,7 +200,7 @@ interface SilgiCLIHooks extends SilgiHooks {
200
200
  }) => void;
201
201
  }) => HookResult;
202
202
  'after:core.ts': (content: string[]) => HookResult;
203
- 'prepare:scan.ts': (data: {
203
+ 'before:scan.ts': (data: {
204
204
  uris: Record<string, string>;
205
205
  services: string[];
206
206
  shareds: string[];
@@ -209,7 +209,7 @@ interface SilgiCLIHooks extends SilgiHooks {
209
209
  addImportItem: (data: GenImport | GenImport[]) => void;
210
210
  addImportItemType: (data: GenImport | GenImport[]) => void;
211
211
  }) => HookResult;
212
- 'after:prepare:scan.ts': (content: string[]) => HookResult;
212
+ 'after:scan.ts': (content: string[]) => HookResult;
213
213
  'before:schema.ts': (options: {
214
214
  addImportItem: (data: GenImport | GenImport[]) => void;
215
215
  addImportItemType: (data: GenImport | GenImport[]) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.29.23",
4
+ "version": "0.29.24",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {