@knighted/duel 1.0.0-rc.4 → 1.0.0-rc.5
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/README.md +1 -1
- package/dist/duel.cjs +3 -5
- package/dist/duel.js +3 -5
- package/dist/init.cjs +1 -1
- package/dist/init.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -116,5 +116,5 @@ These are definitely edge cases, and would only really come up if your project m
|
|
|
116
116
|
|
|
117
117
|
## Notes
|
|
118
118
|
|
|
119
|
-
As far as I can tell, `duel` is one (if not the only) way to get a correct dual package build using
|
|
119
|
+
As far as I can tell, `duel` is one (if not the only) way to get a correct dual package build using `tsc` while using only **one package.json** file and **one tsconfig.json** file, _and also preserving module system by file extension_. The Microsoft backed TypeScript team [keep](https://github.com/microsoft/TypeScript/issues/54593) [talking](https://github.com/microsoft/TypeScript/pull/54546) about dual build support, but their philosophy is mainly one of self-preservation, rather than collaboration. For instance, they continue to [refuse to rewrite specifiers](https://github.com/microsoft/TypeScript/issues/16577). The downside of their decisions, and the fact that `npm` does not support using alternative names for the package.json file, is that `duel` must copy your project
|
|
120
120
|
directory before attempting to run the builds in parallel.
|
package/dist/duel.cjs
CHANGED
|
@@ -92,10 +92,6 @@ const duel = async args => {
|
|
|
92
92
|
const logSuccess = start => {
|
|
93
93
|
(0, _util.log)(`Successfully created a dual ${isCjsBuild ? 'CJS' : 'ESM'} build in ${Math.round(_nodePerf_hooks.performance.now() - start)}ms.`);
|
|
94
94
|
};
|
|
95
|
-
await (0, _promises.rm)(absoluteOutDir, {
|
|
96
|
-
force: true,
|
|
97
|
-
recursive: true
|
|
98
|
-
});
|
|
99
95
|
if (parallel) {
|
|
100
96
|
const paraName = `_${hex}_`;
|
|
101
97
|
const paraParent = (0, _nodePath.join)(projectDir, '..');
|
|
@@ -153,7 +149,9 @@ const duel = async args => {
|
|
|
153
149
|
});
|
|
154
150
|
await updateSpecifiersAndFileExtensions(filenames);
|
|
155
151
|
// Copy over and cleanup
|
|
156
|
-
await (0, _promises.
|
|
152
|
+
await (0, _promises.cp)(absoluteDualOutDir, (0, _nodePath.join)(absoluteOutDir, isCjsBuild ? 'cjs' : 'esm'), {
|
|
153
|
+
recursive: true
|
|
154
|
+
});
|
|
157
155
|
await (0, _promises.rm)(paraTempDir, {
|
|
158
156
|
force: true,
|
|
159
157
|
recursive: true
|
package/dist/duel.js
CHANGED
|
@@ -86,10 +86,6 @@ const duel = async args => {
|
|
|
86
86
|
const logSuccess = start => {
|
|
87
87
|
log(`Successfully created a dual ${isCjsBuild ? 'CJS' : 'ESM'} build in ${Math.round(performance.now() - start)}ms.`);
|
|
88
88
|
};
|
|
89
|
-
await rm(absoluteOutDir, {
|
|
90
|
-
force: true,
|
|
91
|
-
recursive: true
|
|
92
|
-
});
|
|
93
89
|
if (parallel) {
|
|
94
90
|
const paraName = `_${hex}_`;
|
|
95
91
|
const paraParent = join(projectDir, '..');
|
|
@@ -147,7 +143,9 @@ const duel = async args => {
|
|
|
147
143
|
});
|
|
148
144
|
await updateSpecifiersAndFileExtensions(filenames);
|
|
149
145
|
// Copy over and cleanup
|
|
150
|
-
await
|
|
146
|
+
await cp(absoluteDualOutDir, join(absoluteOutDir, isCjsBuild ? 'cjs' : 'esm'), {
|
|
147
|
+
recursive: true
|
|
148
|
+
});
|
|
151
149
|
await rm(paraTempDir, {
|
|
152
150
|
force: true,
|
|
153
151
|
recursive: true
|
package/dist/init.cjs
CHANGED
|
@@ -109,7 +109,7 @@ const init = async args => {
|
|
|
109
109
|
return false;
|
|
110
110
|
}
|
|
111
111
|
if (!tsconfig.compilerOptions?.outDir) {
|
|
112
|
-
(0, _util.log)('No
|
|
112
|
+
(0, _util.log)('No outDir defined in tsconfig.json. Build output will be in "dist".');
|
|
113
113
|
}
|
|
114
114
|
const projectDir = (0, _nodePath.dirname)(configPath);
|
|
115
115
|
return {
|
package/dist/init.js
CHANGED
|
@@ -103,7 +103,7 @@ const init = async args => {
|
|
|
103
103
|
return false;
|
|
104
104
|
}
|
|
105
105
|
if (!tsconfig.compilerOptions?.outDir) {
|
|
106
|
-
log('No
|
|
106
|
+
log('No outDir defined in tsconfig.json. Build output will be in "dist".');
|
|
107
107
|
}
|
|
108
108
|
const projectDir = dirname(configPath);
|
|
109
109
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knighted/duel",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.5",
|
|
4
4
|
"description": "TypeScript dual packages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"c8": "^8.0.1",
|
|
53
53
|
"eslint": "^8.45.0",
|
|
54
54
|
"eslint-plugin-n": "^16.0.1",
|
|
55
|
-
"prettier": "^3.0.
|
|
55
|
+
"prettier": "^3.0.1",
|
|
56
56
|
"typescript": "^5.2.0-dev.20230727"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|