@fnd-platform/core 1.0.0-alpha.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/LICENSE +21 -0
- package/README.md +166 -0
- package/lib/components/index.d.ts +22 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +25 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/nx-config.d.ts +67 -0
- package/lib/components/nx-config.d.ts.map +1 -0
- package/lib/components/nx-config.js +102 -0
- package/lib/components/nx-config.js.map +1 -0
- package/lib/components/pnpm-workspace.d.ts +34 -0
- package/lib/components/pnpm-workspace.d.ts.map +1 -0
- package/lib/components/pnpm-workspace.js +34 -0
- package/lib/components/pnpm-workspace.js.map +1 -0
- package/lib/components/shared-eslint.d.ts +51 -0
- package/lib/components/shared-eslint.d.ts.map +1 -0
- package/lib/components/shared-eslint.js +72 -0
- package/lib/components/shared-eslint.js.map +1 -0
- package/lib/components/shared-prettier.d.ts +66 -0
- package/lib/components/shared-prettier.d.ts.map +1 -0
- package/lib/components/shared-prettier.js +36 -0
- package/lib/components/shared-prettier.js.map +1 -0
- package/lib/components/shared-typescript.d.ts +71 -0
- package/lib/components/shared-typescript.d.ts.map +1 -0
- package/lib/components/shared-typescript.js +51 -0
- package/lib/components/shared-typescript.js.map +1 -0
- package/lib/components/shared-vitest.d.ts +85 -0
- package/lib/components/shared-vitest.d.ts.map +1 -0
- package/lib/components/shared-vitest.js +76 -0
- package/lib/components/shared-vitest.js.map +1 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/lib/monorepo-project.d.ts +81 -0
- package/lib/monorepo-project.d.ts.map +1 -0
- package/lib/monorepo-project.js +151 -0
- package/lib/monorepo-project.js.map +1 -0
- package/lib/options.d.ts +92 -0
- package/lib/options.d.ts.map +1 -0
- package/lib/options.js +3 -0
- package/lib/options.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Component, Project } from 'projen';
|
|
2
|
+
/**
|
|
3
|
+
* Options for the SharedPrettier component.
|
|
4
|
+
*/
|
|
5
|
+
export interface SharedPrettierOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Whether to require semicolons at the end of statements.
|
|
8
|
+
*
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
readonly semi?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Use single quotes instead of double quotes.
|
|
14
|
+
*
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
readonly singleQuote?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Number of spaces per indentation level.
|
|
20
|
+
*
|
|
21
|
+
* @default 2
|
|
22
|
+
*/
|
|
23
|
+
readonly tabWidth?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Print trailing commas wherever possible in multi-line lists.
|
|
26
|
+
*
|
|
27
|
+
* @default 'es5'
|
|
28
|
+
*/
|
|
29
|
+
readonly trailingComma?: 'all' | 'es5' | 'none';
|
|
30
|
+
/**
|
|
31
|
+
* Maximum line length before wrapping.
|
|
32
|
+
*
|
|
33
|
+
* @default 100
|
|
34
|
+
*/
|
|
35
|
+
readonly printWidth?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Include parentheses around a sole arrow function parameter.
|
|
38
|
+
*
|
|
39
|
+
* @default 'always'
|
|
40
|
+
*/
|
|
41
|
+
readonly arrowParens?: 'always' | 'avoid';
|
|
42
|
+
/**
|
|
43
|
+
* Line ending style.
|
|
44
|
+
*
|
|
45
|
+
* @default 'lf'
|
|
46
|
+
*/
|
|
47
|
+
readonly endOfLine?: 'lf' | 'crlf' | 'cr' | 'auto';
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Generates a .prettierrc configuration file for code formatting.
|
|
51
|
+
*
|
|
52
|
+
* This component creates a shared Prettier configuration that can be
|
|
53
|
+
* used across all packages in the monorepo.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* new SharedPrettier(project, {
|
|
58
|
+
* singleQuote: true,
|
|
59
|
+
* printWidth: 100,
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare class SharedPrettier extends Component {
|
|
64
|
+
constructor(project: Project, options?: SharedPrettierOptions);
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=shared-prettier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-prettier.d.ts","sourceRoot":"","sources":["../../src/components/shared-prettier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAY,MAAM,QAAQ,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAE/B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAEhD;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAE1C;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;CACpD;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,cAAe,SAAQ,SAAS;gBAC/B,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,qBAA0B;CAelE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharedPrettier = void 0;
|
|
4
|
+
const projen_1 = require("projen");
|
|
5
|
+
/**
|
|
6
|
+
* Generates a .prettierrc configuration file for code formatting.
|
|
7
|
+
*
|
|
8
|
+
* This component creates a shared Prettier configuration that can be
|
|
9
|
+
* used across all packages in the monorepo.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* new SharedPrettier(project, {
|
|
14
|
+
* singleQuote: true,
|
|
15
|
+
* printWidth: 100,
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
class SharedPrettier extends projen_1.Component {
|
|
20
|
+
constructor(project, options = {}) {
|
|
21
|
+
super(project);
|
|
22
|
+
new projen_1.JsonFile(project, '.prettierrc', {
|
|
23
|
+
obj: {
|
|
24
|
+
semi: options.semi ?? true,
|
|
25
|
+
singleQuote: options.singleQuote ?? true,
|
|
26
|
+
tabWidth: options.tabWidth ?? 2,
|
|
27
|
+
trailingComma: options.trailingComma ?? 'es5',
|
|
28
|
+
printWidth: options.printWidth ?? 100,
|
|
29
|
+
arrowParens: options.arrowParens ?? 'always',
|
|
30
|
+
endOfLine: options.endOfLine ?? 'lf',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.SharedPrettier = SharedPrettier;
|
|
36
|
+
//# sourceMappingURL=shared-prettier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-prettier.js","sourceRoot":"","sources":["../../src/components/shared-prettier.ts"],"names":[],"mappings":";;;AAAA,mCAAsD;AAwDtD;;;;;;;;;;;;;GAaG;AACH,MAAa,cAAe,SAAQ,kBAAS;IAC3C,YAAY,OAAgB,EAAE,UAAiC,EAAE;QAC/D,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,iBAAQ,CAAC,OAAO,EAAE,aAAa,EAAE;YACnC,GAAG,EAAE;gBACH,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,IAAI;gBAC1B,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,IAAI;gBACxC,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,CAAC;gBAC/B,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,KAAK;gBAC7C,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,GAAG;gBACrC,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,QAAQ;gBAC5C,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI;aACrC;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAhBD,wCAgBC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Component, Project } from 'projen';
|
|
2
|
+
/**
|
|
3
|
+
* Options for the SharedTypeScript component.
|
|
4
|
+
*/
|
|
5
|
+
export interface SharedTypescriptOptions {
|
|
6
|
+
/**
|
|
7
|
+
* ECMAScript target version.
|
|
8
|
+
*
|
|
9
|
+
* @default 'ES2022'
|
|
10
|
+
*/
|
|
11
|
+
readonly target?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Module code generation.
|
|
14
|
+
*
|
|
15
|
+
* @default 'NodeNext'
|
|
16
|
+
*/
|
|
17
|
+
readonly module?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Module resolution strategy.
|
|
20
|
+
*
|
|
21
|
+
* @default 'NodeNext'
|
|
22
|
+
*/
|
|
23
|
+
readonly moduleResolution?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Library files to include in compilation.
|
|
26
|
+
*
|
|
27
|
+
* @default ['ES2022']
|
|
28
|
+
*/
|
|
29
|
+
readonly lib?: string[];
|
|
30
|
+
/**
|
|
31
|
+
* Enable strict type checking options.
|
|
32
|
+
*
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
readonly strict?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Output directory for compiled files.
|
|
38
|
+
*
|
|
39
|
+
* @default './dist'
|
|
40
|
+
*/
|
|
41
|
+
readonly outDir?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Root directory of source files.
|
|
44
|
+
*
|
|
45
|
+
* @default './src'
|
|
46
|
+
*/
|
|
47
|
+
readonly rootDir?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Additional compiler options to include.
|
|
50
|
+
*/
|
|
51
|
+
readonly additionalCompilerOptions?: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Generates a tsconfig.base.json file for shared TypeScript configuration.
|
|
55
|
+
*
|
|
56
|
+
* This component creates a base TypeScript configuration that individual
|
|
57
|
+
* packages can extend. It includes strict mode, modern ES features, and
|
|
58
|
+
* common settings for monorepo development.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* new SharedTypeScript(project, {
|
|
63
|
+
* target: 'ES2022',
|
|
64
|
+
* strict: true,
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare class SharedTypeScript extends Component {
|
|
69
|
+
constructor(project: Project, options?: SharedTypescriptOptions);
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=shared-typescript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-typescript.d.ts","sourceRoot":"","sources":["../../src/components/shared-typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAY,MAAM,QAAQ,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9D;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,gBAAiB,SAAQ,SAAS;gBACjC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,uBAA4B;CA8BpE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharedTypeScript = void 0;
|
|
4
|
+
const projen_1 = require("projen");
|
|
5
|
+
/**
|
|
6
|
+
* Generates a tsconfig.base.json file for shared TypeScript configuration.
|
|
7
|
+
*
|
|
8
|
+
* This component creates a base TypeScript configuration that individual
|
|
9
|
+
* packages can extend. It includes strict mode, modern ES features, and
|
|
10
|
+
* common settings for monorepo development.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* new SharedTypeScript(project, {
|
|
15
|
+
* target: 'ES2022',
|
|
16
|
+
* strict: true,
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
class SharedTypeScript extends projen_1.Component {
|
|
21
|
+
constructor(project, options = {}) {
|
|
22
|
+
super(project);
|
|
23
|
+
const compilerOptions = {
|
|
24
|
+
target: options.target ?? 'ES2022',
|
|
25
|
+
module: options.module ?? 'NodeNext',
|
|
26
|
+
moduleResolution: options.moduleResolution ?? 'NodeNext',
|
|
27
|
+
lib: options.lib ?? ['ES2022'],
|
|
28
|
+
strict: options.strict ?? true,
|
|
29
|
+
esModuleInterop: true,
|
|
30
|
+
skipLibCheck: true,
|
|
31
|
+
forceConsistentCasingInFileNames: true,
|
|
32
|
+
declaration: true,
|
|
33
|
+
declarationMap: true,
|
|
34
|
+
sourceMap: true,
|
|
35
|
+
resolveJsonModule: true,
|
|
36
|
+
incremental: true,
|
|
37
|
+
composite: true,
|
|
38
|
+
outDir: options.outDir ?? './dist',
|
|
39
|
+
rootDir: options.rootDir ?? './src',
|
|
40
|
+
...options.additionalCompilerOptions,
|
|
41
|
+
};
|
|
42
|
+
new projen_1.JsonFile(project, 'tsconfig.base.json', {
|
|
43
|
+
obj: {
|
|
44
|
+
compilerOptions,
|
|
45
|
+
exclude: ['node_modules', 'dist', '**/*.spec.ts', '**/*.test.ts'],
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.SharedTypeScript = SharedTypeScript;
|
|
51
|
+
//# sourceMappingURL=shared-typescript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-typescript.js","sourceRoot":"","sources":["../../src/components/shared-typescript.ts"],"names":[],"mappings":";;;AAAA,mCAAsD;AA6DtD;;;;;;;;;;;;;;GAcG;AACH,MAAa,gBAAiB,SAAQ,kBAAS;IAC7C,YAAY,OAAgB,EAAE,UAAmC,EAAE;QACjE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,MAAM,eAAe,GAA4B;YAC/C,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,QAAQ;YAClC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,UAAU;YACpC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,IAAI,UAAU;YACxD,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC9B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,IAAI;YAC9B,eAAe,EAAE,IAAI;YACrB,YAAY,EAAE,IAAI;YAClB,gCAAgC,EAAE,IAAI;YACtC,WAAW,EAAE,IAAI;YACjB,cAAc,EAAE,IAAI;YACpB,SAAS,EAAE,IAAI;YACf,iBAAiB,EAAE,IAAI;YACvB,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,QAAQ;YAClC,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,OAAO;YACnC,GAAG,OAAO,CAAC,yBAAyB;SACrC,CAAC;QAEF,IAAI,iBAAQ,CAAC,OAAO,EAAE,oBAAoB,EAAE;YAC1C,GAAG,EAAE;gBACH,eAAe;gBACf,OAAO,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,CAAC;aAClE;SACF,CAAC,CAAC;IACL,CAAC;CACF;AA/BD,4CA+BC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Component, Project } from 'projen';
|
|
2
|
+
/**
|
|
3
|
+
* Options for the SharedVitest component.
|
|
4
|
+
*/
|
|
5
|
+
export interface SharedVitestOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Enable global test APIs (describe, it, expect, etc.).
|
|
8
|
+
*
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
readonly globals?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Test environment.
|
|
14
|
+
*
|
|
15
|
+
* @default 'node'
|
|
16
|
+
*/
|
|
17
|
+
readonly environment?: 'node' | 'jsdom' | 'happy-dom';
|
|
18
|
+
/**
|
|
19
|
+
* Coverage provider.
|
|
20
|
+
*
|
|
21
|
+
* @default 'v8'
|
|
22
|
+
*/
|
|
23
|
+
readonly coverageProvider?: 'v8' | 'istanbul';
|
|
24
|
+
/**
|
|
25
|
+
* Coverage reporters to use.
|
|
26
|
+
*
|
|
27
|
+
* @default ['text', 'json', 'html', 'lcov']
|
|
28
|
+
*/
|
|
29
|
+
readonly coverageReporters?: string[];
|
|
30
|
+
/**
|
|
31
|
+
* Directory for coverage reports.
|
|
32
|
+
*
|
|
33
|
+
* @default './coverage'
|
|
34
|
+
*/
|
|
35
|
+
readonly coverageDirectory?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Coverage thresholds (percentage).
|
|
38
|
+
*
|
|
39
|
+
* @default { lines: 80, branches: 80, functions: 80, statements: 80 }
|
|
40
|
+
*/
|
|
41
|
+
readonly coverageThresholds?: {
|
|
42
|
+
lines?: number;
|
|
43
|
+
branches?: number;
|
|
44
|
+
functions?: number;
|
|
45
|
+
statements?: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Glob patterns for test files.
|
|
49
|
+
*
|
|
50
|
+
* @default ['packages/**\/*.{test,spec}.{ts,tsx}']
|
|
51
|
+
*/
|
|
52
|
+
readonly include?: string[];
|
|
53
|
+
/**
|
|
54
|
+
* Glob patterns to exclude from tests.
|
|
55
|
+
*
|
|
56
|
+
* @default ['node_modules', 'dist', '.nx']
|
|
57
|
+
*/
|
|
58
|
+
readonly exclude?: string[];
|
|
59
|
+
/**
|
|
60
|
+
* Glob patterns to exclude from coverage.
|
|
61
|
+
*/
|
|
62
|
+
readonly coverageExclude?: string[];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Generates a vitest.config.ts configuration file for testing.
|
|
66
|
+
*
|
|
67
|
+
* This component creates a Vitest configuration with coverage thresholds,
|
|
68
|
+
* sensible defaults for monorepo testing, and v8 coverage provider.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* new SharedVitest(project, {
|
|
73
|
+
* coverageThresholds: {
|
|
74
|
+
* lines: 80,
|
|
75
|
+
* branches: 80,
|
|
76
|
+
* functions: 80,
|
|
77
|
+
* statements: 80,
|
|
78
|
+
* },
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare class SharedVitest extends Component {
|
|
83
|
+
constructor(project: Project, options?: SharedVitestOptions);
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=shared-vitest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-vitest.d.ts","sourceRoot":"","sources":["../../src/components/shared-vitest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAY,MAAM,QAAQ,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;IAEtD;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC;IAE9C;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtC;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAEpC;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE;QAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IAEF;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,YAAa,SAAQ,SAAS;gBAC7B,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,mBAAwB;CAqDhE"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharedVitest = void 0;
|
|
4
|
+
const projen_1 = require("projen");
|
|
5
|
+
/**
|
|
6
|
+
* Generates a vitest.config.ts configuration file for testing.
|
|
7
|
+
*
|
|
8
|
+
* This component creates a Vitest configuration with coverage thresholds,
|
|
9
|
+
* sensible defaults for monorepo testing, and v8 coverage provider.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* new SharedVitest(project, {
|
|
14
|
+
* coverageThresholds: {
|
|
15
|
+
* lines: 80,
|
|
16
|
+
* branches: 80,
|
|
17
|
+
* functions: 80,
|
|
18
|
+
* statements: 80,
|
|
19
|
+
* },
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
class SharedVitest extends projen_1.Component {
|
|
24
|
+
constructor(project, options = {}) {
|
|
25
|
+
super(project);
|
|
26
|
+
const globals = options.globals ?? true;
|
|
27
|
+
const environment = options.environment ?? 'node';
|
|
28
|
+
const coverageProvider = options.coverageProvider ?? 'v8';
|
|
29
|
+
const coverageReporters = options.coverageReporters ?? ['text', 'json', 'html', 'lcov'];
|
|
30
|
+
const coverageDirectory = options.coverageDirectory ?? './coverage';
|
|
31
|
+
const coverageThresholds = options.coverageThresholds ?? {
|
|
32
|
+
lines: 80,
|
|
33
|
+
branches: 80,
|
|
34
|
+
functions: 80,
|
|
35
|
+
statements: 80,
|
|
36
|
+
};
|
|
37
|
+
const include = options.include ?? ['packages/**/*.{test,spec}.{ts,tsx}'];
|
|
38
|
+
const exclude = options.exclude ?? ['node_modules', 'dist', '.nx'];
|
|
39
|
+
const coverageExclude = options.coverageExclude ?? [
|
|
40
|
+
'node_modules/',
|
|
41
|
+
'dist/',
|
|
42
|
+
'**/*.spec.ts',
|
|
43
|
+
'**/*.test.ts',
|
|
44
|
+
'**/vitest.config.ts',
|
|
45
|
+
'**/.eslintrc.js',
|
|
46
|
+
];
|
|
47
|
+
const configContent = `import { defineConfig } from 'vitest/config';
|
|
48
|
+
|
|
49
|
+
export default defineConfig({
|
|
50
|
+
test: {
|
|
51
|
+
globals: ${globals},
|
|
52
|
+
environment: '${environment}',
|
|
53
|
+
coverage: {
|
|
54
|
+
provider: '${coverageProvider}',
|
|
55
|
+
reporter: ${JSON.stringify(coverageReporters)},
|
|
56
|
+
reportsDirectory: '${coverageDirectory}',
|
|
57
|
+
exclude: ${JSON.stringify(coverageExclude, null, 8).replace(/\n/g, '\n ')},
|
|
58
|
+
thresholds: {
|
|
59
|
+
lines: ${coverageThresholds.lines ?? 80},
|
|
60
|
+
branches: ${coverageThresholds.branches ?? 80},
|
|
61
|
+
functions: ${coverageThresholds.functions ?? 80},
|
|
62
|
+
statements: ${coverageThresholds.statements ?? 80},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
include: ${JSON.stringify(include)},
|
|
66
|
+
exclude: ${JSON.stringify(exclude)},
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
`;
|
|
70
|
+
new projen_1.TextFile(project, 'vitest.config.ts', {
|
|
71
|
+
lines: configContent.split('\n'),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.SharedVitest = SharedVitest;
|
|
76
|
+
//# sourceMappingURL=shared-vitest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-vitest.js","sourceRoot":"","sources":["../../src/components/shared-vitest.ts"],"names":[],"mappings":";;;AAAA,mCAAsD;AAyEtD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,YAAa,SAAQ,kBAAS;IACzC,YAAY,OAAgB,EAAE,UAA+B,EAAE;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC;QACxC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,MAAM,CAAC;QAClD,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,IAAI,IAAI,CAAC;QAC1D,MAAM,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACxF,MAAM,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,IAAI,YAAY,CAAC;QACpE,MAAM,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,IAAI;YACvD,KAAK,EAAE,EAAE;YACT,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,EAAE;SACf,CAAC;QACF,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,oCAAoC,CAAC,CAAC;QAC1E,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QACnE,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI;YACjD,eAAe;YACf,OAAO;YACP,cAAc;YACd,cAAc;YACd,qBAAqB;YACrB,iBAAiB;SAClB,CAAC;QAEF,MAAM,aAAa,GAAG;;;;eAIX,OAAO;oBACF,WAAW;;mBAEZ,gBAAgB;kBACjB,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC;2BACxB,iBAAiB;iBAC3B,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC;;iBAEnE,kBAAkB,CAAC,KAAK,IAAI,EAAE;oBAC3B,kBAAkB,CAAC,QAAQ,IAAI,EAAE;qBAChC,kBAAkB,CAAC,SAAS,IAAI,EAAE;sBACjC,kBAAkB,CAAC,UAAU,IAAI,EAAE;;;eAG1C,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;eACvB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;;;CAGrC,CAAC;QAEE,IAAI,iBAAQ,CAAC,OAAO,EAAE,kBAAkB,EAAE;YACxC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC;SACjC,CAAC,CAAC;IACL,CAAC;CACF;AAtDD,oCAsDC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fnd-platform/core
|
|
3
|
+
*
|
|
4
|
+
* Core package providing Projen project classes for fnd-platform.
|
|
5
|
+
* Use FndMonorepoProject to create a complete monorepo with pnpm workspaces,
|
|
6
|
+
* NX orchestration, and shared configurations.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export { FndMonorepoProject } from './monorepo-project';
|
|
11
|
+
export type { FndMonorepoProjectOptions, NxTargetConfig } from './options';
|
|
12
|
+
export { PnpmWorkspace, NxConfig, SharedTypeScript, SharedEslint, SharedPrettier, SharedVitest, } from './components';
|
|
13
|
+
export type { PnpmWorkspaceOptions, NxConfigOptions, SharedTypescriptOptions, SharedEslintOptions, SharedPrettierOptions, SharedVitestOptions, } from './components';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,YAAY,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG3E,OAAO,EACL,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,cAAc,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fnd-platform/core
|
|
4
|
+
*
|
|
5
|
+
* Core package providing Projen project classes for fnd-platform.
|
|
6
|
+
* Use FndMonorepoProject to create a complete monorepo with pnpm workspaces,
|
|
7
|
+
* NX orchestration, and shared configurations.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SharedVitest = exports.SharedPrettier = exports.SharedEslint = exports.SharedTypeScript = exports.NxConfig = exports.PnpmWorkspace = exports.FndMonorepoProject = void 0;
|
|
13
|
+
// Main project class
|
|
14
|
+
var monorepo_project_1 = require("./monorepo-project");
|
|
15
|
+
Object.defineProperty(exports, "FndMonorepoProject", { enumerable: true, get: function () { return monorepo_project_1.FndMonorepoProject; } });
|
|
16
|
+
// Components (for extensibility)
|
|
17
|
+
var components_1 = require("./components");
|
|
18
|
+
Object.defineProperty(exports, "PnpmWorkspace", { enumerable: true, get: function () { return components_1.PnpmWorkspace; } });
|
|
19
|
+
Object.defineProperty(exports, "NxConfig", { enumerable: true, get: function () { return components_1.NxConfig; } });
|
|
20
|
+
Object.defineProperty(exports, "SharedTypeScript", { enumerable: true, get: function () { return components_1.SharedTypeScript; } });
|
|
21
|
+
Object.defineProperty(exports, "SharedEslint", { enumerable: true, get: function () { return components_1.SharedEslint; } });
|
|
22
|
+
Object.defineProperty(exports, "SharedPrettier", { enumerable: true, get: function () { return components_1.SharedPrettier; } });
|
|
23
|
+
Object.defineProperty(exports, "SharedVitest", { enumerable: true, get: function () { return components_1.SharedVitest; } });
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,qBAAqB;AACrB,uDAAwD;AAA/C,sHAAA,kBAAkB,OAAA;AAK3B,iCAAiC;AACjC,2CAOsB;AANpB,2GAAA,aAAa,OAAA;AACb,sGAAA,QAAQ,OAAA;AACR,8GAAA,gBAAgB,OAAA;AAChB,0GAAA,YAAY,OAAA;AACZ,4GAAA,cAAc,OAAA;AACd,0GAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { typescript } from 'projen';
|
|
2
|
+
import { PnpmWorkspace, NxConfig, SharedTypeScript, SharedEslint, SharedPrettier, SharedVitest } from './components';
|
|
3
|
+
import type { FndMonorepoProjectOptions } from './options';
|
|
4
|
+
/**
|
|
5
|
+
* Creates a new fnd-platform monorepo project.
|
|
6
|
+
*
|
|
7
|
+
* This class extends Projen's TypeScriptProject to provide a complete
|
|
8
|
+
* monorepo setup with:
|
|
9
|
+
* - pnpm workspace configuration
|
|
10
|
+
* - NX build orchestration with intelligent caching
|
|
11
|
+
* - Shared TypeScript, ESLint, Prettier, and Vitest configurations
|
|
12
|
+
* - Standard scripts for building, testing, and linting
|
|
13
|
+
*
|
|
14
|
+
* All configuration files are generated automatically during synthesis.
|
|
15
|
+
* Users should not edit generated files directly - instead, modify the
|
|
16
|
+
* project configuration in `.projenrc.ts` and run synthesis.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* Basic usage:
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { FndMonorepoProject } from '@fnd-platform/core';
|
|
22
|
+
*
|
|
23
|
+
* const project = new FndMonorepoProject({
|
|
24
|
+
* name: 'my-app',
|
|
25
|
+
* defaultReleaseBranch: 'main',
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* project.synth();
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* With custom workspace packages:
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const project = new FndMonorepoProject({
|
|
35
|
+
* name: 'my-app',
|
|
36
|
+
* defaultReleaseBranch: 'main',
|
|
37
|
+
* workspacePackages: ['packages/*', 'apps/*'],
|
|
38
|
+
* nxCache: true,
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* project.synth();
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare class FndMonorepoProject extends typescript.TypeScriptProject {
|
|
45
|
+
/**
|
|
46
|
+
* The pnpm workspace configuration component.
|
|
47
|
+
*/
|
|
48
|
+
readonly pnpmWorkspace: PnpmWorkspace;
|
|
49
|
+
/**
|
|
50
|
+
* The NX configuration component.
|
|
51
|
+
*/
|
|
52
|
+
readonly nxConfig: NxConfig;
|
|
53
|
+
/**
|
|
54
|
+
* The shared TypeScript configuration component.
|
|
55
|
+
*/
|
|
56
|
+
readonly sharedTypeScript: SharedTypeScript;
|
|
57
|
+
/**
|
|
58
|
+
* The shared ESLint configuration component.
|
|
59
|
+
*/
|
|
60
|
+
readonly sharedEslint: SharedEslint;
|
|
61
|
+
/**
|
|
62
|
+
* The shared Prettier configuration component.
|
|
63
|
+
*/
|
|
64
|
+
readonly sharedPrettier: SharedPrettier;
|
|
65
|
+
/**
|
|
66
|
+
* The shared Vitest configuration component.
|
|
67
|
+
*/
|
|
68
|
+
readonly sharedVitest: SharedVitest;
|
|
69
|
+
/**
|
|
70
|
+
* Creates a new FndMonorepoProject.
|
|
71
|
+
*
|
|
72
|
+
* @param options - Configuration options for the monorepo
|
|
73
|
+
* @throws {Error} If required options (name, defaultReleaseBranch) are missing
|
|
74
|
+
*/
|
|
75
|
+
constructor(options: FndMonorepoProjectOptions);
|
|
76
|
+
/**
|
|
77
|
+
* Adds standard gitignore patterns for the monorepo.
|
|
78
|
+
*/
|
|
79
|
+
private addGitIgnorePatterns;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=monorepo-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monorepo-project.d.ts","sourceRoot":"","sources":["../src/monorepo-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,QAAQ,CAAC;AAE9C,OAAO,EACL,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,YAAY,EACb,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,qBAAa,kBAAmB,SAAQ,UAAU,CAAC,iBAAiB;IAClE;;OAEG;IACH,SAAgB,aAAa,EAAE,aAAa,CAAC;IAE7C;;OAEG;IACH,SAAgB,QAAQ,EAAE,QAAQ,CAAC;IAEnC;;OAEG;IACH,SAAgB,gBAAgB,EAAE,gBAAgB,CAAC;IAEnD;;OAEG;IACH,SAAgB,YAAY,EAAE,YAAY,CAAC;IAE3C;;OAEG;IACH,SAAgB,cAAc,EAAE,cAAc,CAAC;IAE/C;;OAEG;IACH,SAAgB,YAAY,EAAE,YAAY,CAAC;IAE3C;;;;;OAKG;gBACS,OAAO,EAAE,yBAAyB;IA2F9C;;OAEG;IACH,OAAO,CAAC,oBAAoB;CAuC7B"}
|