@driveflux/fab 1.0.10 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/fab.js +13 -12
- package/dist/build.d.ts +7 -19
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +76 -501
- package/dist/clean.d.ts +2 -7
- package/dist/clean.d.ts.map +1 -1
- package/dist/clean.js +17 -115
- package/dist/config.d.ts +20 -16
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +14 -7
- package/dist/create.d.ts +1 -1
- package/dist/create.d.ts.map +1 -1
- package/dist/create.js +1 -1
- package/dist/types.d.ts +12 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +5 -15
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +32 -64
- package/package.json +18 -15
- package/.turbo/turbo-build.log +0 -16
- package/CHANGELOG.md +0 -92
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/src/build.ts +0 -322
- package/src/clean.ts +0 -43
- package/src/config.ts +0 -57
- package/src/create.ts +0 -68
- package/src/index.ts +0 -6
- package/src/types.ts +0 -4
- package/src/utils.ts +0 -84
- package/templates/backend/.eslintrc +0 -3
- package/templates/backend/package.json +0 -34
- package/templates/backend/src/index.ts +0 -1
- package/templates/backend/tsconfig.json +0 -12
- package/templates/frontend/.eslintrc +0 -3
- package/templates/frontend/package.json +0 -34
- package/templates/frontend/src/index.ts +0 -1
- package/templates/frontend/tsconfig.json +0 -13
- package/tsconfig.json +0 -27
- package/tsconfig.tsbuildinfo +0 -1
- package/utils.js +0 -26
package/bin/fab.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// @ts-check
|
|
3
3
|
import { Command, Option } from 'commander'
|
|
4
4
|
import path from 'node:path'
|
|
5
|
-
import { build,
|
|
5
|
+
import { build, buildEsm, buildTypes, clean, create, parseConfig } from '../dist/index.js'
|
|
6
6
|
const program = new Command()
|
|
7
7
|
|
|
8
8
|
program
|
|
@@ -22,7 +22,12 @@ function makeCleanCommand() {
|
|
|
22
22
|
.action(async (options) => {
|
|
23
23
|
const cwd = path.resolve(process.cwd(), options.cwd)
|
|
24
24
|
const config = await parseConfig({ cwd })
|
|
25
|
-
await clean({
|
|
25
|
+
await clean({
|
|
26
|
+
...options,
|
|
27
|
+
cwd,
|
|
28
|
+
...config,
|
|
29
|
+
destination: options.dest
|
|
30
|
+
})
|
|
26
31
|
})
|
|
27
32
|
}
|
|
28
33
|
|
|
@@ -31,6 +36,7 @@ function makeBuildCommand() {
|
|
|
31
36
|
.description('Build the package')
|
|
32
37
|
.option('-c, --cwd <cwd>', 'The current working directory', process.cwd())
|
|
33
38
|
.option('-d, --dest <destination>', 'The destination path for the package, example: dist', 'dist')
|
|
39
|
+
.option('-s, --src <source>', 'The source path for the package, example: dist', 'src')
|
|
34
40
|
.option('-r, --reset', 'Clean up everything and build again')
|
|
35
41
|
.option(
|
|
36
42
|
'--exports <exports>',
|
|
@@ -39,22 +45,23 @@ function makeBuildCommand() {
|
|
|
39
45
|
)
|
|
40
46
|
.addOption(
|
|
41
47
|
new Option('-t, --target [...target]', 'The target export to make')
|
|
42
|
-
.choices(['all', 'esm', '
|
|
48
|
+
.choices(['all', 'esm', 'types', 'clean'])
|
|
43
49
|
.default('all')
|
|
44
50
|
)
|
|
45
51
|
.action(async (options) => {
|
|
46
52
|
const { target } = options
|
|
47
53
|
const cwd = path.resolve(process.cwd(), options.cwd)
|
|
54
|
+
|
|
48
55
|
const config = await parseConfig({ cwd })
|
|
49
56
|
|
|
50
57
|
if (options.reset) {
|
|
51
|
-
await clean({
|
|
58
|
+
await clean({ destination: config.destination, cleanTs: true })
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
const finalOptions = {
|
|
55
62
|
...options,
|
|
56
63
|
cwd,
|
|
57
|
-
...config
|
|
64
|
+
...config
|
|
58
65
|
}
|
|
59
66
|
|
|
60
67
|
switch (target) {
|
|
@@ -64,12 +71,6 @@ function makeBuildCommand() {
|
|
|
64
71
|
case 'esm':
|
|
65
72
|
await buildEsm(finalOptions)
|
|
66
73
|
break
|
|
67
|
-
case 'cjs':
|
|
68
|
-
await buildCjs(finalOptions)
|
|
69
|
-
break
|
|
70
|
-
case 'base-exports':
|
|
71
|
-
await makeBaseExports(finalOptions)
|
|
72
|
-
break
|
|
73
74
|
case 'types':
|
|
74
75
|
await buildTypes(finalOptions)
|
|
75
76
|
break
|
|
@@ -92,7 +93,7 @@ function makeCreateCommand() {
|
|
|
92
93
|
.option('-d, --dest <destination>', 'The destination path for the package, example: packages, shared')
|
|
93
94
|
.option('--dangerouslyRewrite [dangerouslyRewrite]', 'Delete the destination path if it exists')
|
|
94
95
|
.action(async (name, { template, cwd: providedCwd, destination, dest, dangerouslyRewrite }) => {
|
|
95
|
-
if(!/^[a-z0-9-]+$/.test(name)) {
|
|
96
|
+
if (!/^[a-z0-9-]+$/.test(name)) {
|
|
96
97
|
console.log('🚨 Only kebab-case names are allowed. Aborting.')
|
|
97
98
|
process.exit(1)
|
|
98
99
|
}
|
package/dist/build.d.ts
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { CleanOptions } from './
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
noESM?: boolean;
|
|
8
|
-
copyVerbatim?: string[];
|
|
9
|
-
}
|
|
10
|
-
interface MakeBaseExportsOptions extends BaseOptions {
|
|
11
|
-
noTypes?: boolean;
|
|
12
|
-
exports?: PackageJson['exports'];
|
|
13
|
-
}
|
|
14
|
-
export declare const build: (rawOptions?: BuildOptions) => Promise<void>;
|
|
15
|
-
export declare const copyVerbatim: (rawOptions?: BuildOptions) => Promise<void>;
|
|
1
|
+
import type { FullConfig } from './config.js';
|
|
2
|
+
import type { BaseOptions, BuildESMOptions, CleanOptions, CopyVerbatimOptions } from './types.js';
|
|
3
|
+
export declare const build: (rawOptions?: FullConfig & CleanOptions & {
|
|
4
|
+
cwd: string;
|
|
5
|
+
}) => Promise<void>;
|
|
6
|
+
export declare const copyVerbatim: (rawOptions?: CopyVerbatimOptions) => Promise<void>;
|
|
16
7
|
export declare const buildTypes: (rawOptions?: BaseOptions) => Promise<void>;
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const makeBaseExports: (rawOptions?: MakeBaseExportsOptions) => Promise<string[]>;
|
|
19
|
-
export declare const buildEsm: (rawOptions?: BaseOptions) => Promise<void>;
|
|
20
|
-
export {};
|
|
8
|
+
export declare const buildEsm: (rawOptions?: BuildESMOptions) => Promise<void>;
|
|
21
9
|
//# sourceMappingURL=build.d.ts.map
|
package/dist/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EACX,WAAW,EACX,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,MAAM,YAAY,CAAA;AAGnB,eAAO,MAAM,KAAK,gBACJ,UAAU,GAAG,YAAY,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,kBAiBxD,CAAA;AAED,eAAO,MAAM,YAAY,gBAAuB,mBAAmB,kBAmClE,CAAA;AAED,eAAO,MAAM,UAAU,gBAAuB,WAAW,kBAWxD,CAAA;AAED,eAAO,MAAM,QAAQ,gBAAuB,eAAe,kBA4B1D,CAAA"}
|