@powerlines/nx 0.1.0 → 0.3.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/{chunk-2IKNOV7W.mjs → chunk-22QO45EK.mjs} +31 -50
  3. package/dist/{chunk-OZMYXUES.mjs → chunk-4T5LIOS7.mjs} +39 -172
  4. package/dist/{chunk-WKH7IEJU.js → chunk-6SBXXTFC.js} +2 -2
  5. package/dist/{chunk-AKX3TTDA.js → chunk-BM7JS6C2.js} +2 -2
  6. package/dist/{chunk-ESI25Y6Y.mjs → chunk-EJ5N22VV.mjs} +1 -1
  7. package/dist/{chunk-CQP2LCFV.mjs → chunk-GZAHD3HX.mjs} +1 -1
  8. package/dist/{chunk-5K7DMFAV.mjs → chunk-HCFUFMAF.mjs} +1 -1
  9. package/dist/{chunk-6UG6SXHV.js → chunk-MQKPEN3X.js} +39 -172
  10. package/dist/{chunk-6ZABD5GY.js → chunk-MQQZWVFL.js} +2 -2
  11. package/dist/{chunk-3QPPK4K2.js → chunk-VFYKWLFU.js} +2 -2
  12. package/dist/{chunk-FXCIWWXO.mjs → chunk-WAQHDLQP.mjs} +1 -1
  13. package/dist/{chunk-E6VIOC6R.mjs → chunk-XSNPOHTI.mjs} +1 -1
  14. package/dist/{chunk-O6BSKBJP.js → chunk-Y7LKUYQR.js} +2 -2
  15. package/dist/{chunk-OOERKIVS.js → chunk-Z4BJ37JY.js} +31 -50
  16. package/dist/executors.js +11 -11
  17. package/dist/executors.mjs +6 -6
  18. package/dist/index.js +14 -14
  19. package/dist/index.mjs +7 -7
  20. package/dist/src/base/base-executor.js +2 -2
  21. package/dist/src/base/base-executor.mjs +1 -1
  22. package/dist/src/executors/build/executor.js +4 -4
  23. package/dist/src/executors/build/executor.mjs +2 -2
  24. package/dist/src/executors/build/schema.d.ts +85 -0
  25. package/dist/src/executors/build/schema.json +96 -0
  26. package/dist/src/executors/clean/executor.js +4 -4
  27. package/dist/src/executors/clean/executor.mjs +2 -2
  28. package/dist/src/executors/clean/schema.d.ts +75 -0
  29. package/dist/src/executors/clean/schema.json +77 -0
  30. package/dist/src/executors/docs/executor.js +4 -4
  31. package/dist/src/executors/docs/executor.mjs +2 -2
  32. package/dist/src/executors/docs/schema.d.ts +75 -0
  33. package/dist/src/executors/docs/schema.json +77 -0
  34. package/dist/src/executors/lint/executor.js +4 -4
  35. package/dist/src/executors/lint/executor.mjs +2 -2
  36. package/dist/src/executors/lint/schema.d.ts +75 -0
  37. package/dist/src/executors/lint/schema.json +77 -0
  38. package/dist/src/executors/prepare/executor.js +4 -4
  39. package/dist/src/executors/prepare/executor.mjs +2 -2
  40. package/dist/src/executors/prepare/schema.d.ts +75 -0
  41. package/dist/src/executors/prepare/schema.json +77 -0
  42. package/dist/src/generators/sync/schema.d.ts +15 -0
  43. package/dist/src/generators/sync/schema.json +19 -0
  44. package/dist/src/plugin/index.d.mts +9 -0
  45. package/dist/src/plugin/index.d.ts +9 -0
  46. package/dist/src/plugin/index.js +3 -3
  47. package/dist/src/plugin/index.mjs +1 -1
  48. package/package.json +3 -3
@@ -26,17 +26,14 @@ 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');
32
+ var titleCase = require('@stryke/string-format/title-case');
35
33
  var isUndefined = require('@stryke/type-checks/is-undefined');
36
- var writeFile = require('@stryke/fs/write-file');
34
+ var writeFile$1 = require('@stryke/fs/write-file');
37
35
  var prettier = require('prettier');
38
36
  var resolve = require('@stryke/fs/resolve');
39
- var titleCase = require('@stryke/string-format/title-case');
40
37
  var getEnvPaths = require('@stryke/env/get-env-paths');
41
38
  var getWorkspaceRoot = require('@stryke/fs/get-workspace-root');
42
39
  var murmurhash = require('@stryke/hash/murmurhash');
@@ -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)) {
@@ -308,26 +187,22 @@ ${parsedCommandLine.errors.map((error) => `- ${(error.category !== void 0 && err
308
187
  };
309
188
  }
310
189
  chunkSHUYVCID_js.__name(getParsedTypeScriptConfig, "getParsedTypeScriptConfig");
311
-
312
- // ../powerlines/src/lib/utilities/file-header.ts
313
- function getBaseFileHeader() {
190
+ function getBaseFileHeader(context) {
314
191
  return `
315
- // Generated with Powerlines
192
+ // Generated with ${titleCase.titleCase(context.config.framework)}
316
193
  // Note: Do not edit this file manually - it will be overwritten automatically
317
194
  `;
318
195
  }
319
196
  chunkSHUYVCID_js.__name(getBaseFileHeader, "getBaseFileHeader");
320
- function getFileHeader(directive = "", prettierIgnore = false) {
321
- if (directive && process.env.POWERLINES_LOCAL) {
322
- directive = directive.replaceAll("powerlines/runtime-types", "../../dist/packages/types");
323
- }
197
+ function getFileHeader(context, options = {}) {
198
+ const { directive = null, prettierIgnore = false } = options;
324
199
  return `/* eslint-disable */
325
200
  // biome-ignore lint: disable
326
201
  ${prettierIgnore ? `// prettier-ignore` : ""}${directive ? `
327
202
 
328
203
  ${directive}
329
204
  ` : "\n"}
330
- ${getBaseFileHeader()}
205
+ ${getBaseFileHeader(context)}
331
206
 
332
207
  `;
333
208
  }
@@ -400,24 +275,24 @@ function addPluginHook(context, plugin, pluginHook, hooksList) {
400
275
  }
401
276
  }
402
277
  chunkSHUYVCID_js.__name(addPluginHook, "addPluginHook");
403
- async function writeFile2(log, filepath, content, skipFormat = false) {
278
+ async function writeFile(log, filepath, content, skipFormat = false) {
404
279
  try {
405
280
  if (skipFormat) {
406
- await writeFile.writeFile(filepath, content);
281
+ await writeFile$1.writeFile(filepath, content);
407
282
  } else {
408
283
  const config = await prettier.resolveConfig(filepath);
409
284
  const formatted = await prettier.format(content, {
410
285
  ...config ?? {},
411
286
  filepath
412
287
  });
413
- await writeFile.writeFile(filepath, formatted || "");
288
+ await writeFile$1.writeFile(filepath, formatted || "");
414
289
  }
415
290
  } catch (error) {
416
291
  log(types.LogLevelLabel.ERROR, `Failed to write file ${filepath} to disk
417
292
  ${error?.message ? error.message : ""}`);
418
293
  }
419
294
  }
420
- chunkSHUYVCID_js.__name(writeFile2, "writeFile");
295
+ chunkSHUYVCID_js.__name(writeFile, "writeFile");
421
296
  var DEFAULT_ENVIRONMENT = "default";
422
297
  function createEnvironment(name, userConfig) {
423
298
  return defu4__default.default(userConfig.environments?.[name] ?? {}, {
@@ -758,7 +633,7 @@ var VirtualFileSystem = class {
758
633
  * @returns Whether the ID is a valid runtime ID.
759
634
  */
760
635
  isValidBuiltinId(id) {
761
- return id.startsWith(`${this.#context.config.builtinPrefix}:`);
636
+ return id.startsWith(`${this.#context.config.output.builtinPrefix}:`);
762
637
  }
763
638
  /**
764
639
  * Check if a path or ID corresponds to a virtual file.
@@ -1338,7 +1213,7 @@ var VirtualFileSystem = class {
1338
1213
  if (!isSetString.isSetString(path2)) {
1339
1214
  throw new Error(`Invalid path provided. Expected a string or a valid file path.`);
1340
1215
  }
1341
- return path2.replace(new RegExp(`^${this.#context.config.builtinPrefix}:`), "").replace(/^\\0/, "");
1216
+ return path2.replace(new RegExp(`^${this.#context.config.output.builtinPrefix}:`), "").replace(/^\\0/, "");
1342
1217
  }
1343
1218
  /**
1344
1219
  * Converts a relative path to an absolute path based on the workspace and project root.
@@ -1362,7 +1237,7 @@ var VirtualFileSystem = class {
1362
1237
  * @returns The formatted runtime ID.
1363
1238
  */
1364
1239
  formatRuntimeId(id) {
1365
- return `${this.#context.config.builtinPrefix}:${this.formatFilePath(id).replace(/\.[m|c]?[t|j]sx?$/, "")}`;
1240
+ return `${this.#context.config.output.builtinPrefix}:${this.formatFilePath(id).replace(/\.[m|c]?[t|j]sx?$/, "")}`;
1366
1241
  }
1367
1242
  /**
1368
1243
  * Resolves a path or ID parameter to a corresponding virtual file path in the virtual file system (VFS).
@@ -1371,7 +1246,7 @@ var VirtualFileSystem = class {
1371
1246
  * @returns The resolved file path if it exists, otherwise undefined.
1372
1247
  */
1373
1248
  resolvePathName(pathOrId, options = {}) {
1374
- if (pathOrId.startsWith(`${this.#context.config.builtinPrefix}:`)) {
1249
+ if (pathOrId.startsWith(`${this.#context.config.output.builtinPrefix}:`)) {
1375
1250
  return false;
1376
1251
  }
1377
1252
  if (isType.isAbsolutePath(pathOrId)) {
@@ -1689,7 +1564,6 @@ var PowerlinesContext = class _PowerlinesContext {
1689
1564
  configFile: config.configFile,
1690
1565
  customLogger: config.customLogger,
1691
1566
  logLevel: config.logLevel,
1692
- builtinPrefix: config.builtinPrefix,
1693
1567
  tsconfig: config.tsconfig,
1694
1568
  tsconfigRaw: config.tsconfigRaw,
1695
1569
  skipCache: config.skipCache,
@@ -1701,7 +1575,8 @@ var PowerlinesContext = class _PowerlinesContext {
1701
1575
  lint: config.lint,
1702
1576
  transform: config.transform,
1703
1577
  build: config.build,
1704
- override: config.override
1578
+ override: config.override,
1579
+ framework: config.framework
1705
1580
  };
1706
1581
  }
1707
1582
  /**
@@ -1997,7 +1872,9 @@ var PowerlinesContext = class _PowerlinesContext {
1997
1872
  output: {
1998
1873
  outputPath: join.joinPaths("dist", cacheKey.projectRoot),
1999
1874
  mode: "virtual",
2000
- dts: join.joinPaths(cacheKey.projectRoot, "storm.d.ts"),
1875
+ dts: join.joinPaths(cacheKey.projectRoot, `${config.framework ?? "powerlines"}.d.ts`),
1876
+ builtinPrefix: config.framework ?? "powerlines",
1877
+ runtimeFolder: join.joinPaths(cacheKey.projectRoot, `.${config.framework ?? "powerlines"}`),
2001
1878
  assets: [
2002
1879
  {
2003
1880
  glob: "LICENSE"
@@ -2015,11 +1892,11 @@ var PowerlinesContext = class _PowerlinesContext {
2015
1892
  }, options.isHighPriority ? {} : this.#getConfigProps(config), {
2016
1893
  inlineConfig: {},
2017
1894
  userConfig: {},
1895
+ framework: "powerlines",
2018
1896
  platform: "neutral",
2019
1897
  mode: "production",
2020
1898
  projectType: "application",
2021
1899
  logLevel: "info",
2022
- builtinPrefix: "storm",
2023
1900
  preview: false,
2024
1901
  environments: {},
2025
1902
  transform: {
@@ -2541,7 +2418,7 @@ export default getConfig({
2541
2418
  });
2542
2419
  `;
2543
2420
  log(types.LogLevelLabel.INFO, `Writing a default ESLint config file to ${eslintConfigFile}`);
2544
- return writeFile2(log, eslintConfigFile, eslintConfig);
2421
+ return writeFile(log, eslintConfigFile, eslintConfig);
2545
2422
  }
2546
2423
  chunkSHUYVCID_js.__name(writeDefaultEslintConfig, "writeDefaultEslintConfig");
2547
2424
  var VALID_SEVERITY = [
@@ -2559,7 +2436,7 @@ async function writeOutputFile(log, outputFile, outputData) {
2559
2436
  log(types.LogLevelLabel.ERROR, `Cannot write to output file path, it is a directory: ${filePath}`);
2560
2437
  } else {
2561
2438
  try {
2562
- await writeFile2(log, filePath, outputData);
2439
+ await writeFile(log, filePath, outputData);
2563
2440
  log(types.LogLevelLabel.INFO, `The output file has been created: ${filePath}`);
2564
2441
  } catch (err) {
2565
2442
  log(types.LogLevelLabel.ERROR, `There was a problem writing the output file: ${filePath}`);
@@ -3033,7 +2910,10 @@ ${diagnosticMessage.length > 5e3 ? `${diagnosticMessage.slice(0, 5e3)}...` : dia
3033
2910
  const sourceFile = getSourceFile(String(context.config.output.dts), `/// <reference types="powerlines/shared" />${context.config.build.platform !== "neutral" ? `
3034
2911
  /// <reference types="powerlines/${context.config.build.platform}" />` : ""}
3035
2912
 
3036
- ${getFileHeader(null, false)}
2913
+ ${getFileHeader(context, {
2914
+ directive: null,
2915
+ prettierIgnore: false
2916
+ })}
3037
2917
 
3038
2918
  ${builtinModules}`.replace(
3039
2919
  // eslint-disable-next-line regexp/no-super-linear-backtracking
@@ -3225,7 +3105,7 @@ async function resolveTsconfig(context) {
3225
3105
  `).join("\n")}
3226
3106
  `);
3227
3107
  }
3228
- await writeFile2(context.log, context.tsconfig.tsconfigFilePath, stormJson.StormJSON.stringify(updateTsconfigJson));
3108
+ await writeFile(context.log, context.tsconfig.tsconfigFilePath, stormJson.StormJSON.stringify(updateTsconfigJson));
3229
3109
  context.tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
3230
3110
  if (!context.tsconfig) {
3231
3111
  throw new Error("Failed to parse the TypeScript configuration file.");
@@ -3434,7 +3314,7 @@ ${console$1.formatLogMessage(context.config)}`);
3434
3314
  if (context.config.projectType === "application") {
3435
3315
  context.log(types.LogLevelLabel.TRACE, "Generating built-in barrel file");
3436
3316
  await context.fs.writeBuiltinFile("index", joinPaths.joinPaths(context.builtinsPath, "index.ts"), `
3437
- ${getFileHeader()}
3317
+ ${getFileHeader(context)}
3438
3318
 
3439
3319
  ${(await context.fs.listBuiltinFiles()).filter((file) => !isParentPath.isParentPath(file.path, joinPaths.joinPaths(context.builtinsPath, "log")) && !isParentPath.isParentPath(file.path, joinPaths.joinPaths(context.builtinsPath, "storage"))).map((file) => `export * from "./${replace.replacePath(file.path, context.builtinsPath).replace(`.${filePathFns.findFileExtensionSafe(file.path)}`, "")}";`).join("\n")}
3440
3320
  `);
@@ -3472,7 +3352,7 @@ ${console$1.formatLogMessage(context.config)}`);
3472
3352
  for (const file of files) {
3473
3353
  context.log(types.LogLevelLabel.TRACE, `Adding template file: ${file}`);
3474
3354
  const template = Handlebars__default.default.compile(file);
3475
- await writeFile2(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
3355
+ await writeFile(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
3476
3356
  }
3477
3357
  await this.callNormalHook(context, "new");
3478
3358
  if (context.config.projectType === "application") {
@@ -3480,14 +3360,14 @@ ${console$1.formatLogMessage(context.config)}`);
3480
3360
  for (const file of files2) {
3481
3361
  context.log(types.LogLevelLabel.TRACE, `Adding application template file: ${file}`);
3482
3362
  const template = Handlebars__default.default.compile(file);
3483
- await writeFile2(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
3363
+ await writeFile(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
3484
3364
  }
3485
3365
  } else {
3486
3366
  const files2 = await listFiles.listFiles(joinPaths.joinPaths(context.corePackagePath, "files/library/**/*.hbs"));
3487
3367
  for (const file of files2) {
3488
3368
  context.log(types.LogLevelLabel.TRACE, `Adding library template file: ${file}`);
3489
3369
  const template = Handlebars__default.default.compile(file);
3490
- await writeFile2(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
3370
+ await writeFile(context.log, joinPaths.joinPaths(context.config.projectRoot, file.replace(".hbs", "")), template(context));
3491
3371
  }
3492
3372
  }
3493
3373
  await this.callPostHook(context, "new");
@@ -3571,27 +3451,14 @@ ${console$1.formatLogMessage(context.config)}`);
3571
3451
  async docs(inlineConfig = {
3572
3452
  command: "docs"
3573
3453
  }) {
3574
- this.context.log(types.LogLevelLabel.INFO, "Generating documentation for the Powerlines project");
3454
+ this.context.log(types.LogLevelLabel.INFO, "\u{1F4D3} Generating documentation for the Powerlines project");
3575
3455
  await this.prepare(inlineConfig);
3576
3456
  await this.#executeEnvironments(async (context) => {
3577
- context.log(types.LogLevelLabel.TRACE, "Writing API-Reference documentation for the Powerlines project artifacts.");
3578
- await this.callPreHook(context, "docs");
3579
- const outputPath = joinPaths.joinPaths(context.config.projectRoot, "docs", "generated", "api-reference");
3580
- if (exists.existsSync(outputPath)) {
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
3457
+ context.log(types.LogLevelLabel.TRACE, "Writing documentation for the Powerlines project artifacts.");
3458
+ await this.prepare(inlineConfig);
3459
+ await this.#executeEnvironments(async (context2) => {
3460
+ await this.callHook(context2, "docs");
3587
3461
  });
3588
- const project = await getReflections();
3589
- if (project) {
3590
- await generateDocs({
3591
- project
3592
- });
3593
- }
3594
- await this.callPostHook(context, "docs");
3595
3462
  });
3596
3463
  this.#context.log(types.LogLevelLabel.TRACE, "Powerlines documentation generation completed");
3597
3464
  }
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk6UG6SXHV_js = require('./chunk-6UG6SXHV.js');
3
+ var chunkMQKPEN3X_js = require('./chunk-MQKPEN3X.js');
4
4
  var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
5
5
 
6
6
  // src/executors/clean/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 = chunk6UG6SXHV_js.withExecutor("clean", executorFn);
14
+ var executor = chunkMQKPEN3X_js.withExecutor("clean", executorFn);
15
15
  var executor_default = executor;
16
16
 
17
17
  exports.executorFn = executorFn;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk6UG6SXHV_js = require('./chunk-6UG6SXHV.js');
3
+ var chunkMQKPEN3X_js = require('./chunk-MQKPEN3X.js');
4
4
  var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
5
5
 
6
6
  // src/executors/lint/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 = chunk6UG6SXHV_js.withExecutor("lint", executorFn);
14
+ var executor = chunkMQKPEN3X_js.withExecutor("lint", executorFn);
15
15
  var executor_default = executor;
16
16
 
17
17
  exports.executorFn = executorFn;
@@ -1,4 +1,4 @@
1
- import { withExecutor } from './chunk-OZMYXUES.mjs';
1
+ import { withExecutor } from './chunk-4T5LIOS7.mjs';
2
2
  import { __name } from './chunk-O6YSETKJ.mjs';
3
3
 
4
4
  // src/executors/docs/executor.ts
@@ -1,4 +1,4 @@
1
- import { withExecutor } from './chunk-OZMYXUES.mjs';
1
+ import { withExecutor } from './chunk-4T5LIOS7.mjs';
2
2
  import { __name } from './chunk-O6YSETKJ.mjs';
3
3
  import defu from 'defu';
4
4
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk6UG6SXHV_js = require('./chunk-6UG6SXHV.js');
3
+ var chunkMQKPEN3X_js = require('./chunk-MQKPEN3X.js');
4
4
  var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
5
5
  var defu = require('defu');
6
6
 
@@ -19,7 +19,7 @@ async function executorFn(context, api) {
19
19
  };
20
20
  }
21
21
  chunkSHUYVCID_js.__name(executorFn, "executorFn");
22
- var executor = chunk6UG6SXHV_js.withExecutor("build", executorFn);
22
+ var executor = chunkMQKPEN3X_js.withExecutor("build", executorFn);
23
23
  var executor_default = executor;
24
24
 
25
25
  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}/.storm",
28
- "{projectRoot}/storm.json",
29
- "{projectRoot}/storm.*.json",
30
- "{projectRoot}/storm.jsonc",
31
- "{projectRoot}/storm.*.jsonc",
32
- "{projectRoot}/storm.json5",
33
- "{projectRoot}/storm.*.json5",
34
- "{projectRoot}/storm.yaml",
35
- "{projectRoot}/storm.*.yaml",
36
- "{projectRoot}/storm.yml",
37
- "{projectRoot}/storm.*.yml",
38
- "{projectRoot}/storm.toml",
39
- "{projectRoot}/storm.*.toml",
40
- "{projectRoot}/storm.js",
41
- "{projectRoot}/storm.*.js",
42
- "{projectRoot}/storm.cjs",
43
- "{projectRoot}/storm.*.cjs",
44
- "{projectRoot}/storm.mjs",
45
- "{projectRoot}/storm.*.mjs",
46
- "{projectRoot}/storm.ts",
47
- "{projectRoot}/storm.*.ts",
48
- "{projectRoot}/storm.cts",
49
- "{projectRoot}/storm.*.cts",
50
- "{projectRoot}/storm.mts",
51
- "{projectRoot}/storm.*.mts"
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
- stormConfigGlob,
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
- "{projectRoot}/.storm"
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
- "{projectRoot}/.storm"
194
+ `{projectRoot}/${runtimeFolder}`
214
195
  ], [
215
196
  "linting",
216
197
  "typescript"
217
198
  ]),
218
199
  outputs: nxJson.withNamedInputs([
219
- "{projectRoot}/.storm"
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
- "{projectRoot}/.storm"
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 chunk6ZABD5GY_js = require('./chunk-6ZABD5GY.js');
5
- var chunkAKX3TTDA_js = require('./chunk-AKX3TTDA.js');
6
- var chunk3QPPK4K2_js = require('./chunk-3QPPK4K2.js');
7
- var chunkWKH7IEJU_js = require('./chunk-WKH7IEJU.js');
8
- var chunkO6BSKBJP_js = require('./chunk-O6BSKBJP.js');
9
- require('./chunk-6UG6SXHV.js');
4
+ var chunkMQQZWVFL_js = require('./chunk-MQQZWVFL.js');
5
+ var chunkBM7JS6C2_js = require('./chunk-BM7JS6C2.js');
6
+ var chunkVFYKWLFU_js = require('./chunk-VFYKWLFU.js');
7
+ var chunk6SBXXTFC_js = require('./chunk-6SBXXTFC.js');
8
+ var chunkY7LKUYQR_js = require('./chunk-Y7LKUYQR.js');
9
+ require('./chunk-MQKPEN3X.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 chunk6ZABD5GY_js.executor_default; }
17
+ get: function () { return chunkMQQZWVFL_js.executor_default; }
18
18
  });
19
19
  Object.defineProperty(exports, "docs", {
20
20
  enumerable: true,
21
- get: function () { return chunkAKX3TTDA_js.executor_default; }
21
+ get: function () { return chunkBM7JS6C2_js.executor_default; }
22
22
  });
23
23
  Object.defineProperty(exports, "lint", {
24
24
  enumerable: true,
25
- get: function () { return chunk3QPPK4K2_js.executor_default; }
25
+ get: function () { return chunkVFYKWLFU_js.executor_default; }
26
26
  });
27
27
  Object.defineProperty(exports, "prepare", {
28
28
  enumerable: true,
29
- get: function () { return chunkWKH7IEJU_js.executor_default; }
29
+ get: function () { return chunk6SBXXTFC_js.executor_default; }
30
30
  });
31
31
  Object.defineProperty(exports, "build", {
32
32
  enumerable: true,
33
- get: function () { return chunkO6BSKBJP_js.executor_default; }
33
+ get: function () { return chunkY7LKUYQR_js.executor_default; }
34
34
  });