@astral/pack 2.0.0 → 2.0.1
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
CHANGED
|
@@ -44,7 +44,8 @@ module.exports = defineConfig({
|
|
|
44
44
|
```json
|
|
45
45
|
{
|
|
46
46
|
"exports": {
|
|
47
|
-
"./components/Button": "./components/Button/index.
|
|
47
|
+
"./components/Button": "./components/Button/index.ts",
|
|
48
|
+
"./components/Input": "./components/Button/index.tsx"
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
```
|
|
@@ -66,6 +67,13 @@ module.exports = defineConfig({
|
|
|
66
67
|
"types": "./components/Button/index.d.ts",
|
|
67
68
|
"default": "./components/Button/index.js",
|
|
68
69
|
"import": "./components/Button/index.js"
|
|
70
|
+
},
|
|
71
|
+
"./components/Input": {
|
|
72
|
+
"module": "./components/Input/index.js",
|
|
73
|
+
"require": "./node/components/Input/index.js",
|
|
74
|
+
"types": "./components/Input/index.d.ts",
|
|
75
|
+
"default": "./components/Input/index.js",
|
|
76
|
+
"import": "./components/Input/index.js"
|
|
69
77
|
}
|
|
70
78
|
}
|
|
71
79
|
}
|
|
@@ -138,7 +146,7 @@ pack create-release
|
|
|
138
146
|
{
|
|
139
147
|
"exports": {
|
|
140
148
|
"./server": "./server/index.js",
|
|
141
|
-
"./components/Button": "./components/Button/index.
|
|
149
|
+
"./components/Button": "./components/Button/index.tsx"
|
|
142
150
|
}
|
|
143
151
|
}
|
|
144
152
|
```
|
|
@@ -160,6 +168,13 @@ pack create-release
|
|
|
160
168
|
"types": "./server/index.d.ts",
|
|
161
169
|
"default": "./server/index.js",
|
|
162
170
|
"import": "./server/index.js"
|
|
171
|
+
},
|
|
172
|
+
"./components/Button": {
|
|
173
|
+
"module": "./components/Button/index.js",
|
|
174
|
+
"require": "./node/components/Button/index.js",
|
|
175
|
+
"types": "./components/Button/index.d.ts",
|
|
176
|
+
"default": "./components/Button/index.js",
|
|
177
|
+
"import": "./components/Button/index.js"
|
|
163
178
|
}
|
|
164
179
|
}
|
|
165
180
|
}
|
|
@@ -44,21 +44,21 @@ const initUpdatingReleaseGroup = (config, packageVersion) => (originPackageJson)
|
|
|
44
44
|
*/
|
|
45
45
|
const expandStringExport = (value, format, lang) => {
|
|
46
46
|
const exportItem = {};
|
|
47
|
+
const jsPath = value.replace(/\.(ts|tsx|jsx)$/, '.js');
|
|
47
48
|
if (format.includes('esm')) {
|
|
48
|
-
exportItem.module =
|
|
49
|
+
exportItem.module = jsPath;
|
|
49
50
|
}
|
|
50
51
|
if (format.includes('cjs')) {
|
|
51
52
|
// Добавляем ./node/ перед путем для require
|
|
52
|
-
exportItem.require =
|
|
53
|
-
? `./node/${
|
|
54
|
-
: `./node/${
|
|
53
|
+
exportItem.require = jsPath.startsWith('./')
|
|
54
|
+
? `./node/${jsPath.slice(2)}`
|
|
55
|
+
: `./node/${jsPath}`;
|
|
55
56
|
}
|
|
56
57
|
if (lang === 'ts') {
|
|
57
|
-
|
|
58
|
-
exportItem.types = value.replace(/\.js$/, '.d.ts');
|
|
58
|
+
exportItem.types = jsPath.replace(/\.js$/, '.d.ts');
|
|
59
59
|
}
|
|
60
|
-
exportItem.default =
|
|
61
|
-
exportItem.import =
|
|
60
|
+
exportItem.default = jsPath;
|
|
61
|
+
exportItem.import = jsPath;
|
|
62
62
|
return exportItem;
|
|
63
63
|
};
|
|
64
64
|
/**
|