@ttoss/config 1.35.7 → 1.35.9
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/dist/esm/index.js +3 -2
- package/dist/index.js +3 -2
- package/package.json +3 -3
package/dist/esm/index.js
CHANGED
|
@@ -215,8 +215,9 @@ var injectReactImport = /* @__PURE__ */__name(() => {
|
|
|
215
215
|
let contents = outputFile.text;
|
|
216
216
|
const usesReact = /React\./.test(contents);
|
|
217
217
|
if (usesReact) {
|
|
218
|
-
const
|
|
219
|
-
|
|
218
|
+
const hasStarReactImport = /import\s+\*\s+as\s+React\s+from\s+['"]react['"]/.test(contents);
|
|
219
|
+
const hasDefaultReactImport = /import\s+React\s+from\s+['"]react['"]/.test(contents) || /const\s+React\s+=\s+require\(['"]react['"]\)/.test(contents);
|
|
220
|
+
if (!hasStarReactImport && !hasDefaultReactImport) {
|
|
220
221
|
const bannerMatch = contents.match(/^((?:\/\/[^\n]*\n|\/\*[^]*?\*\/)\s*)*/);
|
|
221
222
|
const insertPosition = bannerMatch ? bannerMatch[0].length : 0;
|
|
222
223
|
const isESM = /\bimport\b|\bexport\b/.test(contents);
|
package/dist/index.js
CHANGED
|
@@ -259,8 +259,9 @@ var injectReactImport = /* @__PURE__ */__name(() => {
|
|
|
259
259
|
let contents = outputFile.text;
|
|
260
260
|
const usesReact = /React\./.test(contents);
|
|
261
261
|
if (usesReact) {
|
|
262
|
-
const
|
|
263
|
-
|
|
262
|
+
const hasStarReactImport = /import\s+\*\s+as\s+React\s+from\s+['"]react['"]/.test(contents);
|
|
263
|
+
const hasDefaultReactImport = /import\s+React\s+from\s+['"]react['"]/.test(contents) || /const\s+React\s+=\s+require\(['"]react['"]\)/.test(contents);
|
|
264
|
+
if (!hasStarReactImport && !hasDefaultReactImport) {
|
|
264
265
|
const bannerMatch = contents.match(/^((?:\/\/[^\n]*\n|\/\*[^]*?\*\/)\s*)*/);
|
|
265
266
|
const insertPosition = bannerMatch ? bannerMatch[0].length : 0;
|
|
266
267
|
const isESM = /\bimport\b|\bexport\b/.test(contents);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/config",
|
|
3
|
-
"version": "1.35.
|
|
3
|
+
"version": "1.35.9",
|
|
4
4
|
"description": "Default configuration for packages.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@jest/types": "^30.0.1",
|
|
40
40
|
"@types/jest": "^30.0.0",
|
|
41
|
-
"@types/node": "^22.
|
|
41
|
+
"@types/node": "^22.19.0",
|
|
42
42
|
"esbuild": "^0.25.8",
|
|
43
|
-
"jest": "^30.0
|
|
43
|
+
"jest": "^30.2.0",
|
|
44
44
|
"tsup": "^8.5.0"
|
|
45
45
|
},
|
|
46
46
|
"keywords": [],
|