@oamm/textor 1.0.11 → 1.0.12
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/bin/textor.js +19 -5
- package/dist/bin/textor.js.map +1 -1
- package/dist/index.cjs +22 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/textor.js
CHANGED
|
@@ -2067,7 +2067,11 @@ async function addSectionCommand(route, featurePath, options) {
|
|
|
2067
2067
|
const configSignatures = Object.values(config.signatures || {});
|
|
2068
2068
|
const isGenerated = await isTextorGenerated(routeFilePath, configSignatures);
|
|
2069
2069
|
if (!isGenerated && !options.force) {
|
|
2070
|
-
|
|
2070
|
+
if (routeFilePath.endsWith('.astro')) {
|
|
2071
|
+
console.log(`⚠ File already exists and is not managed by Textor. Adopting and merging: ${routeFilePath}`);
|
|
2072
|
+
} else {
|
|
2073
|
+
throw new Error(`File already exists: ${routeFilePath}\nUse --force to overwrite.`);
|
|
2074
|
+
}
|
|
2071
2075
|
}
|
|
2072
2076
|
}
|
|
2073
2077
|
}
|
|
@@ -4363,8 +4367,9 @@ async function adoptFile(relPath, config, state, options) {
|
|
|
4363
4367
|
else if (ext === '.js' || ext === '.jsx') signature = config.signatures.javascript;
|
|
4364
4368
|
|
|
4365
4369
|
let finalContent = content;
|
|
4370
|
+
const shouldAddSignature = signature && !content.includes(signature) && options.signature !== false;
|
|
4366
4371
|
|
|
4367
|
-
if (
|
|
4372
|
+
if (shouldAddSignature) {
|
|
4368
4373
|
if (options.dryRun) {
|
|
4369
4374
|
console.log(` ~ Would add signature to ${relPath}`);
|
|
4370
4375
|
} else {
|
|
@@ -4374,9 +4379,17 @@ async function adoptFile(relPath, config, state, options) {
|
|
|
4374
4379
|
}
|
|
4375
4380
|
} else {
|
|
4376
4381
|
if (options.dryRun) {
|
|
4377
|
-
|
|
4382
|
+
if (signature && !content.includes(signature) && options.signature === false) {
|
|
4383
|
+
console.log(` + Would adopt without signature (explicitly requested): ${relPath}`);
|
|
4384
|
+
} else {
|
|
4385
|
+
console.log(` + Would adopt (already has signature or no signature for ext): ${relPath}`);
|
|
4386
|
+
}
|
|
4378
4387
|
} else {
|
|
4379
|
-
|
|
4388
|
+
if (signature && !content.includes(signature) && options.signature === false) {
|
|
4389
|
+
console.log(` + Adopting without signature (explicitly requested): ${relPath}`);
|
|
4390
|
+
} else {
|
|
4391
|
+
console.log(` + Adopting: ${relPath}`);
|
|
4392
|
+
}
|
|
4380
4393
|
}
|
|
4381
4394
|
}
|
|
4382
4395
|
|
|
@@ -4386,7 +4399,8 @@ async function adoptFile(relPath, config, state, options) {
|
|
|
4386
4399
|
kind: inferKind(relPath, config),
|
|
4387
4400
|
hash: hash,
|
|
4388
4401
|
timestamp: new Date().toISOString(),
|
|
4389
|
-
synced: true
|
|
4402
|
+
synced: true,
|
|
4403
|
+
hasSignature: options.signature !== false
|
|
4390
4404
|
};
|
|
4391
4405
|
}
|
|
4392
4406
|
|
package/dist/bin/textor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textor.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"textor.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.cjs
CHANGED
|
@@ -1780,7 +1780,12 @@ async function addSectionCommand(route, featurePath, options) {
|
|
|
1780
1780
|
const configSignatures = Object.values(config.signatures || {});
|
|
1781
1781
|
const isGenerated = await isTextorGenerated(routeFilePath, configSignatures);
|
|
1782
1782
|
if (!isGenerated && !options.force) {
|
|
1783
|
-
|
|
1783
|
+
if (routeFilePath.endsWith('.astro')) {
|
|
1784
|
+
console.log(`⚠ File already exists and is not managed by Textor. Adopting and merging: ${routeFilePath}`);
|
|
1785
|
+
}
|
|
1786
|
+
else {
|
|
1787
|
+
throw new Error(`File already exists: ${routeFilePath}\nUse --force to overwrite.`);
|
|
1788
|
+
}
|
|
1784
1789
|
}
|
|
1785
1790
|
}
|
|
1786
1791
|
}
|
|
@@ -3674,7 +3679,8 @@ async function adoptFile(relPath, config, state, options) {
|
|
|
3674
3679
|
else if (ext === '.js' || ext === '.jsx')
|
|
3675
3680
|
signature = config.signatures.javascript;
|
|
3676
3681
|
let finalContent = content;
|
|
3677
|
-
|
|
3682
|
+
const shouldAddSignature = signature && !content.includes(signature) && options.signature !== false;
|
|
3683
|
+
if (shouldAddSignature) {
|
|
3678
3684
|
if (options.dryRun) {
|
|
3679
3685
|
console.log(` ~ Would add signature to ${relPath}`);
|
|
3680
3686
|
}
|
|
@@ -3686,10 +3692,20 @@ async function adoptFile(relPath, config, state, options) {
|
|
|
3686
3692
|
}
|
|
3687
3693
|
else {
|
|
3688
3694
|
if (options.dryRun) {
|
|
3689
|
-
|
|
3695
|
+
if (signature && !content.includes(signature) && options.signature === false) {
|
|
3696
|
+
console.log(` + Would adopt without signature (explicitly requested): ${relPath}`);
|
|
3697
|
+
}
|
|
3698
|
+
else {
|
|
3699
|
+
console.log(` + Would adopt (already has signature or no signature for ext): ${relPath}`);
|
|
3700
|
+
}
|
|
3690
3701
|
}
|
|
3691
3702
|
else {
|
|
3692
|
-
|
|
3703
|
+
if (signature && !content.includes(signature) && options.signature === false) {
|
|
3704
|
+
console.log(` + Adopting without signature (explicitly requested): ${relPath}`);
|
|
3705
|
+
}
|
|
3706
|
+
else {
|
|
3707
|
+
console.log(` + Adopting: ${relPath}`);
|
|
3708
|
+
}
|
|
3693
3709
|
}
|
|
3694
3710
|
}
|
|
3695
3711
|
if (!options.dryRun) {
|
|
@@ -3698,7 +3714,8 @@ async function adoptFile(relPath, config, state, options) {
|
|
|
3698
3714
|
kind: inferKind(relPath, config),
|
|
3699
3715
|
hash: hash,
|
|
3700
3716
|
timestamp: new Date().toISOString(),
|
|
3701
|
-
synced: true
|
|
3717
|
+
synced: true,
|
|
3718
|
+
hasSignature: options.signature !== false
|
|
3702
3719
|
};
|
|
3703
3720
|
}
|
|
3704
3721
|
return true;
|