silgi 0.41.55 → 0.41.57

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.
@@ -649,20 +649,10 @@ function transformImportPath(path, packageName, relativeTo) {
649
649
  return importPath;
650
650
  }
651
651
  function registerExportsWithHooks(silgiInstance, runtimeExports, typeExports, packageName) {
652
- function getIgnoredPatterns() {
653
- const ignored = silgiInstance.options.watchOptions?.ignored;
654
- if (!ignored)
655
- return [];
656
- if (Array.isArray(ignored))
657
- return ignored.filter((v) => typeof v === "string");
658
- if (typeof ignored === "string")
659
- return [ignored];
660
- return [];
661
- }
662
652
  silgiInstance.hook("before:scan.ts", (options) => {
663
- const ignoredPatterns = getIgnoredPatterns();
653
+ const ignored = Array.isArray(silgiInstance.options.watchOptions?.ignored) ? silgiInstance.options.watchOptions.ignored : [];
664
654
  for (const { exportName, path, uniqueId, category } of runtimeExports) {
665
- if (isWatchedPath(path, ignoredPatterns)) {
655
+ if (!isWatchedPath(path, ignored)) {
666
656
  silgiInstance.options.devServer.watch.push(path);
667
657
  }
668
658
  switch (category) {
@@ -689,9 +679,9 @@ function registerExportsWithHooks(silgiInstance, runtimeExports, typeExports, pa
689
679
  }
690
680
  });
691
681
  silgiInstance.hook("before:schema.ts", (options) => {
692
- const ignoredPatterns = getIgnoredPatterns();
682
+ const ignored = Array.isArray(silgiInstance.options.watchOptions?.ignored) ? silgiInstance.options.watchOptions.ignored : [];
693
683
  for (const { exportName, path, uniqueId, category } of typeExports) {
694
- if (isWatchedPath(path, ignoredPatterns)) {
684
+ if (!isWatchedPath(path, ignored)) {
695
685
  silgiInstance.options.devServer.watch.push(path);
696
686
  }
697
687
  if (category === "shared" || category === "context") {
@@ -842,7 +832,7 @@ async function scanSilgiExports(path, packageName, silgiInstance = useSilgiCLI()
842
832
  }
843
833
  }
844
834
  function isWatchedPath(path, ignoredPatterns) {
845
- return !micromatch.isMatch(path, ignoredPatterns);
835
+ return micromatch.isMatch(path, ignoredPatterns);
846
836
  }
847
837
 
848
838
  const MissingModuleMatcher = /Cannot find module\s+['"]?([^'")\s]+)['"]?/i;
@@ -1595,7 +1585,6 @@ async function generateApp(app, options = {}) {
1595
1585
  if (template.watch === false) {
1596
1586
  if (Array.isArray(app.options.watchOptions.ignored)) {
1597
1587
  app.options.watchOptions.ignored.push(`${template.dst || template.src}`);
1598
- app.options.devServer.watch.push(`!${template.dst || template.src}`);
1599
1588
  }
1600
1589
  }
1601
1590
  if (options.filter && !options.filter(template)) {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.41.55";
4
+ const version = "0.41.57";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  defineEventHandler,
3
- toWebRequest,
4
- defineWebSocketHandler
3
+ toWebRequest
5
4
  } from "h3";
6
5
  import {
7
6
  silgiFetch,
@@ -29,7 +28,11 @@ export async function addNitroApp(silgiContext = useSilgi()) {
29
28
  }
30
29
  const webhookServices = Object.entries(silgiContext.services).filter(([key]) => key.startsWith("websocket:")).map(([, value]) => value);
31
30
  for (const webhook of webhookServices) {
32
- nitro.router.use(webhook.path, defineWebSocketHandler(webhook.websocket || {}));
31
+ nitro.router.use(webhook.path, defineEventHandler({
32
+ handler: () => {
33
+ },
34
+ websocket: webhook.websocket || {}
35
+ }));
33
36
  }
34
37
  }
35
38
  export default addNitroApp;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.41.55",
4
+ "version": "0.41.57",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {