bluedither 1.0.3 → 1.0.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/cli/commands/extract.js +12 -2
- package/cli/commands/publish.js +3 -1
- package/package.json +1 -1
package/cli/commands/extract.js
CHANGED
|
@@ -113,12 +113,22 @@ export default async function extract(args) {
|
|
|
113
113
|
allPresent = false;
|
|
114
114
|
}
|
|
115
115
|
} catch (e) {
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
if (e.code === 'ERR_MODULE_NOT_FOUND' || e.code === 'MODULE_NOT_FOUND') {
|
|
117
|
+
console.log(' – Skipped (ajv not installed)');
|
|
118
|
+
} else {
|
|
119
|
+
console.log(` ✗ Validation error: ${e.message}`);
|
|
120
|
+
allPresent = false;
|
|
121
|
+
}
|
|
118
122
|
}
|
|
119
123
|
}
|
|
120
124
|
}
|
|
121
125
|
|
|
122
126
|
console.log(`\n${allPresent ? '✓ Package is complete.' : '✗ Package is incomplete — missing required files.'}`);
|
|
127
|
+
|
|
128
|
+
// When called directly from CLI, exit. When imported, return result.
|
|
129
|
+
if (args._calledFromPublish) {
|
|
130
|
+
if (!allPresent) throw new Error('Package incomplete');
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
123
133
|
process.exit(allPresent ? 0 : 1);
|
|
124
134
|
}
|
package/cli/commands/publish.js
CHANGED
|
@@ -51,7 +51,9 @@ export default async function publish(args) {
|
|
|
51
51
|
console.log('\nStep 2: Validating package...');
|
|
52
52
|
const { default: extract } = await import('./extract.js');
|
|
53
53
|
try {
|
|
54
|
-
|
|
54
|
+
const validateArgs = ['--validate'];
|
|
55
|
+
validateArgs._calledFromPublish = true;
|
|
56
|
+
await extract(validateArgs);
|
|
55
57
|
} catch {
|
|
56
58
|
// extract calls process.exit on failure
|
|
57
59
|
}
|