powerlines 0.37.55 → 0.37.56
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/api.cjs +2 -2
- package/dist/api.js +1 -1
- package/dist/astro.cjs +4 -4
- package/dist/astro.js +3 -3
- package/dist/{chunk-P24DSFF4.cjs → chunk-2ESGIL56.cjs} +3 -140
- package/dist/{chunk-6YCSSTVC.js → chunk-2VUAOV5V.js} +3 -3
- package/dist/{chunk-LX3ZZP62.js → chunk-5OE3ACWC.js} +3 -3
- package/dist/{chunk-BW5NDBWH.js → chunk-7LH63BFW.js} +3 -3
- package/dist/{chunk-CUGOCGSK.cjs → chunk-BSKRKIB5.cjs} +4 -4
- package/dist/chunk-JK5Y4ABM.cjs +12 -0
- package/dist/{chunk-XIBDIPTT.js → chunk-L4OM5KXO.js} +3 -139
- package/dist/{chunk-6DKPMU3L.cjs → chunk-LFHXRRZX.cjs} +5 -5
- package/dist/{chunk-3IBKHRRH.js → chunk-NUYBKMON.js} +3 -3
- package/dist/chunk-PCQFHZKL.cjs +12 -0
- package/dist/{chunk-EHCLZGBR.js → chunk-PQOEG6WQ.js} +3 -3
- package/dist/{chunk-6VDZHJEH.cjs → chunk-QQ6V5SC5.cjs} +4 -4
- package/dist/esbuild.cjs +6 -6
- package/dist/esbuild.js +3 -3
- package/dist/farm.cjs +3 -3
- package/dist/farm.js +2 -2
- package/dist/index.cjs +10 -10
- package/dist/index.js +2 -2
- package/dist/lib/{chunk-LGJOP2GH.js → chunk-CIBV7IDT.js} +3 -139
- package/dist/lib/chunk-CIBV7IDT.js.map +1 -0
- package/dist/lib/{chunk-57INYYJ7.cjs → chunk-DWKRVCBP.cjs} +3 -158
- package/dist/lib/chunk-DWKRVCBP.cjs.map +1 -0
- package/dist/lib/index.cjs +2 -2
- package/dist/lib/index.js +1 -1
- package/dist/lib/unplugin/factory.cjs +2 -2
- package/dist/lib/unplugin/factory.js +1 -1
- package/dist/lib/unplugin/index.cjs +2 -2
- package/dist/lib/unplugin/index.js +1 -1
- package/dist/next.cjs +4 -4
- package/dist/next.js +3 -3
- package/dist/nuxt.cjs +8 -8
- package/dist/nuxt.js +4 -4
- package/dist/rolldown.cjs +6 -6
- package/dist/rolldown.js +3 -3
- package/dist/rollup.cjs +3 -3
- package/dist/rollup.js +2 -2
- package/dist/rspack.cjs +3 -3
- package/dist/rspack.js +2 -2
- package/dist/tsdown.cjs +4 -4
- package/dist/tsdown.js +3 -3
- package/dist/tsup.cjs +4 -4
- package/dist/tsup.js +3 -3
- package/dist/unloader.cjs +3 -3
- package/dist/unloader.js +2 -2
- package/dist/unplugin.cjs +8 -8
- package/dist/unplugin.js +4 -4
- package/dist/vite.cjs +6 -6
- package/dist/vite.js +3 -3
- package/dist/webpack.cjs +6 -6
- package/dist/webpack.js +3 -3
- package/package.json +2 -2
- package/dist/chunk-D7545A3W.cjs +0 -12
- package/dist/chunk-YTXKB2NX.cjs +0 -12
- package/dist/lib/chunk-57INYYJ7.cjs.map +0 -1
- package/dist/lib/chunk-LGJOP2GH.js.map +0 -1
package/dist/farm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createUnpluginFactory } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
import { createUnpluginFactory } from './chunk-5OE3ACWC.js';
|
|
2
|
+
import './chunk-L4OM5KXO.js';
|
|
3
3
|
import './chunk-PQXP7XQK.js';
|
|
4
4
|
import './chunk-NITQ5IYP.js';
|
|
5
5
|
import './chunk-2MYPFASJ.js';
|
package/dist/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@ require('./chunk-4JCNAKOE.cjs');
|
|
|
13
13
|
require('./chunk-D6GGZQLC.cjs');
|
|
14
14
|
var chunkA7AUGAHH_cjs = require('./chunk-A7AUGAHH.cjs');
|
|
15
15
|
var chunk42ZHOCZJ_cjs = require('./chunk-42ZHOCZJ.cjs');
|
|
16
|
-
var
|
|
16
|
+
var chunk2ESGIL56_cjs = require('./chunk-2ESGIL56.cjs');
|
|
17
17
|
var chunkB6DVCLP5_cjs = require('./chunk-B6DVCLP5.cjs');
|
|
18
18
|
var chunkV5WOGN7O_cjs = require('./chunk-V5WOGN7O.cjs');
|
|
19
19
|
var chunkZ6ARQDHR_cjs = require('./chunk-Z6ARQDHR.cjs');
|
|
@@ -27,10 +27,10 @@ chunkPK6SKIKE_cjs.__name(defineConfig, "defineConfig");
|
|
|
27
27
|
async function createPowerlines(options = {}) {
|
|
28
28
|
options.root ??= process.cwd();
|
|
29
29
|
const workspaceRoot = getWorkspaceRoot.getWorkspaceRoot(options.root);
|
|
30
|
-
return
|
|
30
|
+
return chunk2ESGIL56_cjs.PowerlinesAPI.from(workspaceRoot, options);
|
|
31
31
|
}
|
|
32
32
|
chunkPK6SKIKE_cjs.__name(createPowerlines, "createPowerlines");
|
|
33
|
-
var index_default =
|
|
33
|
+
var index_default = chunk2ESGIL56_cjs.PowerlinesAPI;
|
|
34
34
|
|
|
35
35
|
Object.defineProperty(exports, "STORAGE_PRESETS", {
|
|
36
36
|
enumerable: true,
|
|
@@ -50,31 +50,31 @@ Object.defineProperty(exports, "HOOKS_LIST_ORDERS", {
|
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "FileId", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunk2ESGIL56_cjs.FileId; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "FileMetadata", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunk2ESGIL56_cjs.FileMetadata; }
|
|
58
58
|
});
|
|
59
59
|
Object.defineProperty(exports, "FileMetadata_KeyValuePair", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunk2ESGIL56_cjs.FileMetadata_KeyValuePair; }
|
|
62
62
|
});
|
|
63
63
|
Object.defineProperty(exports, "FileStorage", {
|
|
64
64
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunk2ESGIL56_cjs.FileStorage; }
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(exports, "FileSystem", {
|
|
68
68
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunk2ESGIL56_cjs.FileSystem; }
|
|
70
70
|
});
|
|
71
71
|
Object.defineProperty(exports, "PowerlinesAPI", {
|
|
72
72
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunk2ESGIL56_cjs.PowerlinesAPI; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "_capnpFileId", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunk2ESGIL56_cjs._capnpFileId; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "KNOWN_PLUGIN_FIELDS", {
|
|
80
80
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -9,8 +9,8 @@ import './chunk-OYASPHNL.js';
|
|
|
9
9
|
import './chunk-OD4BINRW.js';
|
|
10
10
|
export { STORAGE_PRESETS, __VFS_PATCH__, __VFS_REVERT__ } from './chunk-KXRVVFNK.js';
|
|
11
11
|
export { HOOKS_LIST_ORDERS } from './chunk-CCJQBJKQ.js';
|
|
12
|
-
import { PowerlinesAPI } from './chunk-
|
|
13
|
-
export { FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, PowerlinesAPI, _capnpFileId } from './chunk-
|
|
12
|
+
import { PowerlinesAPI } from './chunk-L4OM5KXO.js';
|
|
13
|
+
export { FileId, FileMetadata, FileMetadata_KeyValuePair, FileStorage, FileSystem, PowerlinesAPI, _capnpFileId } from './chunk-L4OM5KXO.js';
|
|
14
14
|
export { KNOWN_PLUGIN_FIELDS, PLUGIN_HOOKS_FIELDS, PLUGIN_NON_HOOK_FIELDS } from './chunk-PQXP7XQK.js';
|
|
15
15
|
export { BUILDER_VARIANTS, UNPLUGIN_BUILDER_VARIANTS } from './chunk-NITQ5IYP.js';
|
|
16
16
|
export { SUPPORTED_COMMANDS } from './chunk-2MYPFASJ.js';
|
|
@@ -11,7 +11,6 @@ import { __name } from './chunk-7QVYU63E.js';
|
|
|
11
11
|
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
12
12
|
import { getWorkspaceRoot } from '@stryke/fs/get-workspace-root';
|
|
13
13
|
import { setParseImpl } from 'unplugin';
|
|
14
|
-
import { transformAsync } from '@babel/core';
|
|
15
14
|
import { formatLogMessage } from '@storm-software/config-tools/logger/console';
|
|
16
15
|
import { toArray } from '@stryke/convert/to-array';
|
|
17
16
|
import { createDirectory } from '@stryke/fs/helpers';
|
|
@@ -34,8 +33,6 @@ import { isSetString } from '@stryke/type-checks/is-set-string';
|
|
|
34
33
|
import { isString } from '@stryke/type-checks/is-string';
|
|
35
34
|
import chalk3 from 'chalk';
|
|
36
35
|
import Handlebars from 'handlebars';
|
|
37
|
-
import { declare } from '@babel/helper-plugin-utils';
|
|
38
|
-
import * as t from '@babel/types';
|
|
39
36
|
import { isParentPath } from '@stryke/path/is-parent-path';
|
|
40
37
|
import { prettyBytes } from '@stryke/string-format/pretty-bytes';
|
|
41
38
|
import { DiagnosticCategory } from 'ts-morph';
|
|
@@ -49,107 +46,7 @@ import { titleCase } from '@stryke/string-format/title-case';
|
|
|
49
46
|
|
|
50
47
|
// package.json
|
|
51
48
|
var package_default = {
|
|
52
|
-
version: "0.37.
|
|
53
|
-
function resolveModulePath(nodePath, state) {
|
|
54
|
-
if (!t.isStringLiteral(nodePath.node)) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
const resolvedPath = state.context?.fs.resolveSync(nodePath.node.value);
|
|
58
|
-
if (resolvedPath) {
|
|
59
|
-
nodePath.replaceWith(t.stringLiteral(
|
|
60
|
-
// Remove the file extension if it exists
|
|
61
|
-
resolvedPath.replace(/\.(?:ts|mts|cts)x?$/, "")
|
|
62
|
-
));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
__name(resolveModulePath, "resolveModulePath");
|
|
66
|
-
var TRANSFORM_FUNCTIONS = [
|
|
67
|
-
"require",
|
|
68
|
-
"require.resolve",
|
|
69
|
-
"System.import",
|
|
70
|
-
// Jest methods
|
|
71
|
-
"jest.genMockFromModule",
|
|
72
|
-
"jest.mock",
|
|
73
|
-
"jest.unmock",
|
|
74
|
-
"jest.doMock",
|
|
75
|
-
// eslint-disable-next-line @cspell/spellchecker
|
|
76
|
-
"jest.dontMock",
|
|
77
|
-
"jest.setMock",
|
|
78
|
-
"jest.requireActual",
|
|
79
|
-
"jest.requireMock",
|
|
80
|
-
// Older Jest methods
|
|
81
|
-
"require.requireActual",
|
|
82
|
-
"require.requireMock"
|
|
83
|
-
];
|
|
84
|
-
function matchesPattern(state, calleePath, pattern) {
|
|
85
|
-
const { node } = calleePath;
|
|
86
|
-
if (t.isMemberExpression(node)) {
|
|
87
|
-
return calleePath.matchesPattern(pattern);
|
|
88
|
-
}
|
|
89
|
-
if (!t.isIdentifier(node) || pattern.includes(".")) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
const name = pattern.split(".")[0];
|
|
93
|
-
return node.name === name;
|
|
94
|
-
}
|
|
95
|
-
__name(matchesPattern, "matchesPattern");
|
|
96
|
-
var importVisitors = {
|
|
97
|
-
CallExpression: /* @__PURE__ */ __name((nodePath, state) => {
|
|
98
|
-
if (state.moduleResolverVisited.has(nodePath)) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const calleePath = nodePath.get("callee");
|
|
102
|
-
if (calleePath && TRANSFORM_FUNCTIONS.some((pattern) => matchesPattern(state, calleePath, pattern)) || t.isImport(nodePath.node.callee)) {
|
|
103
|
-
state.moduleResolverVisited.add(nodePath);
|
|
104
|
-
resolveModulePath(nodePath.get("arguments.0"), state);
|
|
105
|
-
}
|
|
106
|
-
}, "CallExpression"),
|
|
107
|
-
// eslint-disable-next-line ts/naming-convention
|
|
108
|
-
"ImportDeclaration|ExportDeclaration|ExportAllDeclaration": /* @__PURE__ */ __name((nodePath, state) => {
|
|
109
|
-
if (!nodePath || !nodePath.get("source") || state.moduleResolverVisited.has(nodePath)) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
state.moduleResolverVisited.add(nodePath);
|
|
113
|
-
resolveModulePath(nodePath.get("source"), state);
|
|
114
|
-
}, "ImportDeclaration|ExportDeclaration|ExportAllDeclaration")
|
|
115
|
-
};
|
|
116
|
-
var moduleResolverBabelPlugin = /* @__PURE__ */ __name((context) => {
|
|
117
|
-
return declare(/* @__PURE__ */ __name(function builder(api) {
|
|
118
|
-
let moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
119
|
-
return {
|
|
120
|
-
name: "powerlines:module-resolver",
|
|
121
|
-
manipulateOptions(opts) {
|
|
122
|
-
opts.filename ??= "unknown";
|
|
123
|
-
},
|
|
124
|
-
pre() {
|
|
125
|
-
moduleResolverVisited = /* @__PURE__ */ new Set();
|
|
126
|
-
},
|
|
127
|
-
visitor: {
|
|
128
|
-
Program: {
|
|
129
|
-
enter(programPath, state) {
|
|
130
|
-
programPath.traverse(importVisitors, {
|
|
131
|
-
...state,
|
|
132
|
-
context,
|
|
133
|
-
moduleResolverVisited,
|
|
134
|
-
api
|
|
135
|
-
});
|
|
136
|
-
},
|
|
137
|
-
exit(programPath, state) {
|
|
138
|
-
programPath.traverse(importVisitors, {
|
|
139
|
-
...state,
|
|
140
|
-
context,
|
|
141
|
-
moduleResolverVisited,
|
|
142
|
-
api
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
post() {
|
|
148
|
-
moduleResolverVisited.clear();
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
}, "builder"));
|
|
152
|
-
}, "moduleResolverBabelPlugin");
|
|
49
|
+
version: "0.37.55"};
|
|
153
50
|
function formatTypes(code) {
|
|
154
51
|
return code.replace(
|
|
155
52
|
// eslint-disable-next-line regexp/no-super-linear-backtracking
|
|
@@ -565,39 +462,6 @@ ${formatLogMessage({
|
|
|
565
462
|
}
|
|
566
463
|
context.debug("Transforming built-ins runtime modules files.");
|
|
567
464
|
const builtinFilePaths = await Promise.all((await context.getBuiltins()).map(async (file) => {
|
|
568
|
-
const result2 = await transformAsync(file.code.toString(), {
|
|
569
|
-
highlightCode: true,
|
|
570
|
-
code: true,
|
|
571
|
-
ast: false,
|
|
572
|
-
cloneInputAst: false,
|
|
573
|
-
comments: true,
|
|
574
|
-
sourceType: "module",
|
|
575
|
-
configFile: false,
|
|
576
|
-
babelrc: false,
|
|
577
|
-
envName: context.config.mode,
|
|
578
|
-
caller: {
|
|
579
|
-
name: "powerlines"
|
|
580
|
-
},
|
|
581
|
-
...context.config.transform.babel,
|
|
582
|
-
filename: file.path,
|
|
583
|
-
plugins: [
|
|
584
|
-
[
|
|
585
|
-
"@babel/plugin-syntax-typescript"
|
|
586
|
-
],
|
|
587
|
-
[
|
|
588
|
-
moduleResolverBabelPlugin(context)
|
|
589
|
-
]
|
|
590
|
-
]
|
|
591
|
-
});
|
|
592
|
-
if (!result2?.code) {
|
|
593
|
-
throw new Error(`Powerlines - Generate Types failed to compile ${file.id}`);
|
|
594
|
-
}
|
|
595
|
-
if (!file.id) {
|
|
596
|
-
context.warn(`File ID is missing for a built-in runtime file at ${file.path}.`);
|
|
597
|
-
file.id = replacePath(replacePath(file.path, context.workspaceConfig.workspaceRoot), context.builtinsPath);
|
|
598
|
-
}
|
|
599
|
-
context.trace(`Writing transformed built-in runtime file ${file.id}.`);
|
|
600
|
-
await context.emitBuiltin(result2.code, file.id);
|
|
601
465
|
return appendPath(file.path, context.builtinsPath);
|
|
602
466
|
}));
|
|
603
467
|
const typescriptPath = await resolvePackage("typescript");
|
|
@@ -1243,5 +1107,5 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
1243
1107
|
__name(createUnpluginFactory, "createUnpluginFactory");
|
|
1244
1108
|
|
|
1245
1109
|
export { createUnpluginFactory };
|
|
1246
|
-
//# sourceMappingURL=chunk-
|
|
1247
|
-
//# sourceMappingURL=chunk-
|
|
1110
|
+
//# sourceMappingURL=chunk-CIBV7IDT.js.map
|
|
1111
|
+
//# sourceMappingURL=chunk-CIBV7IDT.js.map
|