@storm-software/workspace-tools 1.21.8 → 1.21.9

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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.21.8](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.21.7...workspace-tools-v1.21.8) (2023-12-03)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **workspace-tools:** Resolved issues with logging styling ([cc1ce21](https://github.com/storm-software/storm-ops/commit/cc1ce2167cf8be22db62ea73ed11ec2753fd6a0c))
7
+
1
8
  ## [1.21.7](https://github.com/storm-software/storm-ops/compare/workspace-tools-v1.21.6...workspace-tools-v1.21.7) (2023-12-03)
2
9
 
3
10
 
package/index.js CHANGED
@@ -109706,6 +109706,136 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
109706
109706
  }
109707
109707
  };
109708
109708
 
109709
+ // node_modules/.pnpm/esbuild-plugin-pino@2.1.0_esbuild@0.19.5/node_modules/esbuild-plugin-pino/dist/index.mjs
109710
+ var import_module = require("module");
109711
+ var import_node_path = __toESM(require("node:path"), 1);
109712
+ var import_promises = require("node:fs/promises");
109713
+ var import_meta2 = {};
109714
+ var require$1 = true ? /* @__PURE__ */ (0, import_module.createRequire)(import_meta2.url) : require;
109715
+ function isStringArray(entryPoints) {
109716
+ if (Array.isArray(entryPoints) && entryPoints.some((entrypoint) => typeof entrypoint === "string"))
109717
+ return true;
109718
+ return false;
109719
+ }
109720
+ function transformToObject(entryPoints, outbase) {
109721
+ const separator = entryPoints[0].includes("\\") ? import_node_path.default.win32.sep : import_node_path.default.posix.sep;
109722
+ if (!outbase) {
109723
+ const hierarchy = entryPoints[0].split(separator);
109724
+ let i = 0;
109725
+ outbase = "";
109726
+ let nextOutbase = "";
109727
+ do {
109728
+ outbase = nextOutbase;
109729
+ i++;
109730
+ nextOutbase = hierarchy.slice(0, i).join(separator);
109731
+ } while (entryPoints.every(
109732
+ (entrypoint) => entrypoint.startsWith(`${nextOutbase}${separator}`)
109733
+ ));
109734
+ }
109735
+ const newEntrypoints = {};
109736
+ for (const entrypoint of entryPoints) {
109737
+ const destination = (outbase ? entrypoint.replace(`${outbase}${separator}`, "") : entrypoint).replace(/.(js|ts)$/, "");
109738
+ newEntrypoints[destination] = entrypoint;
109739
+ }
109740
+ return newEntrypoints;
109741
+ }
109742
+ function transformToNewEntryPointsType(entryPoints) {
109743
+ const newEntrypointsType = [];
109744
+ for (const [key, value] of Object.entries(entryPoints)) {
109745
+ newEntrypointsType.push({ in: value, out: key });
109746
+ }
109747
+ return newEntrypointsType;
109748
+ }
109749
+ function esbuildPluginPino({
109750
+ transports = []
109751
+ }) {
109752
+ return {
109753
+ name: "pino",
109754
+ setup(currentBuild) {
109755
+ const pino = import_node_path.default.dirname(require$1.resolve("pino"));
109756
+ const threadStream = import_node_path.default.dirname(require$1.resolve("thread-stream"));
109757
+ const { entryPoints, outbase, outExtension: outExtension2 } = currentBuild.initialOptions;
109758
+ const customEntrypoints = {
109759
+ "thread-stream-worker": import_node_path.default.join(threadStream, "lib/worker.js"),
109760
+ "pino-worker": import_node_path.default.join(pino, "lib/worker.js"),
109761
+ "pino-pipeline-worker": import_node_path.default.join(pino, "lib/worker-pipeline.js"),
109762
+ "pino-file": import_node_path.default.join(pino, "file.js")
109763
+ };
109764
+ const transportsEntrypoints = Object.fromEntries(
109765
+ transports.map((transport) => [transport, require$1.resolve(transport)])
109766
+ );
109767
+ let newEntrypoints = [];
109768
+ if (isStringArray(entryPoints)) {
109769
+ newEntrypoints = transformToNewEntryPointsType({
109770
+ ...transformToObject(entryPoints, outbase),
109771
+ ...customEntrypoints,
109772
+ ...transportsEntrypoints
109773
+ });
109774
+ } else if (Array.isArray(entryPoints)) {
109775
+ newEntrypoints = [
109776
+ ...entryPoints,
109777
+ ...transformToNewEntryPointsType({
109778
+ ...customEntrypoints,
109779
+ ...transportsEntrypoints
109780
+ })
109781
+ ];
109782
+ } else {
109783
+ newEntrypoints = transformToNewEntryPointsType({
109784
+ ...entryPoints,
109785
+ ...customEntrypoints,
109786
+ ...transportsEntrypoints
109787
+ });
109788
+ }
109789
+ currentBuild.initialOptions.entryPoints = newEntrypoints;
109790
+ let pinoBundlerRan = false;
109791
+ currentBuild.onEnd(() => {
109792
+ pinoBundlerRan = false;
109793
+ });
109794
+ currentBuild.onLoad({ filter: /pino\.js$/ }, async (args) => {
109795
+ if (pinoBundlerRan)
109796
+ return;
109797
+ pinoBundlerRan = true;
109798
+ const contents = await (0, import_promises.readFile)(args.path, "utf8");
109799
+ let absoluteOutputPath = "";
109800
+ const { outdir = "dist" } = currentBuild.initialOptions;
109801
+ if (import_node_path.default.isAbsolute(outdir)) {
109802
+ absoluteOutputPath = outdir.replace(/\\/g, "\\\\");
109803
+ } else {
109804
+ const workingDir = currentBuild.initialOptions.absWorkingDir ? `"${currentBuild.initialOptions.absWorkingDir.replace(/\\/g, "\\\\")}"` : "process.cwd()";
109805
+ absoluteOutputPath = `\${${workingDir}}\${require('path').sep}${currentBuild.initialOptions.outdir || "dist"}`;
109806
+ }
109807
+ const functionDeclaration = `
109808
+ function pinoBundlerAbsolutePath(p) {
109809
+ try {
109810
+ return require('path').join(\`${absoluteOutputPath}\`.replace(/\\\\/g, '/'), p)
109811
+ } catch(e) {
109812
+ const f = new Function('p', 'return new URL(p, import.meta.url).pathname');
109813
+ return f(p)
109814
+ }
109815
+ }
109816
+ `;
109817
+ let extension = ".js";
109818
+ if (outExtension2 && outExtension2[".js"]) {
109819
+ extension = outExtension2[".js"];
109820
+ }
109821
+ const pinoOverrides = Object.keys({
109822
+ ...customEntrypoints,
109823
+ ...transportsEntrypoints
109824
+ }).map(
109825
+ (id) => `'${id === "pino-file" ? "pino/file" : id}': pinoBundlerAbsolutePath('./${id}${extension}')`
109826
+ ).join(",");
109827
+ const globalThisDeclaration = `
109828
+ globalThis.__bundlerPathsOverrides = { ...(globalThis.__bundlerPathsOverrides || {}), ${pinoOverrides}}
109829
+ `;
109830
+ const code = functionDeclaration + globalThisDeclaration;
109831
+ return {
109832
+ contents: code + contents
109833
+ };
109834
+ });
109835
+ }
109836
+ };
109837
+ }
109838
+
109709
109839
  // packages/workspace-tools/src/utils/get-file-banner.ts
109710
109840
  var getFileBanner = (name, commentStart = "//") => {
109711
109841
  let padding = "";
@@ -109789,7 +109919,7 @@ var environmentPlugin = (data) => ({
109789
109919
  // packages/workspace-tools/src/executors/tsup/executor.ts
109790
109920
  var import_fs3 = require("fs");
109791
109921
  var import_fs_extra = __toESM(require_lib4());
109792
- var import_promises2 = require("fs/promises");
109922
+ var import_promises3 = require("fs/promises");
109793
109923
 
109794
109924
  // node_modules/.pnpm/minimatch@9.0.3/node_modules/minimatch/dist/mjs/index.js
109795
109925
  var import_brace_expansion = __toESM(require_brace_expansion2(), 1);
@@ -110460,11 +110590,11 @@ var qmarksTestNoExtDot = ([$0]) => {
110460
110590
  return (f) => f.length === len && f !== "." && f !== "..";
110461
110591
  };
110462
110592
  var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
110463
- var path = {
110593
+ var path2 = {
110464
110594
  win32: { sep: "\\" },
110465
110595
  posix: { sep: "/" }
110466
110596
  };
110467
- var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
110597
+ var sep = defaultPlatform === "win32" ? path2.win32.sep : path2.posix.sep;
110468
110598
  minimatch.sep = sep;
110469
110599
  var GLOBSTAR = Symbol("globstar **");
110470
110600
  minimatch.GLOBSTAR = GLOBSTAR;
@@ -112355,7 +112485,7 @@ var import_path2 = require("path");
112355
112485
  var import_url = require("url");
112356
112486
  var actualFS = __toESM(require("fs"), 1);
112357
112487
  var import_fs2 = require("fs");
112358
- var import_promises = require("fs/promises");
112488
+ var import_promises2 = require("fs/promises");
112359
112489
 
112360
112490
  // node_modules/.pnpm/minipass@7.0.4/node_modules/minipass/dist/esm/index.js
112361
112491
  var import_events = require("events");
@@ -113244,10 +113374,10 @@ var defaultFS = {
113244
113374
  readlinkSync: import_fs2.readlinkSync,
113245
113375
  realpathSync,
113246
113376
  promises: {
113247
- lstat: import_promises.lstat,
113248
- readdir: import_promises.readdir,
113249
- readlink: import_promises.readlink,
113250
- realpath: import_promises.realpath
113377
+ lstat: import_promises2.lstat,
113378
+ readdir: import_promises2.readdir,
113379
+ readlink: import_promises2.readlink,
113380
+ realpath: import_promises2.realpath
113251
113381
  }
113252
113382
  };
113253
113383
  var fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === actualFS ? defaultFS : {
@@ -115974,13 +116104,13 @@ var import_tsup2 = __toESM(require_dist6());
115974
116104
  var ts = __toESM(require("typescript"));
115975
116105
 
115976
116106
  // packages/workspace-tools/src/utils/file-path-utils.ts
115977
- var import_node_path = require("node:path");
116107
+ var import_node_path2 = require("node:path");
115978
116108
  var removeExtension = (filePath) => {
115979
116109
  return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
115980
116110
  };
115981
116111
  function findFileName(filePath) {
115982
116112
  return filePath?.split(
115983
- filePath?.includes(import_node_path.sep) ? import_node_path.sep : filePath?.includes("/") ? "/" : "\\"
116113
+ filePath?.includes(import_node_path2.sep) ? import_node_path2.sep : filePath?.includes("/") ? "/" : "\\"
115984
116114
  )?.pop() ?? "";
115985
116115
  }
115986
116116
 
@@ -116456,7 +116586,7 @@ ${externalDependencies.map((dep) => {
116456
116586
  ]);
116457
116587
  await Promise.allSettled(
116458
116588
  files.map(
116459
- (file) => (0, import_promises2.writeFile)(
116589
+ (file) => (0, import_promises3.writeFile)(
116460
116590
  file,
116461
116591
  `${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
116462
116592
 
@@ -116602,7 +116732,9 @@ var executor_default = withRunExecutor(
116602
116732
 
116603
116733
  // packages/workspace-tools/src/executors/tsup-neutral/executor.ts
116604
116734
  var tsNeutralBuildExecutorFn = (options, context, config) => {
116605
- options.plugins ??= [];
116735
+ if (options.transports && Array.isArray(options.transports) && options.transports.length > 0) {
116736
+ options.plugins.push(esbuildPluginPino({ transports: options.transports }));
116737
+ }
116606
116738
  return tsupExecutorFn(
116607
116739
  {
116608
116740
  ...options,
@@ -116623,9 +116755,14 @@ var tsNeutralBuildExecutorFn = (options, context, config) => {
116623
116755
  );
116624
116756
  };
116625
116757
  var applyDefaultOptions2 = (options) => {
116626
- options = applyDefaultOptions({ ...options, platform: "neutral" });
116627
- options.plugins ??= [];
116628
- return options;
116758
+ return {
116759
+ ...applyDefaultOptions({
116760
+ plugins: [],
116761
+ ...options,
116762
+ platform: "neutral"
116763
+ }),
116764
+ transports: ["pino-pretty"]
116765
+ };
116629
116766
  };
116630
116767
  var executor_default2 = withRunExecutor(
116631
116768
  "TypeScript Build (Neutral Platform)",
@@ -116638,136 +116775,6 @@ var executor_default2 = withRunExecutor(
116638
116775
  }
116639
116776
  );
116640
116777
 
116641
- // node_modules/.pnpm/esbuild-plugin-pino@2.1.0_esbuild@0.19.5/node_modules/esbuild-plugin-pino/dist/index.mjs
116642
- var import_module = require("module");
116643
- var import_node_path2 = __toESM(require("node:path"), 1);
116644
- var import_promises3 = require("node:fs/promises");
116645
- var import_meta2 = {};
116646
- var require$1 = true ? /* @__PURE__ */ (0, import_module.createRequire)(import_meta2.url) : require;
116647
- function isStringArray(entryPoints) {
116648
- if (Array.isArray(entryPoints) && entryPoints.some((entrypoint) => typeof entrypoint === "string"))
116649
- return true;
116650
- return false;
116651
- }
116652
- function transformToObject(entryPoints, outbase) {
116653
- const separator = entryPoints[0].includes("\\") ? import_node_path2.default.win32.sep : import_node_path2.default.posix.sep;
116654
- if (!outbase) {
116655
- const hierarchy = entryPoints[0].split(separator);
116656
- let i = 0;
116657
- outbase = "";
116658
- let nextOutbase = "";
116659
- do {
116660
- outbase = nextOutbase;
116661
- i++;
116662
- nextOutbase = hierarchy.slice(0, i).join(separator);
116663
- } while (entryPoints.every(
116664
- (entrypoint) => entrypoint.startsWith(`${nextOutbase}${separator}`)
116665
- ));
116666
- }
116667
- const newEntrypoints = {};
116668
- for (const entrypoint of entryPoints) {
116669
- const destination = (outbase ? entrypoint.replace(`${outbase}${separator}`, "") : entrypoint).replace(/.(js|ts)$/, "");
116670
- newEntrypoints[destination] = entrypoint;
116671
- }
116672
- return newEntrypoints;
116673
- }
116674
- function transformToNewEntryPointsType(entryPoints) {
116675
- const newEntrypointsType = [];
116676
- for (const [key, value] of Object.entries(entryPoints)) {
116677
- newEntrypointsType.push({ in: value, out: key });
116678
- }
116679
- return newEntrypointsType;
116680
- }
116681
- function esbuildPluginPino({
116682
- transports = []
116683
- }) {
116684
- return {
116685
- name: "pino",
116686
- setup(currentBuild) {
116687
- const pino = import_node_path2.default.dirname(require$1.resolve("pino"));
116688
- const threadStream = import_node_path2.default.dirname(require$1.resolve("thread-stream"));
116689
- const { entryPoints, outbase, outExtension: outExtension2 } = currentBuild.initialOptions;
116690
- const customEntrypoints = {
116691
- "thread-stream-worker": import_node_path2.default.join(threadStream, "lib/worker.js"),
116692
- "pino-worker": import_node_path2.default.join(pino, "lib/worker.js"),
116693
- "pino-pipeline-worker": import_node_path2.default.join(pino, "lib/worker-pipeline.js"),
116694
- "pino-file": import_node_path2.default.join(pino, "file.js")
116695
- };
116696
- const transportsEntrypoints = Object.fromEntries(
116697
- transports.map((transport) => [transport, require$1.resolve(transport)])
116698
- );
116699
- let newEntrypoints = [];
116700
- if (isStringArray(entryPoints)) {
116701
- newEntrypoints = transformToNewEntryPointsType({
116702
- ...transformToObject(entryPoints, outbase),
116703
- ...customEntrypoints,
116704
- ...transportsEntrypoints
116705
- });
116706
- } else if (Array.isArray(entryPoints)) {
116707
- newEntrypoints = [
116708
- ...entryPoints,
116709
- ...transformToNewEntryPointsType({
116710
- ...customEntrypoints,
116711
- ...transportsEntrypoints
116712
- })
116713
- ];
116714
- } else {
116715
- newEntrypoints = transformToNewEntryPointsType({
116716
- ...entryPoints,
116717
- ...customEntrypoints,
116718
- ...transportsEntrypoints
116719
- });
116720
- }
116721
- currentBuild.initialOptions.entryPoints = newEntrypoints;
116722
- let pinoBundlerRan = false;
116723
- currentBuild.onEnd(() => {
116724
- pinoBundlerRan = false;
116725
- });
116726
- currentBuild.onLoad({ filter: /pino\.js$/ }, async (args) => {
116727
- if (pinoBundlerRan)
116728
- return;
116729
- pinoBundlerRan = true;
116730
- const contents = await (0, import_promises3.readFile)(args.path, "utf8");
116731
- let absoluteOutputPath = "";
116732
- const { outdir = "dist" } = currentBuild.initialOptions;
116733
- if (import_node_path2.default.isAbsolute(outdir)) {
116734
- absoluteOutputPath = outdir.replace(/\\/g, "\\\\");
116735
- } else {
116736
- const workingDir = currentBuild.initialOptions.absWorkingDir ? `"${currentBuild.initialOptions.absWorkingDir.replace(/\\/g, "\\\\")}"` : "process.cwd()";
116737
- absoluteOutputPath = `\${${workingDir}}\${require('path').sep}${currentBuild.initialOptions.outdir || "dist"}`;
116738
- }
116739
- const functionDeclaration = `
116740
- function pinoBundlerAbsolutePath(p) {
116741
- try {
116742
- return require('path').join(\`${absoluteOutputPath}\`.replace(/\\\\/g, '/'), p)
116743
- } catch(e) {
116744
- const f = new Function('p', 'return new URL(p, import.meta.url).pathname');
116745
- return f(p)
116746
- }
116747
- }
116748
- `;
116749
- let extension = ".js";
116750
- if (outExtension2 && outExtension2[".js"]) {
116751
- extension = outExtension2[".js"];
116752
- }
116753
- const pinoOverrides = Object.keys({
116754
- ...customEntrypoints,
116755
- ...transportsEntrypoints
116756
- }).map(
116757
- (id) => `'${id === "pino-file" ? "pino/file" : id}': pinoBundlerAbsolutePath('./${id}${extension}')`
116758
- ).join(",");
116759
- const globalThisDeclaration = `
116760
- globalThis.__bundlerPathsOverrides = { ...(globalThis.__bundlerPathsOverrides || {}), ${pinoOverrides}}
116761
- `;
116762
- const code = functionDeclaration + globalThisDeclaration;
116763
- return {
116764
- contents: code + contents
116765
- };
116766
- });
116767
- }
116768
- };
116769
- }
116770
-
116771
116778
  // packages/workspace-tools/src/executors/tsup-node/executor.ts
116772
116779
  var tsNodeBuildExecutorFn = (options, context, config) => {
116773
116780
  if (options.transports && Array.isArray(options.transports) && options.transports.length > 0) {
@@ -116793,10 +116800,10 @@ var tsNodeBuildExecutorFn = (options, context, config) => {
116793
116800
  );
116794
116801
  };
116795
116802
  var applyDefaultOptions3 = (options) => {
116796
- options = applyDefaultOptions({ ...options, platform: "node" });
116797
- options.plugins ??= [];
116798
- options.transports ??= ["pino-pretty", "pino-loki"];
116799
- return options;
116803
+ return {
116804
+ ...applyDefaultOptions({ plugins: [], ...options, platform: "node" }),
116805
+ transports: ["pino-pretty", "pino-loki"]
116806
+ };
116800
116807
  };
116801
116808
  var executor_default3 = withRunExecutor(
116802
116809
  "TypeScript Build (NodeJs Platform)",