@modern-js/module-tools 2.38.0 → 2.39.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.
Files changed (2) hide show
  1. package/dist/utils/dts.js +9 -1
  2. package/package.json +14 -14
package/dist/utils/dts.js CHANGED
@@ -129,7 +129,15 @@ const writeDtsFiles = async (config, options, result) => {
129
129
  const { tempDistAbsSrcPath } = options;
130
130
  await Promise.all(result.map(({ path, content }) => {
131
131
  const relativePath = (0, import_path.relative)(tempDistAbsSrcPath, path);
132
- const filepath = (0, import_path.join)(distPath, relativePath.replace(/\.d\.ts/, dtsExtension));
132
+ const filepath = (0, import_path.join)(
133
+ distPath,
134
+ // We confirm that users will not mix ts and c(m)ts files in their projects.
135
+ // If a mix is required, please configure separate buildConfig to handle different inputs.
136
+ // So we don't replace .d.(c|m)ts that generated by tsc directly, this can confirm that
137
+ // users can use c(m)ts directly rather than enable autoExtension, in this condition,
138
+ // users need to set esbuild out-extensions like { '.js': '.mjs' }
139
+ relativePath.replace(/\.d\.ts/, dtsExtension)
140
+ );
133
141
  import_utils.fs.ensureFileSync(filepath);
134
142
  return import_utils.fs.writeFile(
135
143
  // only replace .d.ts, if tsc generate .d.m(c)ts, keep.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modern-js/module-tools",
3
- "version": "2.38.0",
3
+ "version": "2.39.0",
4
4
  "description": "Simple, powerful, high-performance modern npm package development solution.",
5
5
  "keywords": [
6
6
  "modern",
@@ -71,15 +71,15 @@
71
71
  "tapable": "2.2.1",
72
72
  "terser": "5.19.2",
73
73
  "tsconfig-paths-webpack-plugin": "4.1.0",
74
- "@modern-js/core": "2.38.0",
75
- "@modern-js/new-action": "2.38.0",
76
- "@modern-js/plugin": "2.38.0",
77
- "@modern-js/plugin-changeset": "2.38.0",
78
- "@modern-js/plugin-i18n": "2.38.0",
79
- "@modern-js/plugin-lint": "2.38.0",
80
- "@modern-js/types": "2.38.0",
81
- "@modern-js/upgrade": "2.38.0",
82
- "@modern-js/utils": "2.38.0"
74
+ "@modern-js/new-action": "2.39.0",
75
+ "@modern-js/core": "2.39.0",
76
+ "@modern-js/plugin": "2.39.0",
77
+ "@modern-js/plugin-changeset": "2.39.0",
78
+ "@modern-js/plugin-i18n": "2.39.0",
79
+ "@modern-js/plugin-lint": "2.39.0",
80
+ "@modern-js/types": "2.39.0",
81
+ "@modern-js/upgrade": "2.39.0",
82
+ "@modern-js/utils": "2.39.0"
83
83
  },
84
84
  "devDependencies": {
85
85
  "@types/babel__generator": "7.6.4",
@@ -87,10 +87,10 @@
87
87
  "@types/convert-source-map": "1.5.2",
88
88
  "@types/node": "^14",
89
89
  "typescript": "^5",
90
- "@modern-js/builder-webpack-provider": "2.38.0",
91
- "@modern-js/self": "npm:@modern-js/module-tools@2.38.0",
92
- "@scripts/build": "2.38.0",
93
- "@scripts/vitest-config": "2.38.0"
90
+ "@modern-js/builder-webpack-provider": "2.39.0",
91
+ "@modern-js/self": "npm:@modern-js/module-tools@2.39.0",
92
+ "@scripts/build": "2.39.0",
93
+ "@scripts/vitest-config": "2.39.0"
94
94
  },
95
95
  "peerDependencies": {
96
96
  "typescript": "^4 || ^5"