smartbundle 0.0.2 → 0.0.4

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.
@@ -95,6 +95,9 @@ async function run(args) {
95
95
  rollupOptions: {
96
96
  plugins: [typescript],
97
97
  external: (id, parentId, isResolved) => {
98
+ if (id === packageJson.name) {
99
+ return true;
100
+ }
98
101
  if (id.startsWith("node:")) {
99
102
  return true;
100
103
  }
@@ -128,7 +131,7 @@ async function run(args) {
128
131
  }
129
132
  for (const path of exportPath) {
130
133
  setExports(exportsMap, path, (entry) => {
131
- entry.mjs = el.fileName;
134
+ entry.mjs = "./" + el.fileName;
132
135
  return entry;
133
136
  });
134
137
  }
@@ -142,7 +145,7 @@ async function run(args) {
142
145
  }
143
146
  for (const path of exportPath2) {
144
147
  setExports(exportsMap, path, (entry) => {
145
- entry.mdts = el.fileName;
148
+ entry.mdts = "./" + el.fileName;
146
149
  return entry;
147
150
  });
148
151
  }
package/package.json CHANGED
@@ -1,10 +1,21 @@
1
1
  {
2
2
  "name": "smartbundle",
3
3
  "type": "module",
4
- "version": "0.0.2",
5
- "bin": "src/bin.mjs",
4
+ "version": "0.0.4",
5
+ "bin": "./src/bin.mjs",
6
+ "types": "./src/run.d.ts",
7
+ "module": "./src/run.mjs",
6
8
  "description": "",
7
- "exports": {},
9
+ "exports": {
10
+ ".": {
11
+ "types": "./src/run.d.ts",
12
+ "import": {
13
+ "types": "./src/run.d.ts",
14
+ "default": "./src/run.mjs"
15
+ },
16
+ "default": "./src/run.mjs"
17
+ }
18
+ },
8
19
  "dependencies": {
9
20
  "@rollup/plugin-typescript": "^11.1.6",
10
21
  "vite": "^5.3.4",
package/src/bin.d.ts CHANGED
@@ -1 +1,2 @@
1
+ #!/usr/bin/env node
1
2
  export {};
package/src/bin.mjs CHANGED
@@ -1,3 +1,2 @@
1
- import { args } from "../__do_not_import_directly__/args.mjs";
2
- import { run } from "../__do_not_import_directly__/index.mjs";
3
- run(args);
1
+ #!/usr/bin/env node
2
+ import("smartbundle").then(({ main }) => main());
package/src/run.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function main(): void;
package/src/run.mjs ADDED
@@ -0,0 +1,6 @@
1
+ import { args } from "../__do_not_import_directly__/args.mjs";
2
+ import { run } from "../__do_not_import_directly__/index.mjs";
3
+ function main() {
4
+ run(args);
5
+ }
6
+ export { main };