@powerlines/nx 0.1.0 → 0.2.0
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/CHANGELOG.md +9 -0
- package/dist/{chunk-2IKNOV7W.mjs → chunk-22QO45EK.mjs} +31 -50
- package/dist/{chunk-OZMYXUES.mjs → chunk-4QSGA5A4.mjs} +25 -159
- package/dist/{chunk-WKH7IEJU.js → chunk-F3B56YER.js} +2 -2
- package/dist/{chunk-O6BSKBJP.js → chunk-JIRHFIPP.js} +2 -2
- package/dist/{chunk-6ZABD5GY.js → chunk-K6XBJH2L.js} +2 -2
- package/dist/{chunk-3QPPK4K2.js → chunk-KVN36KM4.js} +2 -2
- package/dist/{chunk-E6VIOC6R.mjs → chunk-LRQS76FH.mjs} +1 -1
- package/dist/{chunk-ESI25Y6Y.mjs → chunk-PSSLJDP5.mjs} +1 -1
- package/dist/{chunk-6UG6SXHV.js → chunk-SH2Y2OGJ.js} +25 -159
- package/dist/{chunk-FXCIWWXO.mjs → chunk-U6AMKLJF.mjs} +1 -1
- package/dist/{chunk-AKX3TTDA.js → chunk-VRETYARN.js} +2 -2
- package/dist/{chunk-5K7DMFAV.mjs → chunk-Y7YQWWS2.mjs} +1 -1
- package/dist/{chunk-CQP2LCFV.mjs → chunk-YPHW2GBQ.mjs} +1 -1
- package/dist/{chunk-OOERKIVS.js → chunk-Z4BJ37JY.js} +31 -50
- package/dist/executors.js +11 -11
- package/dist/executors.mjs +6 -6
- package/dist/index.js +14 -14
- package/dist/index.mjs +7 -7
- package/dist/src/base/base-executor.js +2 -2
- package/dist/src/base/base-executor.mjs +1 -1
- package/dist/src/executors/build/executor.js +4 -4
- package/dist/src/executors/build/executor.mjs +2 -2
- package/dist/src/executors/build/schema.d.ts +85 -0
- package/dist/src/executors/build/schema.json +96 -0
- package/dist/src/executors/clean/executor.js +4 -4
- package/dist/src/executors/clean/executor.mjs +2 -2
- package/dist/src/executors/clean/schema.d.ts +75 -0
- package/dist/src/executors/clean/schema.json +77 -0
- package/dist/src/executors/docs/executor.js +4 -4
- package/dist/src/executors/docs/executor.mjs +2 -2
- package/dist/src/executors/docs/schema.d.ts +75 -0
- package/dist/src/executors/docs/schema.json +77 -0
- package/dist/src/executors/lint/executor.js +4 -4
- package/dist/src/executors/lint/executor.mjs +2 -2
- package/dist/src/executors/lint/schema.d.ts +75 -0
- package/dist/src/executors/lint/schema.json +77 -0
- package/dist/src/executors/prepare/executor.js +4 -4
- package/dist/src/executors/prepare/executor.mjs +2 -2
- package/dist/src/executors/prepare/schema.d.ts +75 -0
- package/dist/src/executors/prepare/schema.json +77 -0
- package/dist/src/generators/sync/schema.d.ts +15 -0
- package/dist/src/generators/sync/schema.json +19 -0
- package/dist/src/plugin/index.d.mts +9 -0
- package/dist/src/plugin/index.d.ts +9 -0
- package/dist/src/plugin/index.js +3 -3
- package/dist/src/plugin/index.mjs +1 -1
- package/package.json +3 -3
|
@@ -26,14 +26,11 @@ var isSetObject = require('@stryke/type-checks/is-set-object');
|
|
|
26
26
|
var isSetString = require('@stryke/type-checks/is-set-string');
|
|
27
27
|
var chalk5 = require('chalk');
|
|
28
28
|
var Handlebars = require('handlebars');
|
|
29
|
-
var promises = require('fs/promises');
|
|
30
|
-
var path = require('path');
|
|
31
|
-
var typedoc = require('typedoc');
|
|
32
29
|
var json = require('@stryke/fs/json');
|
|
33
30
|
var append = require('@stryke/path/append');
|
|
34
31
|
var ts3 = require('typescript');
|
|
35
32
|
var isUndefined = require('@stryke/type-checks/is-undefined');
|
|
36
|
-
var writeFile = require('@stryke/fs/write-file');
|
|
33
|
+
var writeFile$1 = require('@stryke/fs/write-file');
|
|
37
34
|
var prettier = require('prettier');
|
|
38
35
|
var resolve = require('@stryke/fs/resolve');
|
|
39
36
|
var titleCase = require('@stryke/string-format/title-case');
|
|
@@ -63,6 +60,7 @@ var isFile = require('@stryke/fs/is-file');
|
|
|
63
60
|
var readFile = require('@stryke/fs/read-file');
|
|
64
61
|
var semverFns = require('@stryke/fs/semver-fns');
|
|
65
62
|
var getParentPath = require('@stryke/path/get-parent-path');
|
|
63
|
+
var path = require('path');
|
|
66
64
|
var _package = require('@stryke/string-format/package');
|
|
67
65
|
var core = require('@babel/core');
|
|
68
66
|
var MagicString = require('magic-string');
|
|
@@ -101,131 +99,12 @@ function _interopNamespace(e) {
|
|
|
101
99
|
var defu4__default = /*#__PURE__*/_interopDefault(defu4);
|
|
102
100
|
var chalk5__default = /*#__PURE__*/_interopDefault(chalk5);
|
|
103
101
|
var Handlebars__default = /*#__PURE__*/_interopDefault(Handlebars);
|
|
104
|
-
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
105
102
|
var ts3__default = /*#__PURE__*/_interopDefault(ts3);
|
|
106
103
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
104
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
107
105
|
var MagicString__default = /*#__PURE__*/_interopDefault(MagicString);
|
|
108
106
|
var t__namespace = /*#__PURE__*/_interopNamespace(t);
|
|
109
107
|
|
|
110
|
-
var objectToFrontmatter = /* @__PURE__ */ chunkSHUYVCID_js.__name((object = {}) => Object.entries(object).filter(([, value]) => {
|
|
111
|
-
return value !== void 0 && value !== null && value !== "" && typeof value === "string" || Array.isArray(value) && value.length > 0;
|
|
112
|
-
}).map(([key, value]) => `${key}: ${value}`).join("\n"), "objectToFrontmatter");
|
|
113
|
-
var onRendererPageEnd = /* @__PURE__ */ chunkSHUYVCID_js.__name((frontmatterObject) => (event) => {
|
|
114
|
-
if (!event.contents) {
|
|
115
|
-
return;
|
|
116
|
-
} else if (/README\.md$/.test(event.url)) {
|
|
117
|
-
event.preventDefault();
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
const frontmatter = `---
|
|
121
|
-
title: '${event.model.name}'
|
|
122
|
-
${objectToFrontmatter(frontmatterObject)}
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
`;
|
|
126
|
-
event.contents = frontmatter + event.contents;
|
|
127
|
-
}, "onRendererPageEnd");
|
|
128
|
-
var buildNavigationFromProjectReflection = /* @__PURE__ */ chunkSHUYVCID_js.__name((baseUrl = "", project) => {
|
|
129
|
-
const baseUrlWithoutTrailingSlash = baseUrl.replace(/\/$/gm, "");
|
|
130
|
-
const result = {
|
|
131
|
-
type: "flat"
|
|
132
|
-
};
|
|
133
|
-
const isGroupOfModules = /* @__PURE__ */ chunkSHUYVCID_js.__name((group) => group.title === "Modules", "isGroupOfModules");
|
|
134
|
-
const reflectionToNavItem = /* @__PURE__ */ chunkSHUYVCID_js.__name((reflection) => {
|
|
135
|
-
return {
|
|
136
|
-
title: reflection.name,
|
|
137
|
-
url: `${baseUrlWithoutTrailingSlash}/${reflection.url}`.replace(/\.md$/, "")
|
|
138
|
-
};
|
|
139
|
-
}, "reflectionToNavItem");
|
|
140
|
-
const modulesGroupToNavigationGroup = /* @__PURE__ */ chunkSHUYVCID_js.__name((module) => ({
|
|
141
|
-
items: (module.groups ?? []).flatMap((group) => group.children.map(reflectionToNavItem)),
|
|
142
|
-
name: module.name
|
|
143
|
-
}), "modulesGroupToNavigationGroup");
|
|
144
|
-
const navFromReflectionGroups = /* @__PURE__ */ chunkSHUYVCID_js.__name((groups, nav = {
|
|
145
|
-
type: "flat"
|
|
146
|
-
}) => {
|
|
147
|
-
groups.forEach((group) => {
|
|
148
|
-
if (isGroupOfModules(group)) {
|
|
149
|
-
nav.type = "modular";
|
|
150
|
-
nav.modules = group.children.map(modulesGroupToNavigationGroup);
|
|
151
|
-
} else {
|
|
152
|
-
nav.items = nav?.items?.length ? nav.items : [];
|
|
153
|
-
nav.items = nav.items.concat(group.children.flatMap(reflectionToNavItem));
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
return nav;
|
|
157
|
-
}, "navFromReflectionGroups");
|
|
158
|
-
return navFromReflectionGroups(project.groups, result);
|
|
159
|
-
}, "buildNavigationFromProjectReflection");
|
|
160
|
-
var onDeclaration = /* @__PURE__ */ chunkSHUYVCID_js.__name((entryPoints = []) => (context, reflection) => {
|
|
161
|
-
if (reflection.kind === typedoc.ReflectionKind.Module) {
|
|
162
|
-
const matchingEntryPoint = entryPoints.find((entryPoint) => entryPoint.path === reflection.sources[0].fullFileName);
|
|
163
|
-
reflection.name = matchingEntryPoint?.name ?? reflection.name;
|
|
164
|
-
}
|
|
165
|
-
}, "onDeclaration");
|
|
166
|
-
var typedocConfig = {
|
|
167
|
-
excludeExternals: true,
|
|
168
|
-
excludeInternal: true,
|
|
169
|
-
excludePrivate: true,
|
|
170
|
-
excludeProtected: true,
|
|
171
|
-
githubPages: false
|
|
172
|
-
};
|
|
173
|
-
var markdownPluginConfig = {
|
|
174
|
-
hideBreadcrumbs: true,
|
|
175
|
-
hideInPageTOC: true,
|
|
176
|
-
hidePageHeader: true,
|
|
177
|
-
hidePageTitle: true
|
|
178
|
-
};
|
|
179
|
-
var removeTrailingSlash = /* @__PURE__ */ chunkSHUYVCID_js.__name((pathString = "") => pathString.endsWith(path.sep) ? pathString.slice(0, pathString.length - 1) : pathString, "removeTrailingSlash");
|
|
180
|
-
var initTypedoc = /* @__PURE__ */ chunkSHUYVCID_js.__name(async (context, options) => {
|
|
181
|
-
const { baseUrl = "/docs/", outputPath } = options;
|
|
182
|
-
const entryPoints = options.entryPoints ?? context.entry.map((entry) => ({
|
|
183
|
-
name: entry.name || entry.output || filePathFns.findFileName(entry.file, {
|
|
184
|
-
withExtension: false
|
|
185
|
-
}),
|
|
186
|
-
path: joinPaths.joinPaths(context.config.projectRoot, entry.file)
|
|
187
|
-
}));
|
|
188
|
-
const app = await typedoc.Application.bootstrapWithPlugins({
|
|
189
|
-
...typedocConfig,
|
|
190
|
-
...markdownPluginConfig,
|
|
191
|
-
gitRevision: context.workspaceConfig.branch || "main",
|
|
192
|
-
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
193
|
-
exclude: context.tsconfig.tsconfigJson.exclude?.filter(Boolean),
|
|
194
|
-
out: outputPath,
|
|
195
|
-
basePath: baseUrl,
|
|
196
|
-
entryPoints: entryPoints?.map((e) => e.path),
|
|
197
|
-
plugin: [
|
|
198
|
-
"typedoc-plugin-markdown",
|
|
199
|
-
"powerlines/lib/typedoc/plugin"
|
|
200
|
-
],
|
|
201
|
-
theme: "powerlines",
|
|
202
|
-
readme: "none",
|
|
203
|
-
excludePrivate: true,
|
|
204
|
-
hideGenerator: true
|
|
205
|
-
}, [
|
|
206
|
-
new typedoc.TypeDocReader(),
|
|
207
|
-
new typedoc.PackageJsonReader(),
|
|
208
|
-
new typedoc.TSConfigReader()
|
|
209
|
-
]);
|
|
210
|
-
app.options.addReader(new typedoc.TSConfigReader());
|
|
211
|
-
app.converter.on(typedoc.Converter.EVENT_CREATE_DECLARATION, onDeclaration(entryPoints));
|
|
212
|
-
const getReflections = /* @__PURE__ */ chunkSHUYVCID_js.__name(async () => app.convert(), "getReflections");
|
|
213
|
-
const generateDocs = /* @__PURE__ */ chunkSHUYVCID_js.__name(async (opts) => {
|
|
214
|
-
const { outputPath: outputFolder, project, frontmatter } = opts;
|
|
215
|
-
app.renderer.on(typedoc.PageEvent.END, onRendererPageEnd(frontmatter));
|
|
216
|
-
await app.generateDocs(project, outputFolder || outputPath);
|
|
217
|
-
}, "generateDocs");
|
|
218
|
-
const generateNavigationJSON = /* @__PURE__ */ chunkSHUYVCID_js.__name(async (project, outputFolder = outputPath) => {
|
|
219
|
-
const navigation = buildNavigationFromProjectReflection(baseUrl, project);
|
|
220
|
-
await promises.writeFile(`${removeTrailingSlash(outputFolder)}/nav.json`, JSON.stringify(navigation));
|
|
221
|
-
}, "generateNavigationJSON");
|
|
222
|
-
return {
|
|
223
|
-
app,
|
|
224
|
-
generateDocs,
|
|
225
|
-
generateNavigationJSON,
|
|
226
|
-
getReflections
|
|
227
|
-
};
|
|
228
|
-
}, "initTypedoc");
|
|
229
108
|
function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig = "tsconfig.json") {
|
|
230
109
|
let tsconfigFilePath = tsconfig;
|
|
231
110
|
if (!exists.existsSync(tsconfigFilePath)) {
|
|
@@ -400,24 +279,24 @@ function addPluginHook(context, plugin, pluginHook, hooksList) {
|
|
|
400
279
|
}
|
|
401
280
|
}
|
|
402
281
|
chunkSHUYVCID_js.__name(addPluginHook, "addPluginHook");
|
|
403
|
-
async function
|
|
282
|
+
async function writeFile(log, filepath, content, skipFormat = false) {
|
|
404
283
|
try {
|
|
405
284
|
if (skipFormat) {
|
|
406
|
-
await writeFile.writeFile(filepath, content);
|
|
285
|
+
await writeFile$1.writeFile(filepath, content);
|
|
407
286
|
} else {
|
|
408
287
|
const config = await prettier.resolveConfig(filepath);
|
|
409
288
|
const formatted = await prettier.format(content, {
|
|
410
289
|
...config ?? {},
|
|
411
290
|
filepath
|
|
412
291
|
});
|
|
413
|
-
await writeFile.writeFile(filepath, formatted || "");
|
|
292
|
+
await writeFile$1.writeFile(filepath, formatted || "");
|
|
414
293
|
}
|
|
415
294
|
} catch (error) {
|
|
416
295
|
log(types.LogLevelLabel.ERROR, `Failed to write file ${filepath} to disk
|
|
417
296
|
${error?.message ? error.message : ""}`);
|
|
418
297
|
}
|
|
419
298
|
}
|
|
420
|
-
chunkSHUYVCID_js.__name(
|
|
299
|
+
chunkSHUYVCID_js.__name(writeFile, "writeFile");
|
|
421
300
|
var DEFAULT_ENVIRONMENT = "default";
|
|
422
301
|
function createEnvironment(name, userConfig) {
|
|
423
302
|
return defu4__default.default(userConfig.environments?.[name] ?? {}, {
|
|
@@ -758,7 +637,7 @@ var VirtualFileSystem = class {
|
|
|
758
637
|
* @returns Whether the ID is a valid runtime ID.
|
|
759
638
|
*/
|
|
760
639
|
isValidBuiltinId(id) {
|
|
761
|
-
return id.startsWith(`${this.#context.config.builtinPrefix}:`);
|
|
640
|
+
return id.startsWith(`${this.#context.config.output.builtinPrefix}:`);
|
|
762
641
|
}
|
|
763
642
|
/**
|
|
764
643
|
* Check if a path or ID corresponds to a virtual file.
|
|
@@ -1338,7 +1217,7 @@ var VirtualFileSystem = class {
|
|
|
1338
1217
|
if (!isSetString.isSetString(path2)) {
|
|
1339
1218
|
throw new Error(`Invalid path provided. Expected a string or a valid file path.`);
|
|
1340
1219
|
}
|
|
1341
|
-
return path2.replace(new RegExp(`^${this.#context.config.builtinPrefix}:`), "").replace(/^\\0/, "");
|
|
1220
|
+
return path2.replace(new RegExp(`^${this.#context.config.output.builtinPrefix}:`), "").replace(/^\\0/, "");
|
|
1342
1221
|
}
|
|
1343
1222
|
/**
|
|
1344
1223
|
* Converts a relative path to an absolute path based on the workspace and project root.
|
|
@@ -1362,7 +1241,7 @@ var VirtualFileSystem = class {
|
|
|
1362
1241
|
* @returns The formatted runtime ID.
|
|
1363
1242
|
*/
|
|
1364
1243
|
formatRuntimeId(id) {
|
|
1365
|
-
return `${this.#context.config.builtinPrefix}:${this.formatFilePath(id).replace(/\.[m|c]?[t|j]sx?$/, "")}`;
|
|
1244
|
+
return `${this.#context.config.output.builtinPrefix}:${this.formatFilePath(id).replace(/\.[m|c]?[t|j]sx?$/, "")}`;
|
|
1366
1245
|
}
|
|
1367
1246
|
/**
|
|
1368
1247
|
* Resolves a path or ID parameter to a corresponding virtual file path in the virtual file system (VFS).
|
|
@@ -1371,7 +1250,7 @@ var VirtualFileSystem = class {
|
|
|
1371
1250
|
* @returns The resolved file path if it exists, otherwise undefined.
|
|
1372
1251
|
*/
|
|
1373
1252
|
resolvePathName(pathOrId, options = {}) {
|
|
1374
|
-
if (pathOrId.startsWith(`${this.#context.config.builtinPrefix}:`)) {
|
|
1253
|
+
if (pathOrId.startsWith(`${this.#context.config.output.builtinPrefix}:`)) {
|
|
1375
1254
|
return false;
|
|
1376
1255
|
}
|
|
1377
1256
|
if (isType.isAbsolutePath(pathOrId)) {
|
|
@@ -1689,7 +1568,6 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1689
1568
|
configFile: config.configFile,
|
|
1690
1569
|
customLogger: config.customLogger,
|
|
1691
1570
|
logLevel: config.logLevel,
|
|
1692
|
-
builtinPrefix: config.builtinPrefix,
|
|
1693
1571
|
tsconfig: config.tsconfig,
|
|
1694
1572
|
tsconfigRaw: config.tsconfigRaw,
|
|
1695
1573
|
skipCache: config.skipCache,
|
|
@@ -1997,7 +1875,9 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1997
1875
|
output: {
|
|
1998
1876
|
outputPath: join.joinPaths("dist", cacheKey.projectRoot),
|
|
1999
1877
|
mode: "virtual",
|
|
2000
|
-
dts: join.joinPaths(cacheKey.projectRoot, "
|
|
1878
|
+
dts: join.joinPaths(cacheKey.projectRoot, "powerlines.d.ts"),
|
|
1879
|
+
builtinPrefix: "powerlines",
|
|
1880
|
+
runtimeFolder: join.joinPaths(cacheKey.projectRoot, ".powerlines"),
|
|
2001
1881
|
assets: [
|
|
2002
1882
|
{
|
|
2003
1883
|
glob: "LICENSE"
|
|
@@ -2019,7 +1899,6 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2019
1899
|
mode: "production",
|
|
2020
1900
|
projectType: "application",
|
|
2021
1901
|
logLevel: "info",
|
|
2022
|
-
builtinPrefix: "storm",
|
|
2023
1902
|
preview: false,
|
|
2024
1903
|
environments: {},
|
|
2025
1904
|
transform: {
|
|
@@ -2541,7 +2420,7 @@ export default getConfig({
|
|
|
2541
2420
|
});
|
|
2542
2421
|
`;
|
|
2543
2422
|
log(types.LogLevelLabel.INFO, `Writing a default ESLint config file to ${eslintConfigFile}`);
|
|
2544
|
-
return
|
|
2423
|
+
return writeFile(log, eslintConfigFile, eslintConfig);
|
|
2545
2424
|
}
|
|
2546
2425
|
chunkSHUYVCID_js.__name(writeDefaultEslintConfig, "writeDefaultEslintConfig");
|
|
2547
2426
|
var VALID_SEVERITY = [
|
|
@@ -2559,7 +2438,7 @@ async function writeOutputFile(log, outputFile, outputData) {
|
|
|
2559
2438
|
log(types.LogLevelLabel.ERROR, `Cannot write to output file path, it is a directory: ${filePath}`);
|
|
2560
2439
|
} else {
|
|
2561
2440
|
try {
|
|
2562
|
-
await
|
|
2441
|
+
await writeFile(log, filePath, outputData);
|
|
2563
2442
|
log(types.LogLevelLabel.INFO, `The output file has been created: ${filePath}`);
|
|
2564
2443
|
} catch (err) {
|
|
2565
2444
|
log(types.LogLevelLabel.ERROR, `There was a problem writing the output file: ${filePath}`);
|
|
@@ -3225,7 +3104,7 @@ async function resolveTsconfig(context) {
|
|
|
3225
3104
|
`).join("\n")}
|
|
3226
3105
|
`);
|
|
3227
3106
|
}
|
|
3228
|
-
await
|
|
3107
|
+
await writeFile(context.log, context.tsconfig.tsconfigFilePath, stormJson.StormJSON.stringify(updateTsconfigJson));
|
|
3229
3108
|
context.tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
3230
3109
|
if (!context.tsconfig) {
|
|
3231
3110
|
throw new Error("Failed to parse the TypeScript configuration file.");
|
|
@@ -3472,7 +3351,7 @@ ${console$1.formatLogMessage(context.config)}`);
|
|
|
3472
3351
|
for (const file of files) {
|
|
3473
3352
|
context.log(types.LogLevelLabel.TRACE, `Adding template file: ${file}`);
|
|
3474
3353
|
const template = Handlebars__default.default.compile(file);
|
|
3475
|
-
await
|
|
3354
|
+
await writeFile(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
3476
3355
|
}
|
|
3477
3356
|
await this.callNormalHook(context, "new");
|
|
3478
3357
|
if (context.config.projectType === "application") {
|
|
@@ -3480,14 +3359,14 @@ ${console$1.formatLogMessage(context.config)}`);
|
|
|
3480
3359
|
for (const file of files2) {
|
|
3481
3360
|
context.log(types.LogLevelLabel.TRACE, `Adding application template file: ${file}`);
|
|
3482
3361
|
const template = Handlebars__default.default.compile(file);
|
|
3483
|
-
await
|
|
3362
|
+
await writeFile(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
3484
3363
|
}
|
|
3485
3364
|
} else {
|
|
3486
3365
|
const files2 = await listFiles.listFiles(joinPaths.joinPaths(context.corePackagePath, "files/library/**/*.hbs"));
|
|
3487
3366
|
for (const file of files2) {
|
|
3488
3367
|
context.log(types.LogLevelLabel.TRACE, `Adding library template file: ${file}`);
|
|
3489
3368
|
const template = Handlebars__default.default.compile(file);
|
|
3490
|
-
await
|
|
3369
|
+
await writeFile(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
|
|
3491
3370
|
}
|
|
3492
3371
|
}
|
|
3493
3372
|
await this.callPostHook(context, "new");
|
|
@@ -3571,27 +3450,14 @@ ${console$1.formatLogMessage(context.config)}`);
|
|
|
3571
3450
|
async docs(inlineConfig = {
|
|
3572
3451
|
command: "docs"
|
|
3573
3452
|
}) {
|
|
3574
|
-
this.context.log(types.LogLevelLabel.INFO, "Generating documentation for the Powerlines project");
|
|
3453
|
+
this.context.log(types.LogLevelLabel.INFO, "\u{1F4D3} Generating documentation for the Powerlines project");
|
|
3575
3454
|
await this.prepare(inlineConfig);
|
|
3576
3455
|
await this.#executeEnvironments(async (context) => {
|
|
3577
|
-
context.log(types.LogLevelLabel.TRACE, "Writing
|
|
3578
|
-
await this.
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
await helpers.removeDirectory(outputPath);
|
|
3582
|
-
}
|
|
3583
|
-
await helpers.createDirectory(outputPath);
|
|
3584
|
-
await this.callNormalHook(context, "docs");
|
|
3585
|
-
const { generateDocs, getReflections } = await initTypedoc(context, {
|
|
3586
|
-
outputPath
|
|
3456
|
+
context.log(types.LogLevelLabel.TRACE, "Writing documentation for the Powerlines project artifacts.");
|
|
3457
|
+
await this.prepare(inlineConfig);
|
|
3458
|
+
await this.#executeEnvironments(async (context2) => {
|
|
3459
|
+
await this.callHook(context2, "docs");
|
|
3587
3460
|
});
|
|
3588
|
-
const project = await getReflections();
|
|
3589
|
-
if (project) {
|
|
3590
|
-
await generateDocs({
|
|
3591
|
-
project
|
|
3592
|
-
});
|
|
3593
|
-
}
|
|
3594
|
-
await this.callPostHook(context, "docs");
|
|
3595
3461
|
});
|
|
3596
3462
|
this.#context.log(types.LogLevelLabel.TRACE, "Powerlines documentation generation completed");
|
|
3597
3463
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSH2Y2OGJ_js = require('./chunk-SH2Y2OGJ.js');
|
|
4
4
|
var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
|
|
5
5
|
|
|
6
6
|
// src/executors/docs/executor.ts
|
|
@@ -11,7 +11,7 @@ async function executorFn(context, api) {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
chunkSHUYVCID_js.__name(executorFn, "executorFn");
|
|
14
|
-
var executor =
|
|
14
|
+
var executor = chunkSH2Y2OGJ_js.withExecutor("docs", executorFn);
|
|
15
15
|
var executor_default = executor;
|
|
16
16
|
|
|
17
17
|
exports.executorFn = executorFn;
|
|
@@ -14,7 +14,6 @@ var kebabCase = require('@stryke/string-format/kebab-case');
|
|
|
14
14
|
var isError = require('@stryke/type-checks/is-error');
|
|
15
15
|
var defu = require('defu');
|
|
16
16
|
var jiti = require('jiti');
|
|
17
|
-
var path = require('path');
|
|
18
17
|
var nxJson_js = require('nx/src/config/nx-json.js');
|
|
19
18
|
var packageJson_js = require('nx/src/utils/package-json.js');
|
|
20
19
|
|
|
@@ -24,38 +23,37 @@ var defu__default = /*#__PURE__*/_interopDefault(defu);
|
|
|
24
23
|
|
|
25
24
|
// src/helpers/constants.ts
|
|
26
25
|
var CONFIG_INPUTS = [
|
|
27
|
-
"{projectRoot}
|
|
28
|
-
"{projectRoot}/
|
|
29
|
-
"{projectRoot}/
|
|
30
|
-
"{projectRoot}/
|
|
31
|
-
"{projectRoot}/
|
|
32
|
-
"{projectRoot}/
|
|
33
|
-
"{projectRoot}/
|
|
34
|
-
"{projectRoot}/
|
|
35
|
-
"{projectRoot}/
|
|
36
|
-
"{projectRoot}/
|
|
37
|
-
"{projectRoot}/
|
|
38
|
-
"{projectRoot}/
|
|
39
|
-
"{projectRoot}/
|
|
40
|
-
"{projectRoot}/
|
|
41
|
-
"{projectRoot}/
|
|
42
|
-
"{projectRoot}/
|
|
43
|
-
"{projectRoot}/
|
|
44
|
-
"{projectRoot}/
|
|
45
|
-
"{projectRoot}/
|
|
46
|
-
"{projectRoot}/
|
|
47
|
-
"{projectRoot}/
|
|
48
|
-
"{projectRoot}/
|
|
49
|
-
"{projectRoot}/
|
|
50
|
-
"{projectRoot}/
|
|
51
|
-
"{projectRoot}/
|
|
26
|
+
"{projectRoot}/package.json",
|
|
27
|
+
"{projectRoot}/powerlines.json",
|
|
28
|
+
"{projectRoot}/powerlines.*.json",
|
|
29
|
+
"{projectRoot}/powerlines.jsonc",
|
|
30
|
+
"{projectRoot}/powerlines.*.jsonc",
|
|
31
|
+
"{projectRoot}/powerlines.json5",
|
|
32
|
+
"{projectRoot}/powerlines.*.json5",
|
|
33
|
+
"{projectRoot}/powerlines.yaml",
|
|
34
|
+
"{projectRoot}/powerlines.*.yaml",
|
|
35
|
+
"{projectRoot}/powerlines.yml",
|
|
36
|
+
"{projectRoot}/powerlines.*.yml",
|
|
37
|
+
"{projectRoot}/powerlines.toml",
|
|
38
|
+
"{projectRoot}/powerlines.*.toml",
|
|
39
|
+
"{projectRoot}/powerlines.js",
|
|
40
|
+
"{projectRoot}/powerlines.*.js",
|
|
41
|
+
"{projectRoot}/powerlines.cjs",
|
|
42
|
+
"{projectRoot}/powerlines.*.cjs",
|
|
43
|
+
"{projectRoot}/powerlines.mjs",
|
|
44
|
+
"{projectRoot}/powerlines.*.mjs",
|
|
45
|
+
"{projectRoot}/powerlines.ts",
|
|
46
|
+
"{projectRoot}/powerlines.*.ts",
|
|
47
|
+
"{projectRoot}/powerlines.cts",
|
|
48
|
+
"{projectRoot}/powerlines.*.cts",
|
|
49
|
+
"{projectRoot}/powerlines.mts",
|
|
50
|
+
"{projectRoot}/powerlines.*.mts"
|
|
52
51
|
];
|
|
53
52
|
|
|
54
53
|
// src/plugin/index.ts
|
|
55
54
|
var name = "powerlines/nx/plugin";
|
|
56
|
-
var stormConfigGlob = "**/{package.json,storm.json,storm.*.json,storm.jsonc,storm.*.jsonc,storm.json5,storm.*.json5,storm.yaml,storm.*.yaml,storm.yml,storm.*.yml,storm.toml,storm.*.toml,storm.js,storm.*.js,storm.ts,storm.*.ts,storm.mjs,storm.*.mjs,storm.cjs,storm.*.cjs,storm.mts,storm.*.mts,storm.cts,storm.*.cts}";
|
|
57
55
|
var createNodesV2 = [
|
|
58
|
-
|
|
56
|
+
`**/{${CONFIG_INPUTS.map((input) => input.replace("{projectRoot}/", "")).join(",")}}`,
|
|
59
57
|
async (configFiles, optionsV2, contextV2) => {
|
|
60
58
|
const envPaths = getEnvPaths.getEnvPaths({
|
|
61
59
|
orgId: "storm-software",
|
|
@@ -65,6 +63,7 @@ var createNodesV2 = [
|
|
|
65
63
|
if (!envPaths.cache) {
|
|
66
64
|
throw new Error("The cache directory could not be determined.");
|
|
67
65
|
}
|
|
66
|
+
const runtimeFolder = optionsV2?.runtimeFolder || ".powerlines";
|
|
68
67
|
const nxJson$1 = nxJson_js.readNxJson(contextV2.workspaceRoot);
|
|
69
68
|
return devkit.createNodesFromFiles(async (configFile, options, context) => {
|
|
70
69
|
try {
|
|
@@ -125,7 +124,7 @@ var createNodesV2 = [
|
|
|
125
124
|
"typescript"
|
|
126
125
|
]),
|
|
127
126
|
outputs: [
|
|
128
|
-
|
|
127
|
+
`{projectRoot}/${runtimeFolder}`
|
|
129
128
|
],
|
|
130
129
|
dependsOn: [
|
|
131
130
|
"clean",
|
|
@@ -153,24 +152,6 @@ var createNodesV2 = [
|
|
|
153
152
|
}
|
|
154
153
|
}
|
|
155
154
|
};
|
|
156
|
-
targets["type-check"] ??= {
|
|
157
|
-
cache: true,
|
|
158
|
-
inputs: [
|
|
159
|
-
"typescript",
|
|
160
|
-
"^production"
|
|
161
|
-
],
|
|
162
|
-
outputs: [
|
|
163
|
-
"{workspaceRoot}/dist/{projectRoot}"
|
|
164
|
-
],
|
|
165
|
-
executor: "nx:run-commands",
|
|
166
|
-
dependsOn: [
|
|
167
|
-
"^type-check",
|
|
168
|
-
"^build"
|
|
169
|
-
],
|
|
170
|
-
options: {
|
|
171
|
-
command: `pnpm exec tsc --noEmit --pretty --project ${userConfig.tsconfig || path.join(projectConfig.root, "tsconfig.json")}`
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
155
|
targets.build = {
|
|
175
156
|
cache: true,
|
|
176
157
|
inputs: nxJson.withNamedInputs(CONFIG_INPUTS, [
|
|
@@ -210,13 +191,13 @@ var createNodesV2 = [
|
|
|
210
191
|
cache: true,
|
|
211
192
|
inputs: nxJson.withNamedInputs([
|
|
212
193
|
...CONFIG_INPUTS,
|
|
213
|
-
|
|
194
|
+
`{projectRoot}/${runtimeFolder}`
|
|
214
195
|
], [
|
|
215
196
|
"linting",
|
|
216
197
|
"typescript"
|
|
217
198
|
]),
|
|
218
199
|
outputs: nxJson.withNamedInputs([
|
|
219
|
-
|
|
200
|
+
`{projectRoot}/${runtimeFolder}`
|
|
220
201
|
], [
|
|
221
202
|
"typescript"
|
|
222
203
|
]),
|
|
@@ -250,7 +231,7 @@ var createNodesV2 = [
|
|
|
250
231
|
cache: true,
|
|
251
232
|
inputs: nxJson.withNamedInputs([
|
|
252
233
|
...CONFIG_INPUTS,
|
|
253
|
-
|
|
234
|
+
`{projectRoot}/${runtimeFolder}`
|
|
254
235
|
], [
|
|
255
236
|
"documentation",
|
|
256
237
|
"typescript"
|
package/dist/executors.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('./chunk-XO62WWX4.js');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
4
|
+
var chunkK6XBJH2L_js = require('./chunk-K6XBJH2L.js');
|
|
5
|
+
var chunkVRETYARN_js = require('./chunk-VRETYARN.js');
|
|
6
|
+
var chunkKVN36KM4_js = require('./chunk-KVN36KM4.js');
|
|
7
|
+
var chunkF3B56YER_js = require('./chunk-F3B56YER.js');
|
|
8
|
+
var chunkJIRHFIPP_js = require('./chunk-JIRHFIPP.js');
|
|
9
|
+
require('./chunk-SH2Y2OGJ.js');
|
|
10
10
|
require('./chunk-HHPODCTP.js');
|
|
11
11
|
require('./chunk-SHUYVCID.js');
|
|
12
12
|
|
|
@@ -14,21 +14,21 @@ require('./chunk-SHUYVCID.js');
|
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, "clean", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkK6XBJH2L_js.executor_default; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "docs", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkVRETYARN_js.executor_default; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "lint", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkKVN36KM4_js.executor_default; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "prepare", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkF3B56YER_js.executor_default; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "build", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkJIRHFIPP_js.executor_default; }
|
|
34
34
|
});
|
package/dist/executors.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import './chunk-UV4HQO3Y.mjs';
|
|
2
|
-
export { executor_default as clean } from './chunk-
|
|
3
|
-
export { executor_default as docs } from './chunk-
|
|
4
|
-
export { executor_default as lint } from './chunk-
|
|
5
|
-
export { executor_default as prepare } from './chunk-
|
|
6
|
-
export { executor_default as build } from './chunk-
|
|
7
|
-
import './chunk-
|
|
2
|
+
export { executor_default as clean } from './chunk-Y7YQWWS2.mjs';
|
|
3
|
+
export { executor_default as docs } from './chunk-U6AMKLJF.mjs';
|
|
4
|
+
export { executor_default as lint } from './chunk-PSSLJDP5.mjs';
|
|
5
|
+
export { executor_default as prepare } from './chunk-YPHW2GBQ.mjs';
|
|
6
|
+
export { executor_default as build } from './chunk-LRQS76FH.mjs';
|
|
7
|
+
import './chunk-4QSGA5A4.mjs';
|
|
8
8
|
import './chunk-CYWOTYVX.mjs';
|
|
9
9
|
import './chunk-O6YSETKJ.mjs';
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('./chunk-XO62WWX4.js');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
4
|
+
var chunkK6XBJH2L_js = require('./chunk-K6XBJH2L.js');
|
|
5
|
+
var chunkVRETYARN_js = require('./chunk-VRETYARN.js');
|
|
6
|
+
var chunkKVN36KM4_js = require('./chunk-KVN36KM4.js');
|
|
7
|
+
var chunkF3B56YER_js = require('./chunk-F3B56YER.js');
|
|
8
8
|
require('./chunk-N2YKXZ5R.js');
|
|
9
9
|
var chunkWUJKJGEW_js = require('./chunk-WUJKJGEW.js');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
require('./chunk-
|
|
10
|
+
var chunkZ4BJ37JY_js = require('./chunk-Z4BJ37JY.js');
|
|
11
|
+
var chunkJIRHFIPP_js = require('./chunk-JIRHFIPP.js');
|
|
12
|
+
require('./chunk-SH2Y2OGJ.js');
|
|
13
13
|
require('./chunk-HHPODCTP.js');
|
|
14
14
|
require('./chunk-SHUYVCID.js');
|
|
15
15
|
|
|
@@ -17,19 +17,19 @@ require('./chunk-SHUYVCID.js');
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "clean", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkK6XBJH2L_js.executor_default; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "docs", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkVRETYARN_js.executor_default; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "lint", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkKVN36KM4_js.executor_default; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "prepare", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkF3B56YER_js.executor_default; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "sync", {
|
|
35
35
|
enumerable: true,
|
|
@@ -41,13 +41,13 @@ Object.defineProperty(exports, "syncGenerator", {
|
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "createNodesV2", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunkZ4BJ37JY_js.createNodesV2; }
|
|
45
45
|
});
|
|
46
46
|
Object.defineProperty(exports, "name", {
|
|
47
47
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunkZ4BJ37JY_js.name; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "build", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunkJIRHFIPP_js.executor_default; }
|
|
53
53
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './chunk-UV4HQO3Y.mjs';
|
|
2
|
-
export { executor_default as clean } from './chunk-
|
|
3
|
-
export { executor_default as docs } from './chunk-
|
|
4
|
-
export { executor_default as lint } from './chunk-
|
|
5
|
-
export { executor_default as prepare } from './chunk-
|
|
2
|
+
export { executor_default as clean } from './chunk-Y7YQWWS2.mjs';
|
|
3
|
+
export { executor_default as docs } from './chunk-U6AMKLJF.mjs';
|
|
4
|
+
export { executor_default as lint } from './chunk-PSSLJDP5.mjs';
|
|
5
|
+
export { executor_default as prepare } from './chunk-YPHW2GBQ.mjs';
|
|
6
6
|
import './chunk-23KFTIT2.mjs';
|
|
7
7
|
export { generator_default as sync, generatorFn as syncGenerator } from './chunk-326QB2VK.mjs';
|
|
8
|
-
export { createNodesV2, name } from './chunk-
|
|
9
|
-
export { executor_default as build } from './chunk-
|
|
10
|
-
import './chunk-
|
|
8
|
+
export { createNodesV2, name } from './chunk-22QO45EK.mjs';
|
|
9
|
+
export { executor_default as build } from './chunk-LRQS76FH.mjs';
|
|
10
|
+
import './chunk-4QSGA5A4.mjs';
|
|
11
11
|
import './chunk-CYWOTYVX.mjs';
|
|
12
12
|
import './chunk-O6YSETKJ.mjs';
|