@bleedingdev/modern-js-code-tools 3.9.0-ultramodern.1 → 3.9.0-ultramodern.10
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/bin/modern-api-check-files.mjs +4 -0
- package/bin/modern-api-check.mjs +4 -0
- package/dist/cjs/cli/microvertical-api-check.cjs +71 -0
- package/dist/cjs/cli/oxlint.cjs +9 -5
- package/dist/cjs/microvertical-api-baseline.cjs +677 -0
- package/dist/cjs/microvertical-api-boundary.cjs +507 -0
- package/dist/cjs/microvertical-api-owner.cjs +217 -0
- package/dist/cjs/oxlint-plugin/rules/strict-effect-api-boundaries.cjs +7 -5
- package/dist/cjs/strict-effect-runtime.cjs +411 -0
- package/dist/esm/cli/microvertical-api-check.js +33 -0
- package/dist/esm/cli/oxlint.js +10 -6
- package/dist/esm/microvertical-api-baseline.js +621 -0
- package/dist/esm/microvertical-api-boundary.js +449 -0
- package/dist/esm/microvertical-api-owner.js +162 -0
- package/dist/esm/oxlint-plugin/rules/strict-effect-api-boundaries.js +7 -5
- package/dist/esm/strict-effect-runtime.js +358 -0
- package/dist/esm-node/cli/microvertical-api-check.js +34 -0
- package/dist/esm-node/cli/oxlint.js +10 -6
- package/dist/esm-node/microvertical-api-baseline.js +622 -0
- package/dist/esm-node/microvertical-api-boundary.js +450 -0
- package/dist/esm-node/microvertical-api-owner.js +163 -0
- package/dist/esm-node/oxlint-plugin/rules/strict-effect-api-boundaries.js +7 -5
- package/dist/esm-node/strict-effect-runtime.js +359 -0
- package/dist/types/cli/microvertical-api-check.d.ts +1 -0
- package/dist/types/microvertical-api-baseline.d.ts +28 -0
- package/dist/types/microvertical-api-boundary.d.ts +32 -0
- package/dist/types/microvertical-api-owner.d.ts +6 -0
- package/dist/types/strict-effect-runtime.d.ts +10 -0
- package/package.json +25 -4
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
runMicroVerticalApiCheckCli: ()=>runMicroVerticalApiCheckCli
|
|
32
|
+
});
|
|
33
|
+
const external_microvertical_api_boundary_cjs_namespaceObject = require("../microvertical-api-boundary.cjs");
|
|
34
|
+
function runMicroVerticalApiCheckCli(args = process.argv.slice(2), filesOnly = false) {
|
|
35
|
+
let workspaceRoot = process.env.ULTRAMODERN_WORKSPACE_ROOT ?? process.cwd();
|
|
36
|
+
let baselinePackageDirectory;
|
|
37
|
+
for(let index = 0; index < args.length; index += 1){
|
|
38
|
+
const argument = args[index];
|
|
39
|
+
if ('--help' === argument || '-h' === argument) {
|
|
40
|
+
console.log(`${filesOnly ? 'modern-api-check-files' : 'modern-api-check'} [--workspace-root <path>] [--baseline-package-directory <path>]\n${filesOnly ? 'Checks consumer files, contracts, package exports and owner identity. Does not analyze runtime topology; run the strict Effect source phase separately.' : 'Checks consumer files, contracts, package exports, owner identity and runtime topology once per API entry.'}\nWorkspace defaults to ULTRAMODERN_WORKSPACE_ROOT then cwd. Exit codes: 0 valid, 1 consumer violation, 2 tool/configuration failure.`);
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
if (![
|
|
44
|
+
'--workspace-root',
|
|
45
|
+
'--baseline-package-directory'
|
|
46
|
+
].includes(argument ?? '') || !args[index + 1] || args[index + 1]?.startsWith('--')) {
|
|
47
|
+
console.error(`Invalid argument: ${argument ?? ''}. Use --help.`);
|
|
48
|
+
return 2;
|
|
49
|
+
}
|
|
50
|
+
const value = args[++index];
|
|
51
|
+
if ('--workspace-root' === argument) workspaceRoot = value;
|
|
52
|
+
else baselinePackageDirectory = value;
|
|
53
|
+
}
|
|
54
|
+
const result = (filesOnly ? external_microvertical_api_boundary_cjs_namespaceObject.checkMicroVerticalApiConsumerFiles : external_microvertical_api_boundary_cjs_namespaceObject.checkMicroVerticalApiBoundaries)({
|
|
55
|
+
workspaceRoot,
|
|
56
|
+
baselinePackageDirectory
|
|
57
|
+
});
|
|
58
|
+
for (const diagnostic of result.diagnostics)console.error(`API violation: ${diagnostic}`);
|
|
59
|
+
for (const error of result.toolErrors)console.error(`API tool error: ${error}`);
|
|
60
|
+
if (result.toolErrors.length) return 2;
|
|
61
|
+
if (result.diagnostics.length) return 1;
|
|
62
|
+
console.log(`UltraModern API ${filesOnly ? 'consumer files' : 'boundary'} check passed.`);
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
exports.runMicroVerticalApiCheckCli = __webpack_exports__.runMicroVerticalApiCheckCli;
|
|
66
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
67
|
+
"runMicroVerticalApiCheckCli"
|
|
68
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
69
|
+
Object.defineProperty(exports, '__esModule', {
|
|
70
|
+
value: true
|
|
71
|
+
});
|
package/dist/cjs/cli/oxlint.cjs
CHANGED
|
@@ -121,22 +121,26 @@ const runOxlintRules = ({ cwd, targets, rules })=>{
|
|
|
121
121
|
stdout: '',
|
|
122
122
|
stderr: ''
|
|
123
123
|
};
|
|
124
|
+
const pluginPath = resolvePluginPath();
|
|
124
125
|
const tempDir = external_node_fs_default().mkdtempSync(external_node_path_default().join(external_node_os_default().tmpdir(), 'modern-code-tools-oxlint-'));
|
|
125
126
|
const configPath = external_node_path_default().join(tempDir, 'oxlint.config.mjs');
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
const adapterPath = external_node_path_default().join(tempDir, 'oxlint-plugin.mjs');
|
|
128
|
+
try {
|
|
129
|
+
external_node_fs_default().writeFileSync(adapterPath, `import plugin from ${JSON.stringify((0, external_node_url_namespaceObject.pathToFileURL)(pluginPath).href)};
|
|
130
|
+
export default plugin.rules ? plugin : plugin.default;
|
|
131
|
+
`, 'utf-8');
|
|
132
|
+
external_node_fs_default().writeFileSync(configPath, `export default {
|
|
133
|
+
jsPlugins: [${JSON.stringify(adapterPath)}],
|
|
129
134
|
rules: ${JSON.stringify(rules, null, 2)}
|
|
130
135
|
};
|
|
131
136
|
`, 'utf-8');
|
|
132
|
-
try {
|
|
133
137
|
const result = (0, external_node_child_process_namespaceObject.spawnSync)(process.execPath, [
|
|
134
138
|
resolveOxlintBin(),
|
|
135
139
|
...resolvedTargets,
|
|
136
140
|
'--config',
|
|
137
141
|
configPath,
|
|
138
142
|
'--format',
|
|
139
|
-
'
|
|
143
|
+
'default',
|
|
140
144
|
'--quiet'
|
|
141
145
|
], {
|
|
142
146
|
cwd,
|