@xylabs/ts-scripts-yarn3 7.0.0 → 7.0.2

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 (53) hide show
  1. package/dist/actions/deplint/checkPackage/checkPackage.mjs +11 -1
  2. package/dist/actions/deplint/checkPackage/checkPackage.mjs.map +1 -1
  3. package/dist/actions/deplint/checkPackage/index.mjs +11 -1
  4. package/dist/actions/deplint/checkPackage/index.mjs.map +1 -1
  5. package/dist/actions/deplint/deplint.mjs +33 -21
  6. package/dist/actions/deplint/deplint.mjs.map +1 -1
  7. package/dist/actions/deplint/index.mjs +33 -21
  8. package/dist/actions/deplint/index.mjs.map +1 -1
  9. package/dist/actions/index.mjs +132 -108
  10. package/dist/actions/index.mjs.map +1 -1
  11. package/dist/actions/package/compile/compile.mjs +25 -74
  12. package/dist/actions/package/compile/compile.mjs.map +1 -1
  13. package/dist/actions/package/compile/index.mjs +25 -74
  14. package/dist/actions/package/compile/index.mjs.map +1 -1
  15. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  16. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  17. package/dist/actions/package/gen-docs.mjs +1 -1
  18. package/dist/actions/package/gen-docs.mjs.map +1 -1
  19. package/dist/actions/package/index.mjs +96 -84
  20. package/dist/actions/package/index.mjs.map +1 -1
  21. package/dist/actions/package/publint.mjs +27 -10
  22. package/dist/actions/package/publint.mjs.map +1 -1
  23. package/dist/actions/package/recompile.mjs +25 -74
  24. package/dist/actions/package/recompile.mjs.map +1 -1
  25. package/dist/actions/publint.mjs +3 -3
  26. package/dist/actions/publint.mjs.map +1 -1
  27. package/dist/bin/package/build-only.mjs +27 -76
  28. package/dist/bin/package/build-only.mjs.map +1 -1
  29. package/dist/bin/package/build.mjs +27 -76
  30. package/dist/bin/package/build.mjs.map +1 -1
  31. package/dist/bin/package/compile-only.mjs +27 -76
  32. package/dist/bin/package/compile-only.mjs.map +1 -1
  33. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  34. package/dist/bin/package/compile.mjs +27 -76
  35. package/dist/bin/package/compile.mjs.map +1 -1
  36. package/dist/bin/package/gen-docs.mjs +1 -1
  37. package/dist/bin/package/gen-docs.mjs.map +1 -1
  38. package/dist/bin/package/publint.mjs +27 -10
  39. package/dist/bin/package/publint.mjs.map +1 -1
  40. package/dist/bin/package/recompile.mjs +27 -76
  41. package/dist/bin/package/recompile.mjs.map +1 -1
  42. package/dist/bin/xy.mjs +38 -25
  43. package/dist/bin/xy.mjs.map +1 -1
  44. package/dist/index.d.ts +125 -96
  45. package/dist/index.mjs +134 -109
  46. package/dist/index.mjs.map +1 -1
  47. package/dist/xy/index.mjs +38 -25
  48. package/dist/xy/index.mjs.map +1 -1
  49. package/dist/xy/xy.mjs +38 -25
  50. package/dist/xy/xy.mjs.map +1 -1
  51. package/dist/xy/xyLintCommands.mjs +38 -25
  52. package/dist/xy/xyLintCommands.mjs.map +1 -1
  53. package/package.json +12 -14
package/dist/index.d.ts CHANGED
@@ -71,12 +71,104 @@ declare const cycleAll: ({ verbose }: {
71
71
 
72
72
  declare const dead: () => number;
73
73
 
74
- declare const deplint: ({ pkg, deps, devDeps, peerDeps, }: {
75
- deps: boolean;
76
- devDeps: boolean;
77
- peerDeps: boolean;
78
- pkg: string;
79
- }) => number;
74
+ declare const checkResult: (name: string, result: number, level?: "error" | "warn", exitOnFail?: boolean) => void;
75
+
76
+ declare const createBuildConfig: (location: string, module: "ESNext" | "CommonJS", target: "ESNext" | "ES6", outDirSuffix: string) => Record<string, unknown> | undefined;
77
+
78
+ declare const defaultBuildConfig: {
79
+ compilerOptions: {
80
+ rootDir: string;
81
+ rootDirs: string[];
82
+ };
83
+ exclude: string[];
84
+ include: string[];
85
+ };
86
+
87
+ declare const deleteGlob: (globPath: string) => void;
88
+
89
+ declare const detectDuplicateDependencies: (depsFromPackageJSON?: string[], DefaultDependencies?: string[]) => number;
90
+
91
+ declare class DuplicateDetector {
92
+ private dependency;
93
+ private dependencyEntries;
94
+ constructor(output: string, dependency: string);
95
+ detect(): 1 | 0;
96
+ private detectReducer;
97
+ private resultsFactory;
98
+ }
99
+
100
+ declare const WINDOWS_NEWLINE_REGEX: RegExp;
101
+ declare const CROSS_PLATFORM_NEWLINE = "\n";
102
+
103
+ type ReadFileSyncOptions = BufferEncoding | {
104
+ encoding: BufferEncoding;
105
+ flags?: string;
106
+ };
107
+ declare const defaultReadFileSyncOptions: ReadFileSyncOptions;
108
+
109
+ declare const readLines: (uri: PathLike, options?: ReadFileSyncOptions) => string[];
110
+ declare const readNonEmptyLines: (uri: PathLike, options?: ReadFileSyncOptions) => string[];
111
+ declare const writeLines: (uri: PathLike, lines: string[], options?: WriteFileOptions) => void;
112
+
113
+ declare const tryReadFileSync: (uri: PathLike, options?: ReadFileSyncOptions) => string | undefined;
114
+
115
+ declare const generateIgnoreFiles: (filename: string, pkg?: string) => 1 | 0;
116
+
117
+ declare const multiLineToJSONArray: (output: string) => any;
118
+
119
+ declare const loadConfig: <T extends object>(params?: T) => Promise<T>;
120
+
121
+ declare const parsedPackageJSON: (path?: string) => any;
122
+
123
+ declare const processEx: (ex: unknown) => never;
124
+
125
+ type ScriptStep = [/* command */ /* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ /* arg */ string | string[]] | [/* command */ string, /* arg */ /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding];
126
+ declare const runSteps: (name: string, steps: ScriptStep[], exitOnFail?: boolean, messages?: string[]) => number;
127
+
128
+ declare const runStepAsync: (name: string, step: ScriptStep, exitOnFail?: boolean, message?: string) => Promise<number>;
129
+ declare const runStepsAsync: (name: string, steps: ScriptStep[], exitOnFail?: boolean, messages?: string[]) => Promise<number>;
130
+
131
+ declare const runXy: (command: string) => number;
132
+
133
+ declare const runXyWithWarning: (command: string) => number;
134
+
135
+ /** Catch child process a crash and returns the code */
136
+ declare const safeExit: (func: () => number, exitOnFail?: boolean) => number;
137
+ declare const safeExitAsync: (func: () => Promise<number>, exitOnFail?: boolean) => Promise<number>;
138
+
139
+ declare const empty: (value?: string | undefined) => boolean;
140
+ declare const notEmpty: (value?: string | undefined) => boolean;
141
+
142
+ declare const union: (a: string[], b: string[]) => Set<string>;
143
+
144
+ declare const withErrnoException: <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(ex: unknown, closure: (error: T) => number) => number | undefined;
145
+
146
+ declare const withError: <T extends Error = Error>(ex: any, closure: (error: T) => number, predicate?: (ex: T) => boolean) => number | undefined;
147
+
148
+ declare const isYarnVersionOrGreater: (major: number, minor?: number, patch?: number) => [boolean, string];
149
+
150
+ interface Workspace {
151
+ location: string;
152
+ name: string;
153
+ }
154
+
155
+ declare const yarnWorkspace: (pkg: string) => Workspace;
156
+
157
+ declare const yarnWorkspaces: () => Workspace[];
158
+
159
+ declare const INIT_CWD: () => string | undefined;
160
+
161
+ interface CheckPackageOptions {
162
+ deps?: boolean;
163
+ devDeps?: boolean;
164
+ peerDeps?: boolean;
165
+ verbose?: boolean;
166
+ }
167
+
168
+ interface DepLintOptions extends CheckPackageOptions {
169
+ pkg?: string;
170
+ }
171
+ declare const deplint: ({ pkg, deps, devDeps, peerDeps, verbose, }: DepLintOptions) => number;
80
172
 
81
173
  declare const deploy: () => number;
82
174
 
@@ -162,6 +254,7 @@ interface CompileConfig {
162
254
  bundleTypes?: boolean;
163
255
  /** @param entryMode all, single, custom, platform, or auto */
164
256
  entryMode?: EntryMode;
257
+ /** @param when building types with tsc, should it use the outDir to write to? */
165
258
  outDirAsBuildDir?: boolean;
166
259
  }
167
260
  type PackageCompileTsupConfig = CompileConfig & {
@@ -171,6 +264,7 @@ type PackageCompileTsupConfig = CompileConfig & {
171
264
  tsup?: {
172
265
  options?: Options;
173
266
  };
267
+ verbose?: boolean;
174
268
  };
175
269
  type PackageCompileTscConfig = CompileConfig & {
176
270
  mode: 'tsc';
@@ -179,6 +273,7 @@ interface XyConfigBase {
179
273
  compile?: CompileConfig;
180
274
  dynamicShare?: DynamicShareConfig;
181
275
  liveShare?: LiveShareConfig;
276
+ /** @deprecated */
182
277
  publint?: boolean;
183
278
  verbose?: boolean;
184
279
  }
@@ -188,7 +283,27 @@ interface XyTsupConfig extends XyConfigBase {
188
283
  interface XyTscConfig extends XyConfigBase {
189
284
  compile?: PackageCompileTscConfig;
190
285
  }
191
- type XyConfig = XyTsupConfig | XyTscConfig;
286
+ type XyConfigLegacy = XyTsupConfig | XyTscConfig;
287
+ type XyConfig = XyConfigLegacy & {
288
+ dev?: {
289
+ build?: {
290
+ clean?: boolean;
291
+ compile?: boolean;
292
+ deplint?: boolean;
293
+ gendocs?: boolean;
294
+ gitlint?: boolean;
295
+ knip?: boolean;
296
+ license?: boolean;
297
+ lint?: boolean;
298
+ publint?: boolean;
299
+ statics?: boolean;
300
+ verbose?: boolean;
301
+ };
302
+ compile?: PackageCompileTsupConfig;
303
+ verbose?: boolean;
304
+ };
305
+ verbose?: boolean;
306
+ };
192
307
 
193
308
  declare const packageCompile: (inConfig?: XyConfig) => Promise<number>;
194
309
 
@@ -212,9 +327,10 @@ declare const packageGenDocs: () => Promise<number | undefined>;
212
327
  declare const packageLint: (fix?: boolean, verbose?: boolean, cache?: boolean) => Promise<number>;
213
328
 
214
329
  interface PackagePublintParams {
330
+ strict?: boolean;
215
331
  verbose?: boolean;
216
332
  }
217
- declare const packagePublint: (params?: PackagePublintParams) => Promise<number>;
333
+ declare const packagePublint: ({ strict, verbose }?: PackagePublintParams) => Promise<number>;
218
334
 
219
335
  declare const packageRecompile: () => Promise<number>;
220
336
 
@@ -285,93 +401,6 @@ declare const updateYarnVersion: () => number;
285
401
 
286
402
  declare const yarn3Only: () => number;
287
403
 
288
- declare const checkResult: (name: string, result: number, level?: "error" | "warn", exitOnFail?: boolean) => void;
289
-
290
- declare const createBuildConfig: (location: string, module: "ESNext" | "CommonJS", target: "ESNext" | "ES6", outDirSuffix: string) => Record<string, unknown> | undefined;
291
-
292
- declare const defaultBuildConfig: {
293
- compilerOptions: {
294
- rootDir: string;
295
- rootDirs: string[];
296
- };
297
- exclude: string[];
298
- include: string[];
299
- };
300
-
301
- declare const deleteGlob: (globPath: string) => void;
302
-
303
- declare const detectDuplicateDependencies: (depsFromPackageJSON?: string[], DefaultDependencies?: string[]) => number;
304
-
305
- declare class DuplicateDetector {
306
- private dependency;
307
- private dependencyEntries;
308
- constructor(output: string, dependency: string);
309
- detect(): 1 | 0;
310
- private detectReducer;
311
- private resultsFactory;
312
- }
313
-
314
- declare const WINDOWS_NEWLINE_REGEX: RegExp;
315
- declare const CROSS_PLATFORM_NEWLINE = "\n";
316
-
317
- type ReadFileSyncOptions = BufferEncoding | {
318
- encoding: BufferEncoding;
319
- flags?: string;
320
- };
321
- declare const defaultReadFileSyncOptions: ReadFileSyncOptions;
322
-
323
- declare const readLines: (uri: PathLike, options?: ReadFileSyncOptions) => string[];
324
- declare const readNonEmptyLines: (uri: PathLike, options?: ReadFileSyncOptions) => string[];
325
- declare const writeLines: (uri: PathLike, lines: string[], options?: WriteFileOptions) => void;
326
-
327
- declare const tryReadFileSync: (uri: PathLike, options?: ReadFileSyncOptions) => string | undefined;
328
-
329
- declare const generateIgnoreFiles: (filename: string, pkg?: string) => 1 | 0;
330
-
331
- declare const multiLineToJSONArray: (output: string) => any;
332
-
333
- declare const loadConfig: <T extends object>(params?: T) => Promise<T>;
334
-
335
- declare const parsedPackageJSON: (path?: string) => any;
336
-
337
- declare const processEx: (ex: unknown) => never;
338
-
339
- type ScriptStep = [/* command */ /* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ /* arg */ string | string[]] | [/* command */ string, /* arg */ /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding];
340
- declare const runSteps: (name: string, steps: ScriptStep[], exitOnFail?: boolean, messages?: string[]) => number;
341
-
342
- declare const runStepAsync: (name: string, step: ScriptStep, exitOnFail?: boolean, message?: string) => Promise<number>;
343
- declare const runStepsAsync: (name: string, steps: ScriptStep[], exitOnFail?: boolean, messages?: string[]) => Promise<number>;
344
-
345
- declare const runXy: (command: string) => number;
346
-
347
- declare const runXyWithWarning: (command: string) => number;
348
-
349
- /** Catch child process a crash and returns the code */
350
- declare const safeExit: (func: () => number, exitOnFail?: boolean) => number;
351
- declare const safeExitAsync: (func: () => Promise<number>, exitOnFail?: boolean) => Promise<number>;
352
-
353
- declare const empty: (value?: string | undefined) => boolean;
354
- declare const notEmpty: (value?: string | undefined) => boolean;
355
-
356
- declare const union: (a: string[], b: string[]) => Set<string>;
357
-
358
- declare const withErrnoException: <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(ex: unknown, closure: (error: T) => number) => number | undefined;
359
-
360
- declare const withError: <T extends Error = Error>(ex: any, closure: (error: T) => number, predicate?: (ex: T) => boolean) => number | undefined;
361
-
362
- declare const isYarnVersionOrGreater: (major: number, minor?: number, patch?: number) => [boolean, string];
363
-
364
- interface Workspace {
365
- location: string;
366
- name: string;
367
- }
368
-
369
- declare const yarnWorkspace: (pkg: string) => Workspace;
370
-
371
- declare const yarnWorkspaces: () => Workspace[];
372
-
373
- declare const INIT_CWD: () => string | undefined;
374
-
375
404
  type PackageJsonEx = PackageJson & {
376
405
  type: 'module' | 'commonjs';
377
406
  };
@@ -399,4 +428,4 @@ declare const xyLintCommands: (args: Argv) => Argv<{}>;
399
428
 
400
429
  declare const xyParseOptions: () => Argv;
401
430
 
402
- export { type BuildParams, CROSS_PLATFORM_NEWLINE, type CleanPackageParams, type CleanParams, type CompileConfig, type CompileParams, type CopyAssetsParams, type CycleParams, DuplicateDetector, type DynamicShareConfig, type EntryMode, type GenDocsPackageParams, type GenDocsParams, INIT_CWD, type LintPackageParams, type LintParams, type LiveShareConfig, type PackageCompileTscConfig, type PackageCompileTsupConfig, type PackageCopyAssetsParams, type PackageJsonEx, type PackagePublintParams, type PathConfig, type PublintPackageParams, type PublintParams, type ReadFileSyncOptions, type RebuildParams, type RecompilePackageParams, type RecompileParams, type RelintPackageParams, type RelintParams, type ScriptStep, WINDOWS_NEWLINE_REGEX, type Workspace, type XyConfig, type XyConfigBase, type XyTscConfig, type XyTsupConfig, build, bundleDts, checkResult, clean, cleanAll, cleanDocs, cleanPackage, compile, compileAll, compilePackage, copyAssets, createBuildConfig, cycle, cycleAll, cyclePackage, dead, defaultBuildConfig, defaultReadFileSyncOptions, deleteGlob, deplint, deploy, deployMajor, deployMinor, deployNext, detectDuplicateDependencies, dupdeps, empty, fix, genDocs, genDocsAll, genDocsPackage, generateIgnoreFiles, gitignoreGen, gitlint, gitlintFix, isYarnVersionOrGreater, knip, license, lint, lintAllPackages, lintPackage, loadConfig, loadPackageConfig, multiLineToJSONArray, notEmpty, npmignoreGen, packageClean, packageCleanOutputs, packageCleanTypescript, packageCompile, packageCompileTsc, packageCompileTscTypes, packageCompileTsup, packageCopyAssets, packageCycle, packageGenDocs, packageLint, packagePublint, packageRecompile, parsedPackageJSON, processEx, publint, publintAll, publintPackage, readLines, readNonEmptyLines, rebuild, recompile, recompileAll, recompilePackage, reinstall, relint, relintAllPackages, relintPackage, retest, runStepAsync, runSteps, runStepsAsync, runXy, runXyWithWarning, safeExit, safeExitAsync, sonar, statics, test, tryReadFileSync, tsupOptions, union, up, updateYarnPlugins, updateYarnVersion, updo, withErrnoException, withError, writeLines, xy, xyBuildCommands, xyCommonCommands, xyDeployCommands, xyInstallCommands, xyLintCommands, xyParseOptions, yarn3Only, yarnWorkspace, yarnWorkspaces };
431
+ export { type BuildParams, CROSS_PLATFORM_NEWLINE, type CleanPackageParams, type CleanParams, type CompileConfig, type CompileParams, type CopyAssetsParams, type CycleParams, type DepLintOptions, DuplicateDetector, type DynamicShareConfig, type EntryMode, type GenDocsPackageParams, type GenDocsParams, INIT_CWD, type LintPackageParams, type LintParams, type LiveShareConfig, type PackageCompileTscConfig, type PackageCompileTsupConfig, type PackageCopyAssetsParams, type PackageJsonEx, type PackagePublintParams, type PathConfig, type PublintPackageParams, type PublintParams, type ReadFileSyncOptions, type RebuildParams, type RecompilePackageParams, type RecompileParams, type RelintPackageParams, type RelintParams, type ScriptStep, WINDOWS_NEWLINE_REGEX, type Workspace, type XyConfig, type XyConfigBase, type XyConfigLegacy, type XyTscConfig, type XyTsupConfig, build, bundleDts, checkResult, clean, cleanAll, cleanDocs, cleanPackage, compile, compileAll, compilePackage, copyAssets, createBuildConfig, cycle, cycleAll, cyclePackage, dead, defaultBuildConfig, defaultReadFileSyncOptions, deleteGlob, deplint, deploy, deployMajor, deployMinor, deployNext, detectDuplicateDependencies, dupdeps, empty, fix, genDocs, genDocsAll, genDocsPackage, generateIgnoreFiles, gitignoreGen, gitlint, gitlintFix, isYarnVersionOrGreater, knip, license, lint, lintAllPackages, lintPackage, loadConfig, loadPackageConfig, multiLineToJSONArray, notEmpty, npmignoreGen, packageClean, packageCleanOutputs, packageCleanTypescript, packageCompile, packageCompileTsc, packageCompileTscTypes, packageCompileTsup, packageCopyAssets, packageCycle, packageGenDocs, packageLint, packagePublint, packageRecompile, parsedPackageJSON, processEx, publint, publintAll, publintPackage, readLines, readNonEmptyLines, rebuild, recompile, recompileAll, recompilePackage, reinstall, relint, relintAllPackages, relintPackage, retest, runStepAsync, runSteps, runStepsAsync, runXy, runXyWithWarning, safeExit, safeExitAsync, sonar, statics, test, tryReadFileSync, tsupOptions, union, up, updateYarnPlugins, updateYarnVersion, updo, withErrnoException, withError, writeLines, xy, xyBuildCommands, xyCommonCommands, xyDeployCommands, xyInstallCommands, xyLintCommands, xyParseOptions, yarn3Only, yarnWorkspace, yarnWorkspaces };