@plugjs/build 0.1.0 → 0.2.1

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/src/index.ts ADDED
@@ -0,0 +1,381 @@
1
+ import '@plugjs/cov8'
2
+ import '@plugjs/eslint'
3
+ import '@plugjs/jasmine'
4
+ import {
5
+ $gry,
6
+ $wht,
7
+ build,
8
+ find,
9
+ fixExtensions,
10
+ isDirectory, log, merge,
11
+ noop,
12
+ rmrf,
13
+ } from '@plugjs/plug'
14
+ import '@plugjs/typescript'
15
+
16
+ import type { ESBuildOptions, Files, Pipe } from '@plugjs/plug'
17
+
18
+ export * from '@plugjs/plug'
19
+
20
+ /** Shared ESBuild options */
21
+ const esbuildDefaults: ESBuildOptions = {
22
+ platform: 'node',
23
+ sourcemap: 'linked',
24
+ sourcesContent: false,
25
+ plugins: [ fixExtensions() ],
26
+ }
27
+
28
+ /** Options for creating our shared build file */
29
+ export interface TasksOptions {
30
+ /* ======================================================================== *
31
+ * DIRECTORIES *
32
+ * ======================================================================== */
33
+
34
+ /** The directory for the original sources (default: `src`) */
35
+ sourceDir?: string,
36
+ /** The destination directory of the transpiled sources (default: `dist`) */
37
+ destDir?: string,
38
+ /** The directory for the test files (default: `test`) */
39
+ testDir?: string,
40
+ /** The directory for the coverage report (default: `coverage`) */
41
+ coverageDir?: string,
42
+ /** The directory for the coverage data (default: `.coverage-data`) */
43
+ coverageDataDir?: string,
44
+ /** A directory containing extra types to use while transpiling (default: `types`) */
45
+ extraTypesDir?: string,
46
+
47
+ /* ======================================================================== *
48
+ * PACKAGE.JSON OPTIONS *
49
+ * ======================================================================== */
50
+
51
+ /** The source `package.json` file (default: `package.json`) */
52
+ packageJson?: string,
53
+ /** The source `package.json` file (default: same as `packageJson` option) */
54
+ outputPackageJson?: string,
55
+
56
+ /* ======================================================================== *
57
+ * TRANSPILATION OPTIONS *
58
+ * ======================================================================== */
59
+
60
+ /** The extension used for CommonJS modules (default: `.cjs`) */
61
+ cjsExtension?: string,
62
+ /** The extension used for EcmaScript modules (default: `.mjs`) */
63
+ esmExtension?: string,
64
+ /** Enable CommonJS Modules transpilation or not (default: `true`) */
65
+ cjsTranspile?: boolean,
66
+ /** Enable EcmaScript Modules transpilation or not (default: `true`) */
67
+ esmTranspile?: boolean,
68
+
69
+ /* ======================================================================== *
70
+ * OTHER OPTIONS *
71
+ * ======================================================================== */
72
+
73
+ /** Enable or disable banners (default: `true` if `parallelize` is `false`) */
74
+ banners?: boolean,
75
+ /** Parallelize tasks (might make output confusing, default: `false`) */
76
+ parallelize?: boolean,
77
+ /** A glob pattern matching all test files (default: `**∕*.test.([cm])?ts`) */
78
+ testGlob?: string,
79
+ /** A glob pattern matching files to be exported (default: `index.*`) */
80
+ exportsGlob?: string,
81
+ /** Enable coverage when running tests (default: `true`) */
82
+ coverage?: boolean,
83
+ /** Minimum overall coverage percentage (default: `100`) */
84
+ minimumCoverage?: number,
85
+ /** Minimum per-file coverage percentage (default: `100`) */
86
+ minimumFileCoverage?: number,
87
+ /** Optimal overall coverage percentage (default: _none_) */
88
+ optimalCoverage?: number,
89
+ /** Optimal per-file coverage percentage (default: _none_) */
90
+ optimalFileCoverage?: number,
91
+
92
+
93
+ /**
94
+ * ESBuild compilation options
95
+ *
96
+ * Default:
97
+ *
98
+ * ```
99
+ * {
100
+ * platform: 'node',
101
+ * sourcemap: 'linked',
102
+ * sourcesContent: false,
103
+ * plugins: [ fixExtensions() ],
104
+ * }
105
+ * ```
106
+ */
107
+ esbuildOptions?: ESBuildOptions,
108
+ }
109
+
110
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
111
+ export function tasks(options: TasksOptions = {}) {
112
+ const {
113
+ sourceDir: _sourceDir = 'src',
114
+ destDir: _destDir = 'dist',
115
+ testDir: _testDir = 'test',
116
+ coverageDir: _coverageDir = 'coverage',
117
+ coverageDataDir: _coverageDataDir = '.coverage-data',
118
+ extraTypesDir: _extraTypesDir = 'types',
119
+
120
+ packageJson: _packageJson = 'package.json',
121
+ outputPackageJson: _outputPackageJson = _packageJson,
122
+
123
+ cjsExtension: _cjsExtension = '.cjs',
124
+ esmExtension: _esmExtension = '.mjs',
125
+ cjsTranspile: _cjsTranspile = true,
126
+ esmTranspile: _esmTranspile = true,
127
+
128
+ parallelize: _parallelize = false,
129
+ banners: _banners = !_parallelize,
130
+ testGlob: _testGlob = '**/*.test.([cm])?ts',
131
+ exportsGlob: _exportsGlob = 'index.*',
132
+ coverage: _coverage = true,
133
+ minimumCoverage: _minimumCoverage = 100,
134
+ minimumFileCoverage: _minimumFileCoverage = 100,
135
+ optimalCoverage: _optimalCoverage = undefined,
136
+ optimalFileCoverage: _optimalFileCoverage = undefined,
137
+
138
+ esbuildOptions: _esbuildOptions = {},
139
+ } = options
140
+
141
+ // coverage ignore next
142
+ const banner = _banners ? emitBanner : (...args: any) => void args
143
+
144
+ // Merge esbuild defaults with specified options
145
+ const esbuildMergedOptions = Object.assign({}, esbuildDefaults, _esbuildOptions)
146
+
147
+ return build({
148
+ /** The directory for the original sources (default: `src`) */
149
+ sourceDir: _sourceDir,
150
+ /** The destination directory of the transpiled sources (default: `dist`) */
151
+ destDir: _destDir,
152
+ /** The directory for the test files (default: `test`) */
153
+ testDir: _testDir,
154
+ /** The directory for the coverage report (default: `coverage`) */
155
+ coverageDir: _coverageDir,
156
+ /** The directory for the coverage data (default: `.coverage-data`) */
157
+ coverageDataDir: _coverageDataDir,
158
+ /** A directory containing extra types to use while transpiling (default: `types`) */
159
+ extraTypesDir: _extraTypesDir,
160
+ /** The source `package.json` file (default: `package.json`) */
161
+ packageJson: _packageJson,
162
+ /** The source `package.json` file (default: same as `packageJson` option) */
163
+ outputPackageJson: _outputPackageJson,
164
+ /** The extension used for CommonJS modules (default: `.cjs`) */
165
+ cjsExtension: _cjsExtension,
166
+ /** The extension used for EcmaScript modules (default: `.mjs`) */
167
+ esmExtension: _esmExtension,
168
+ /** A glob pattern matching all test files (default: `**∕*.test.([cm])?ts`) */
169
+ testGlob: _testGlob,
170
+ /** A glob pattern matching files to be exported (default: `index.*`) */
171
+ exportsGlob: _exportsGlob,
172
+
173
+ /* ====================================================================== *
174
+ * SOURCES STRUCTURE *
175
+ * ====================================================================== */
176
+
177
+ /** Find all CommonJS source files (`*.cts`) */
178
+ _find_sources_cts(): Pipe {
179
+ return find('**/*.(c)?ts', { directory: this.sourceDir, ignore: '**/*.d.ts' })
180
+ },
181
+
182
+ /** Find all EcmaScript Module source files (`*.mts`) */
183
+ _find_sources_mts(): Pipe {
184
+ return find('**/*.(m)?ts', { directory: this.sourceDir, ignore: '**/*.d.ts' })
185
+ },
186
+
187
+ /** Find all typescript source files (`*.ts`, `*.mts` and `*.cts`) */
188
+ _find_sources(): Pipe {
189
+ return merge([
190
+ _cjsTranspile ? this._find_sources_cts() : noop(),
191
+ _esmTranspile ? this._find_sources_mts() : noop(),
192
+ ])
193
+ },
194
+
195
+ /** Find all types definition files within sources */
196
+ _find_types(): Pipe {
197
+ return find('**/*.d.ts', { directory: this.sourceDir })
198
+ },
199
+
200
+ /** Find all types definition files within sources */
201
+ _find_extras(): Pipe {
202
+ if (! isDirectory(this.extraTypesDir)) return noop()
203
+ return find('**/*.d.ts', { directory: this.extraTypesDir })
204
+ },
205
+
206
+
207
+ /** Find all resource files (non-typescript files) within sources */
208
+ _find_resources(): Pipe {
209
+ return find('**/*', { directory: this.sourceDir, ignore: '**/*.([cm])?ts' })
210
+ },
211
+
212
+ /** Find all test source files */
213
+ _find_tests(): Pipe {
214
+ return find(this.testGlob, { directory: this.testDir, ignore: '**/*.d.ts' })
215
+ },
216
+
217
+ /* ====================================================================== *
218
+ * TRANSPILE *
219
+ * ====================================================================== */
220
+
221
+ /** Transpile to CJS */
222
+ transpile_cjs(): Pipe {
223
+ return this._find_sources_cts()
224
+ .esbuild({
225
+ ...esbuildMergedOptions,
226
+ format: 'cjs',
227
+ outdir: this.destDir,
228
+ outExtension: { '.js': this.cjsExtension },
229
+ })
230
+ },
231
+
232
+ /** Transpile to ESM */
233
+ transpile_esm(): Pipe {
234
+ return this._find_sources_mts()
235
+ .esbuild({
236
+ ...esbuildMergedOptions,
237
+ format: 'esm',
238
+ outdir: this.destDir,
239
+ outExtension: { '.js': this.esmExtension },
240
+ })
241
+ },
242
+
243
+ /** Generate all .d.ts files */
244
+ transpile_types(): Pipe {
245
+ return merge([
246
+ this._find_sources(),
247
+ this._find_types(),
248
+ this._find_extras(),
249
+ ]).tsc('tsconfig.json', {
250
+ noEmit: false,
251
+ rootDir: this.sourceDir,
252
+ declaration: true,
253
+ emitDeclarationOnly: true,
254
+ outDir: this.destDir,
255
+ })
256
+ },
257
+
258
+ /** Copy all resources coming alongside our sources */
259
+ transpile_resources(): Pipe {
260
+ return merge([
261
+ this._find_resources(),
262
+ this._find_types(),
263
+ ]).copy(this.destDir)
264
+ },
265
+
266
+ /** Transpile all source code */
267
+ async transpile(): Promise<Pipe> {
268
+ banner('Transpiling source files')
269
+
270
+ if (isDirectory(this.destDir)) await rmrf(this.destDir)
271
+
272
+ return merge([
273
+ _cjsTranspile ? this.transpile_cjs() : noop(),
274
+ _esmTranspile ? this.transpile_esm() : noop(),
275
+ this.transpile_types(),
276
+ this.transpile_resources(),
277
+ ])
278
+ },
279
+
280
+ /* ====================================================================== *
281
+ * TEST, COVERAGE & LINTING *
282
+ * ====================================================================== */
283
+
284
+ /** Run test and emit coverage data */
285
+ async test(): Promise<void> {
286
+ banner('Running tests')
287
+
288
+ if (_coverage && isDirectory(this.coverageDataDir)) await rmrf(this.coverageDataDir)
289
+
290
+ await this
291
+ ._find_tests()
292
+ .jasmine({ coverageDir: _coverage ? this.coverageDataDir : undefined })
293
+ },
294
+
295
+ /** Run tests (always) and generate a coverage report */
296
+ async coverage(): Promise<Pipe> {
297
+ // Capture error from running tests, but always produce coverage
298
+ let files: Files
299
+ try {
300
+ await this.test()
301
+ } finally {
302
+ banner('Preparing coverage report')
303
+ files = await this
304
+ ._find_sources()
305
+ .coverage(this.coverageDataDir, {
306
+ reportDir: this.coverageDir,
307
+ minimumCoverage: _minimumCoverage,
308
+ minimumFileCoverage: _minimumFileCoverage,
309
+ optimalCoverage: _optimalCoverage,
310
+ optimalFileCoverage: _optimalFileCoverage,
311
+ })
312
+ }
313
+
314
+ // No exceptions!
315
+ return files
316
+ },
317
+
318
+ /** Run test and emit coverage data */
319
+ async lint(): Promise<void> {
320
+ banner('Linting sources')
321
+
322
+ await merge([
323
+ this._find_sources(),
324
+ this._find_tests(),
325
+ this._find_types(),
326
+ this._find_extras(),
327
+ ]).eslint()
328
+ },
329
+
330
+ /* ====================================================================== *
331
+ * PACKAGE.JSON EXPORTS *
332
+ * ====================================================================== */
333
+
334
+ /** Inject `exports` into the `package.json` file */
335
+ async exports(): Promise<Pipe> {
336
+ const files = await this.transpile()
337
+
338
+ banner('Updating exports in "package.json"')
339
+
340
+ return merge([ files ])
341
+ .filter(this.exportsGlob, { directory: this.destDir, ignore: '**/*.map' })
342
+ .exports({
343
+ cjsExtension: this.cjsExtension,
344
+ esmExtension: this.esmExtension,
345
+ packageJson: this.packageJson,
346
+ outputPackageJson: this.outputPackageJson,
347
+ })
348
+ },
349
+
350
+ /* ====================================================================== *
351
+ * DEFAULT: DO EVERYTHING *
352
+ * ====================================================================== */
353
+
354
+ /* coverage ignore next */
355
+ /** Build everything */
356
+ async default(): Promise<void> {
357
+ if (_parallelize) {
358
+ await Promise.all([
359
+ this.transpile(),
360
+ this.coverage(), // implies "test"
361
+ this.lint(),
362
+ ])
363
+ } else {
364
+ await this.transpile()
365
+ await this.coverage() // implies "test"
366
+ await this.lint()
367
+ }
368
+ await this.exports()
369
+ },
370
+ })
371
+ }
372
+
373
+ /* coverage ignore next */
374
+ /* Leave this at the _end_ of the file, unicode messes up sitemaps... */
375
+ function emitBanner(message: string): void {
376
+ log.notice([
377
+ '', $gry(`\u2554${''.padStart(60, '\u2550')}\u2557`),
378
+ `${$gry('\u2551')} ${$wht(message.padEnd(58, ' '))} ${$gry('\u2551')}`,
379
+ $gry(`\u255A${''.padStart(60, '\u2550')}\u255D`), '',
380
+ ].join('\n'))
381
+ }
package/dist/build.cjs DELETED
@@ -1,170 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // build.ts
21
- var build_exports = {};
22
- __export(build_exports, {
23
- tasks: () => tasks
24
- });
25
- module.exports = __toCommonJS(build_exports);
26
- var import_cov8 = require("@plugjs/cov8");
27
- var import_eslint = require("@plugjs/eslint");
28
- var import_jasmine = require("@plugjs/jasmine");
29
- var import_typescript = require("@plugjs/typescript");
30
- var import_plug = require("@plugjs/plug");
31
- var esbuildDefaults = {
32
- platform: "node",
33
- sourcemap: "linked",
34
- sourcesContent: false,
35
- plugins: [(0, import_plug.fixExtensions)()]
36
- };
37
- function tasks(options = {}) {
38
- const {
39
- sourceDir = "src",
40
- destDir = "dist",
41
- testDir = "test",
42
- coverageDir = "coverage",
43
- coverageDataDir = ".coverage-data",
44
- extraTypesDir = "types",
45
- testGlob = "**/*.test.ts",
46
- disableTests = false,
47
- disableCoverage = false,
48
- disableLint = false,
49
- minimumCoverage = 100,
50
- minimumFileCoverage = 100,
51
- optimalCoverage = void 0,
52
- optimalFileCoverage = void 0,
53
- esbuildOptions = {}
54
- } = options;
55
- const esbuildMergedOptions = Object.assign({}, esbuildDefaults, esbuildOptions);
56
- return (0, import_plug.build)({
57
- find_sources_cts() {
58
- return (0, import_plug.find)("**/*.(c)?ts", { directory: sourceDir, ignore: "**/*.d.ts" });
59
- },
60
- find_sources_mts() {
61
- return (0, import_plug.find)("**/*.(m)?ts", { directory: sourceDir, ignore: "**/*.d.ts" });
62
- },
63
- find_sources() {
64
- return (0, import_plug.merge)([this.find_sources_cts(), this.find_sources_mts()]);
65
- },
66
- find_types() {
67
- return (0, import_plug.find)("**/*.d.ts", { directory: sourceDir });
68
- },
69
- find_extras() {
70
- if (!(0, import_plug.isDirectory)(extraTypesDir))
71
- return (0, import_plug.noop)();
72
- return (0, import_plug.find)("**/*.d.ts", { directory: extraTypesDir });
73
- },
74
- find_resources() {
75
- return (0, import_plug.find)("**/*", { directory: sourceDir, ignore: "**/*.([mt])?ts" });
76
- },
77
- find_tests() {
78
- return (0, import_plug.find)(testGlob, { directory: testDir, ignore: "**/*.d.ts" });
79
- },
80
- transpile_cjs() {
81
- return this.find_sources_cts().esbuild({
82
- ...esbuildMergedOptions,
83
- format: "cjs",
84
- outdir: destDir,
85
- outExtension: { ".js": ".cjs" }
86
- });
87
- },
88
- transpile_esm() {
89
- return this.find_sources_mts().esbuild({
90
- ...esbuildMergedOptions,
91
- format: "esm",
92
- outdir: destDir,
93
- outExtension: { ".js": ".mjs" }
94
- });
95
- },
96
- transpile_types() {
97
- return (0, import_plug.merge)([
98
- this.find_sources(),
99
- this.find_types(),
100
- this.find_extras()
101
- ]).tsc("tsconfig.json", {
102
- noEmit: false,
103
- rootDir: sourceDir,
104
- declaration: true,
105
- emitDeclarationOnly: true,
106
- outDir: destDir
107
- });
108
- },
109
- transpile_resources() {
110
- return (0, import_plug.merge)([
111
- this.find_resources(),
112
- this.find_types()
113
- ]).copy(destDir);
114
- },
115
- transpile() {
116
- return (0, import_plug.merge)([
117
- this.transpile_cjs(),
118
- this.transpile_esm(),
119
- this.transpile_types(),
120
- this.transpile_resources()
121
- ]);
122
- },
123
- async test() {
124
- if (disableTests) {
125
- return void import_plug.log.warn("Testing disabled");
126
- }
127
- if ((0, import_plug.isDirectory)(coverageDataDir))
128
- await (0, import_plug.rmrf)(coverageDataDir);
129
- await this.find_tests().jasmine({ coverageDir: coverageDataDir });
130
- },
131
- async coverage() {
132
- if (disableTests || disableCoverage) {
133
- return void import_plug.log.warn("Coverage disabled");
134
- }
135
- await this.test().finally(() => this.find_sources().coverage(coverageDataDir, {
136
- reportDir: coverageDir,
137
- minimumCoverage,
138
- minimumFileCoverage,
139
- optimalCoverage,
140
- optimalFileCoverage
141
- }));
142
- },
143
- async lint() {
144
- if (disableLint) {
145
- return void import_plug.log.warn("Linting disabled");
146
- }
147
- await (0, import_plug.merge)([
148
- this.find_sources(),
149
- this.find_tests(),
150
- this.find_types(),
151
- this.find_extras()
152
- ]).eslint();
153
- },
154
- async default() {
155
- if ((0, import_plug.isDirectory)(destDir))
156
- await (0, import_plug.rmrf)(destDir);
157
- await Promise.all([
158
- this.test(),
159
- this.coverage(),
160
- this.lint(),
161
- this.transpile()
162
- ]);
163
- }
164
- });
165
- }
166
- // Annotate the CommonJS export names for ESM import in node:
167
- 0 && (module.exports = {
168
- tasks
169
- });
170
- //# sourceMappingURL=build.cjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/build.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAO;AACP,oBAAO;AACP,qBAAO;AACP,wBAAO;AACP,kBASO;AAKP,IAAM,kBAAkC;AAAA,EACtC,UAAU;AAAA,EACV,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,SAAS,KAAE,2BAAc,CAAE;AAC7B;AA6DO,SAAS,MAAM,UAAwB,CAAC,GAAG;AAChD,QAAM;AAAA,IACJ,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,UAAU;AAAA,IACV,cAAc;AAAA,IACd,kBAAkB;AAAA,IACl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C1B,UAAI,aAAa;AACf,eAAO,KAAK,gBAAI,KAAK,kBAAkB;AAAA,MACzC;AAEA,gBAAM,mBAAM;AAAA,QACV,KAAK,aAAa;AAAA,QAClB,KAAK,WAAW;AAAA,QAChB,KAAK,WAAW;AAAA,QAChB,KAAK,YAAY;AAAA,MACnB,CAAC,EAAE,OAAO;AAAA,IACZ;AAAA,IAOA,MAAM,UAAyB;AAC7B,cAAI,yBAAY,OAAO;AAAG,kBAAM,kBAAK,OAAO;AAE5C,YAAM,QAAQ,IAAI;AAAA,QAChB,KAAK,KAAK;AAAA,QACV,KAAK,SAAS;AAAA,QACd,KAAK,KAAK;AAAA,QACV,KAAK,UAAU;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH;",
5
- "names": []
6
- }
package/dist/build.d.ts DELETED
@@ -1,85 +0,0 @@
1
- import '@plugjs/cov8';
2
- import '@plugjs/eslint';
3
- import '@plugjs/jasmine';
4
- import '@plugjs/typescript';
5
- import type { ESBuildOptions, Pipe } from '@plugjs/plug';
6
- /** Options for creating our shared build file */
7
- export interface TasksOptions {
8
- /** The directory for the original sources (default: `src`) */
9
- sourceDir?: string;
10
- /** The destination directory of the transpiled sources (default: `dist`) */
11
- destDir?: string;
12
- /** The directory for the test files (default: `test`) */
13
- testDir?: string;
14
- /** The directory for the coverage report (default: `coverage`) */
15
- coverageDir?: string;
16
- /** The directory for the coverage data (default: `.coverage-data`) */
17
- coverageDataDir?: string;
18
- /** A directory containing extra types to use while transpiling (default: `types`) */
19
- extraTypesDir?: string;
20
- /** A glob pattern matching all test files (default: `**∕*.test.ts`) */
21
- testGlob?: string;
22
- /** Whether to disable tests or not (defailt: `false`) */
23
- disableTests?: boolean;
24
- /** Whether to disable code coverage or not (defailt: `false`) */
25
- disableCoverage?: boolean;
26
- /** Whether to disable code linting or not (defailt: `false`) */
27
- disableLint?: boolean;
28
- /** Minimum overall coverage percentage (default: `100`) */
29
- minimumCoverage?: number;
30
- /** Minimum per-file coverage percentage (default: `100`) */
31
- minimumFileCoverage?: number;
32
- /** Optimal overall coverage percentage (default: _none_) */
33
- optimalCoverage?: number;
34
- /** Optimal per-file coverage percentage (default: _none_) */
35
- optimalFileCoverage?: number;
36
- /**
37
- * ESBuild compilation options
38
- *
39
- * Default:
40
- *
41
- * ```
42
- * {
43
- * platform: 'node',
44
- * sourcemap: 'linked',
45
- * sourcesContent: false,
46
- * plugins: [ fixExtensions() ],
47
- * }
48
- * ```
49
- */
50
- esbuildOptions?: ESBuildOptions;
51
- }
52
- export declare function tasks(options?: TasksOptions): import("@plugjs/plug").Build<{
53
- /** Find all CommonJS source files (`*.cts`) */
54
- find_sources_cts(): Pipe;
55
- /** Find all EcmaScript Module source files (`*.mts`) */
56
- find_sources_mts(): Pipe;
57
- /** Find all typescript source files (`*.ts`, `*.mts` and `*.cts`) */
58
- find_sources(): Pipe;
59
- /** Find all types definition files within sources */
60
- find_types(): Pipe;
61
- /** Find all types definition files within sources */
62
- find_extras(): Pipe;
63
- /** Find all resource files (non-typescript files) within sources */
64
- find_resources(): Pipe;
65
- /** Find all test source files */
66
- find_tests(): Pipe;
67
- /** Transpile to CJS */
68
- transpile_cjs(): Pipe;
69
- /** Transpile to ESM */
70
- transpile_esm(): Pipe;
71
- /** Generate all .d.ts files */
72
- transpile_types(): Pipe;
73
- /** Copy all resources coming alongside our sources */
74
- transpile_resources(): Pipe;
75
- /** Transpile all source code */
76
- transpile(): Pipe;
77
- /** Run test and emit coverage data */
78
- test(): Promise<void>;
79
- /** Run tests (always) and generate a coverage report */
80
- coverage(): Promise<void>;
81
- /** Run test and emit coverage data */
82
- lint(): Promise<void>;
83
- /** Build everything */
84
- default(): Promise<void>;
85
- }>;