smartbundle 0.8.0-alpha.1 → 0.8.0

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.
@@ -57,12 +57,13 @@ async function callTypescript({
57
57
  const program = ts.createProgram(files, parsedCommandLine.options, host);
58
58
  program.emit(void 0, (fileName, data) => {
59
59
  const relativePath = path__namespace.relative(sourceDir, fileName);
60
- const esmFinalPath = path__namespace.join(outDir, relativePath);
60
+ const finalPath = path__namespace.join(outDir, relativePath);
61
+ const esmFinalPath = finalPath.replace(/\.d\.ts$/, ".d.mts");
61
62
  const sourceFileName = fileName.replace(/\.d\.ts$/, ".ts");
62
63
  sourceToDtsMap.set(esmFinalPath, sourceFileName);
63
64
  fs__namespace.mkdirSync(path__namespace.dirname(esmFinalPath), { recursive: true });
64
65
  fs__namespace.writeFileSync(esmFinalPath, data);
65
- const cjsFinalPath = esmFinalPath.replace(/\.d\.ts$/, ".d.cts");
66
+ const cjsFinalPath = finalPath.replace(/\.d\.ts$/, ".d.ts");
66
67
  fs__namespace.writeFileSync(cjsFinalPath, data);
67
68
  sourceToDtsMap.set(cjsFinalPath, sourceFileName);
68
69
  });
@@ -37,12 +37,13 @@ async function callTypescript({
37
37
  const program = ts.createProgram(files, parsedCommandLine.options, host);
38
38
  program.emit(void 0, (fileName, data) => {
39
39
  const relativePath = path.relative(sourceDir, fileName);
40
- const esmFinalPath = path.join(outDir, relativePath);
40
+ const finalPath = path.join(outDir, relativePath);
41
+ const esmFinalPath = finalPath.replace(/\.d\.ts$/, ".d.mts");
41
42
  const sourceFileName = fileName.replace(/\.d\.ts$/, ".ts");
42
43
  sourceToDtsMap.set(esmFinalPath, sourceFileName);
43
44
  fs.mkdirSync(path.dirname(esmFinalPath), { recursive: true });
44
45
  fs.writeFileSync(esmFinalPath, data);
45
- const cjsFinalPath = esmFinalPath.replace(/\.d\.ts$/, ".d.cts");
46
+ const cjsFinalPath = finalPath.replace(/\.d\.ts$/, ".d.ts");
46
47
  fs.writeFileSync(cjsFinalPath, data);
47
48
  sourceToDtsMap.set(cjsFinalPath, sourceFileName);
48
49
  });
@@ -18,19 +18,19 @@ async function writePackageJson(outDir, parsed, { exportsMap, binsMap }) {
18
18
  const anExport = {};
19
19
  if (value.mjs) {
20
20
  anExport.import = {};
21
- if (value.dts) {
22
- anExport.import.types = value.dts;
21
+ if (value.dmts) {
22
+ anExport.import.types = value.dmts;
23
23
  }
24
24
  anExport.import.default = value.mjs;
25
25
  }
26
26
  if (value.cjs) {
27
27
  anExport.require = {};
28
- if (value.cdts) {
29
- anExport.require.types = value.cdts;
28
+ if (value.dcts) {
29
+ anExport.require.types = value.dcts;
30
30
  }
31
31
  anExport.require.default = value.cjs;
32
32
  }
33
- anExport.types = value.cdts ?? value.dts;
33
+ anExport.types = value.dcts ?? value.dmts;
34
34
  anExport.default = value.cjs;
35
35
  allExports[key] = anExport;
36
36
  }
@@ -16,19 +16,19 @@ async function writePackageJson(outDir, parsed, { exportsMap, binsMap }) {
16
16
  const anExport = {};
17
17
  if (value.mjs) {
18
18
  anExport.import = {};
19
- if (value.dts) {
20
- anExport.import.types = value.dts;
19
+ if (value.dmts) {
20
+ anExport.import.types = value.dmts;
21
21
  }
22
22
  anExport.import.default = value.mjs;
23
23
  }
24
24
  if (value.cjs) {
25
25
  anExport.require = {};
26
- if (value.cdts) {
27
- anExport.require.types = value.cdts;
26
+ if (value.dcts) {
27
+ anExport.require.types = value.dcts;
28
28
  }
29
29
  anExport.require.default = value.cjs;
30
30
  }
31
- anExport.types = value.cdts ?? value.dts;
31
+ anExport.types = value.dcts ?? value.dmts;
32
32
  anExport.default = value.cjs;
33
33
  allExports[key] = anExport;
34
34
  }
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "smartbundle",
3
3
  "type": "commonjs",
4
- "version": "0.8.0-alpha.1",
4
+ "version": "0.8.0",
5
5
  "bin": {
6
6
  "smartbundle": "__bin__/smartbundle.js"
7
7
  },
8
- "types": "./src/index.d.cts",
8
+ "types": "./src/index.d.ts",
9
9
  "module": "./src/index.mjs",
10
10
  "main": "./src/index.js",
11
11
  "description": "zero-config bundler for npm packages",
12
12
  "exports": {
13
13
  ".": {
14
14
  "import": {
15
- "types": "./src/index.d.ts",
15
+ "types": "./src/index.d.mts",
16
16
  "default": "./src/index.mjs"
17
17
  },
18
18
  "require": {
19
- "types": "./src/index.d.cts",
19
+ "types": "./src/index.d.ts",
20
20
  "default": "./src/index.js"
21
21
  },
22
- "types": "./src/index.d.cts",
22
+ "types": "./src/index.d.ts",
23
23
  "default": "./src/index.js"
24
24
  },
25
25
  "./package.json": "./package.json"
package/src/index.js CHANGED
@@ -61,10 +61,10 @@ async function run(args) {
61
61
  for (const [types, source] of res) {
62
62
  setExports(exportsMap, source, (entry) => {
63
63
  if (types.endsWith(".d.ts")) {
64
- entry.dts = "./" + path.relative(outDir, types);
64
+ entry.dcts = "./" + path.relative(outDir, types);
65
65
  }
66
- if (types.endsWith(".d.cts")) {
67
- entry.cdts = "./" + path.relative(outDir, types);
66
+ if (types.endsWith(".d.mts")) {
67
+ entry.dmts = "./" + path.relative(outDir, types);
68
68
  }
69
69
  return entry;
70
70
  });
package/src/index.mjs CHANGED
@@ -59,10 +59,10 @@ async function run(args) {
59
59
  for (const [types, source] of res) {
60
60
  setExports(exportsMap, source, (entry) => {
61
61
  if (types.endsWith(".d.ts")) {
62
- entry.dts = "./" + relative(outDir, types);
62
+ entry.dcts = "./" + relative(outDir, types);
63
63
  }
64
- if (types.endsWith(".d.cts")) {
65
- entry.cdts = "./" + relative(outDir, types);
64
+ if (types.endsWith(".d.mts")) {
65
+ entry.dmts = "./" + relative(outDir, types);
66
66
  }
67
67
  return entry;
68
68
  });
@@ -1,8 +1,8 @@
1
1
  import { type PackageJson } from "./packageJson.js";
2
2
  export type ExportsObject = {
3
3
  mjs?: string;
4
- dts?: string;
5
- cdts?: string;
4
+ dmts?: string;
5
+ dcts?: string;
6
6
  cjs?: string;
7
7
  raw?: string;
8
8
  };
@@ -1,8 +1,8 @@
1
1
  import { type PackageJson } from "./packageJson.js";
2
2
  export type ExportsObject = {
3
3
  mjs?: string;
4
- dts?: string;
5
- cdts?: string;
4
+ dmts?: string;
5
+ dcts?: string;
6
6
  cjs?: string;
7
7
  raw?: string;
8
8
  };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes