unrun 0.2.17 → 0.2.19

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.
package/dist/cli.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import process from "node:process";
2
3
 
3
4
  //#region src/cli.ts
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { n as unrunCli, r as unrunSync, t as unrun } from "./src-cjoQe9CR.mjs";
1
+ import { n as unrunCli, r as unrunSync, t as unrun } from "./src-OFTjuv5c.mjs";
2
2
 
3
3
  export { unrun, unrunCli, unrunSync };
@@ -87,21 +87,6 @@ function isBuiltinModuleSpecifier(id) {
87
87
  if (!id) return false;
88
88
  return BUILTIN_MODULE_SPECIFIERS.has(id) || id.startsWith("node:");
89
89
  }
90
- /**
91
- * Removes Rollup-style query/hash suffixes from importer paths, falling back when importer is virtual or missing.
92
- */
93
- function normalizeImporterPath(importer, fallback) {
94
- if (!importer || importer.startsWith("\0")) return fallback;
95
- const [withoutQuery] = importer.split("?");
96
- return withoutQuery || fallback;
97
- }
98
- /**
99
- * Checks if `child` is inside `parent` directory.
100
- */
101
- function isPathWithinDirectory(parent, child) {
102
- const relative = path.relative(parent, child);
103
- return relative === "" || !relative.startsWith("..") && !path.isAbsolute(relative);
104
- }
105
90
 
106
91
  //#endregion
107
92
  //#region src/features/external.ts
@@ -124,19 +109,10 @@ function createExternalResolver(options) {
124
109
  }
125
110
  return false;
126
111
  };
127
- return function external(id, importer) {
112
+ return function external(id) {
128
113
  if (!id || id.startsWith("\0")) return false;
129
114
  if (id.startsWith(".") || id.startsWith("#") || path.isAbsolute(id)) return false;
130
115
  if (isBuiltinModuleSpecifier(id)) return true;
131
- const importerPath = normalizeImporterPath(importer, options.path);
132
- try {
133
- const containingNodeModules = findContainingNodeModules(createRequire(importerPath).resolve(id));
134
- if (!containingNodeModules) return false;
135
- const ownerDir = path.dirname(containingNodeModules);
136
- const ownerInsideEntry = isPathWithinDirectory(entryDir, ownerDir);
137
- const entryInsideOwner = isPathWithinDirectory(ownerDir, entryDir);
138
- if (ownerInsideEntry && !entryInsideOwner) return false;
139
- } catch {}
140
116
  if (!canResolveFromEntry(id)) return false;
141
117
  return true;
142
118
  };
@@ -151,15 +127,6 @@ function getPackageName(specifier) {
151
127
  const [name] = specifier.split("/");
152
128
  return name || void 0;
153
129
  }
154
- function findContainingNodeModules(filePath) {
155
- let current = path.dirname(filePath);
156
- const { root } = path.parse(current);
157
- while (true) {
158
- if (path.basename(current) === "node_modules") return current;
159
- if (current === root) break;
160
- current = path.dirname(current);
161
- }
162
- }
163
130
 
164
131
  //#endregion
165
132
  //#region src/plugins/console-output-customizer.ts
@@ -1,4 +1,4 @@
1
- import { t as unrun } from "../src-cjoQe9CR.mjs";
1
+ import { t as unrun } from "../src-OFTjuv5c.mjs";
2
2
  import { runAsWorker } from "synckit";
3
3
 
4
4
  //#region src/sync/worker.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unrun",
3
3
  "type": "module",
4
- "version": "0.2.17",
4
+ "version": "0.2.19",
5
5
  "description": "A tool to load and execute any JavaScript or TypeScript code at runtime.",
6
6
  "author": "Augustin Mercier <gugustinette@proton.me>",
7
7
  "license": "MIT",
@@ -42,14 +42,13 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@oxc-project/runtime": "^0.101.0",
46
45
  "rolldown": "1.0.0-beta.53"
47
46
  },
48
47
  "devDependencies": {
49
48
  "@sxzz/eslint-config": "^7.4.1",
50
49
  "@sxzz/prettier-config": "^2.2.6",
51
50
  "@types/node": "^24.10.1",
52
- "@typescript/native-preview": "7.0.0-dev.20251203.1",
51
+ "@typescript/native-preview": "7.0.0-dev.20251208.1",
53
52
  "@vitest/browser": "4.0.15",
54
53
  "@vitest/browser-playwright": "^4.0.15",
55
54
  "@webcontainer/api": "^1.6.1",
@@ -81,7 +80,7 @@
81
80
  "synckit": "^0.11.11",
82
81
  "test-ecosystem-ci": "^0.0.2",
83
82
  "tinyexec": "^1.0.2",
84
- "tsdown": "^0.17.0",
83
+ "tsdown": "^0.17.1",
85
84
  "tsx": "^4.21.0",
86
85
  "typedoc": "^0.28.15",
87
86
  "typedoc-plugin-markdown": "^4.9.0",
@@ -89,12 +88,12 @@
89
88
  "typescript": "^5.9.3",
90
89
  "unconfig": "^7.4.2",
91
90
  "unplugin-vue": "^7.1.0",
92
- "vite": "^7.2.6",
91
+ "vite": "^7.2.7",
93
92
  "vitepress": "2.0.0-alpha.12",
94
93
  "vitepress-plugin-group-icons": "^1.6.5",
95
94
  "vitest": "4.0.15",
96
95
  "vue": "^3.5.25",
97
- "vue-tsc": "^3.1.5",
96
+ "vue-tsc": "^3.1.7",
98
97
  "zod": "^4.1.13"
99
98
  },
100
99
  "prettier": "@sxzz/prettier-config",