nx-factory-cli 2.1.23 → 2.1.25
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/dist/commands/add-app.d.ts.map +1 -1
- package/dist/commands/add-app.js +65 -92
- package/dist/commands/add-app.js.map +1 -1
- package/dist/commands/add-auth.d.ts.map +1 -1
- package/dist/commands/add-auth.js +43 -4
- package/dist/commands/add-auth.js.map +1 -1
- package/dist/commands/add-component.d.ts.map +1 -1
- package/dist/commands/add-component.js +4 -3
- package/dist/commands/add-component.js.map +1 -1
- package/dist/commands/add-lib.d.ts.map +1 -1
- package/dist/commands/add-lib.js +78 -42
- package/dist/commands/add-lib.js.map +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +92 -58
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.d.ts +7 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +365 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/publish.js +1 -1
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/remove-component.d.ts.map +1 -1
- package/dist/commands/remove-component.js +3 -1
- package/dist/commands/remove-component.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +4 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/exec.d.ts +3 -1
- package/dist/exec.d.ts.map +1 -1
- package/dist/exec.js +7 -2
- package/dist/exec.js.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/setups/auth/base.d.ts.map +1 -1
- package/dist/setups/auth/base.js +5 -21
- package/dist/setups/auth/base.js.map +1 -1
- package/dist/setups/auth/index.d.ts +1 -1
- package/dist/setups/auth/index.d.ts.map +1 -1
- package/dist/setups/auth/systems/better-auth.d.ts.map +1 -1
- package/dist/setups/auth/systems/better-auth.js +88 -266
- package/dist/setups/auth/systems/better-auth.js.map +1 -1
- package/dist/setups/auth/systems/clerk.d.ts.map +1 -1
- package/dist/setups/auth/systems/clerk.js +61 -142
- package/dist/setups/auth/systems/clerk.js.map +1 -1
- package/dist/setups/auth/systems/workos.d.ts.map +1 -1
- package/dist/setups/auth/systems/workos.js +92 -203
- package/dist/setups/auth/systems/workos.js.map +1 -1
- package/dist/setups/auth/types.d.ts +12 -10
- package/dist/setups/auth/types.d.ts.map +1 -1
- package/dist/tsconfigs.d.ts +54 -0
- package/dist/tsconfigs.d.ts.map +1 -0
- package/dist/tsconfigs.js +165 -0
- package/dist/tsconfigs.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tsconfigs.ts — single source of truth for every tsconfig shape the CLI writes.
|
|
3
|
+
*
|
|
4
|
+
* Rules that govern the choices below:
|
|
5
|
+
*
|
|
6
|
+
* ROOT tsconfig.base.json
|
|
7
|
+
* "module": "NodeNext" / "moduleResolution": "NodeNext"
|
|
8
|
+
* — the CLI itself uses NodeNext, and apps compiled by Next.js / tsc directly
|
|
9
|
+
* also use NodeNext. All relative imports in source must end with .js.
|
|
10
|
+
* — baseUrl + paths live here so every package and app inherits them without
|
|
11
|
+
* repeating the mapping.
|
|
12
|
+
*
|
|
13
|
+
* PACKAGE tsconfig.json (internal or public)
|
|
14
|
+
* Extends ../../tsconfig.base.json — inherits paths, strict, target.
|
|
15
|
+
* Overrides only what the package specifically needs (jsx, lib, outDir).
|
|
16
|
+
*
|
|
17
|
+
* Internal (private: true in package.json)
|
|
18
|
+
* — no `declaration` / `declarationMap` needed in theory, but we keep them
|
|
19
|
+
* so IDEs get go-to-definition inside the monorepo.
|
|
20
|
+
* — composite: true + incremental for fast Nx caching.
|
|
21
|
+
*
|
|
22
|
+
* Public (to be published to npm)
|
|
23
|
+
* — declaration + declarationMap required by consumers.
|
|
24
|
+
* — composite: true for project references.
|
|
25
|
+
* — stripInternal: true so @internal JSDoc strips from .d.ts.
|
|
26
|
+
* — no `rootDir` override needed because extend covers it.
|
|
27
|
+
*
|
|
28
|
+
* APP tsconfig.json
|
|
29
|
+
* Extends ../../tsconfig.base.json.
|
|
30
|
+
* Each framework adds its own lib / jsx overrides.
|
|
31
|
+
* No packages/**\/* in `include` — paths handles resolution, and polluting
|
|
32
|
+
* include causes duplicate type-checking and false errors.
|
|
33
|
+
*/
|
|
34
|
+
// ─── Root workspace tsconfig.base.json ────────────────────────────────────────
|
|
35
|
+
export function rootTsConfigBase(scope) {
|
|
36
|
+
return {
|
|
37
|
+
$schema: "https://json.schemastore.org/tsconfig",
|
|
38
|
+
display: "Base",
|
|
39
|
+
compilerOptions: {
|
|
40
|
+
// --- Language & output ---
|
|
41
|
+
target: "ES2022",
|
|
42
|
+
module: "NodeNext",
|
|
43
|
+
moduleResolution: "NodeNext",
|
|
44
|
+
lib: ["ES2022"],
|
|
45
|
+
// --- Strictness ---
|
|
46
|
+
strict: true,
|
|
47
|
+
noUncheckedIndexedAccess: true,
|
|
48
|
+
noImplicitOverride: true,
|
|
49
|
+
exactOptionalPropertyTypes: true,
|
|
50
|
+
// --- Emit ---
|
|
51
|
+
declaration: true,
|
|
52
|
+
declarationMap: true,
|
|
53
|
+
sourceMap: true,
|
|
54
|
+
esModuleInterop: true,
|
|
55
|
+
skipLibCheck: true,
|
|
56
|
+
isolatedModules: true,
|
|
57
|
+
// --- Paths — inherited by every package and app ---
|
|
58
|
+
baseUrl: ".",
|
|
59
|
+
paths: {
|
|
60
|
+
[`@${scope}/*`]: ["./packages/*/index.ts"],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export function packageTsConfig(opts) {
|
|
66
|
+
const rootRel = opts.rootRelative ?? "../..";
|
|
67
|
+
const base = {
|
|
68
|
+
$schema: "https://json.schemastore.org/tsconfig",
|
|
69
|
+
extends: `${rootRel}/tsconfig.base.json`,
|
|
70
|
+
compilerOptions: {
|
|
71
|
+
// Packages always emit to dist/
|
|
72
|
+
outDir: "dist",
|
|
73
|
+
rootDir: ".",
|
|
74
|
+
// Composite enables project references and Nx incremental builds
|
|
75
|
+
composite: true,
|
|
76
|
+
incremental: true,
|
|
77
|
+
tsBuildInfoFile: "dist/.tsbuildinfo",
|
|
78
|
+
},
|
|
79
|
+
include: ["**/*.ts", "**/*.tsx"],
|
|
80
|
+
exclude: ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"],
|
|
81
|
+
};
|
|
82
|
+
const co = base.compilerOptions;
|
|
83
|
+
// React packages need jsx and DOM types
|
|
84
|
+
if (opts.react) {
|
|
85
|
+
co["jsx"] = "react-jsx";
|
|
86
|
+
co["lib"] = ["ES2022", "DOM", "DOM.Iterable"];
|
|
87
|
+
}
|
|
88
|
+
// Public packages get extras for clean npm publishing
|
|
89
|
+
if (opts.visibility === "public") {
|
|
90
|
+
co["stripInternal"] = true; // strips @internal from .d.ts
|
|
91
|
+
co["declarationDir"] = "dist"; // explicit — avoids surprises
|
|
92
|
+
}
|
|
93
|
+
// Internal packages get a self-referencing path so imports within the
|
|
94
|
+
// package can use the scoped name instead of relative paths
|
|
95
|
+
if (opts.visibility === "internal") {
|
|
96
|
+
const existingPaths = co["paths"] ?? {};
|
|
97
|
+
co["paths"] = {
|
|
98
|
+
...existingPaths,
|
|
99
|
+
[`@${opts.scope}/${opts.pkgName}`]: ["./index.ts"],
|
|
100
|
+
};
|
|
101
|
+
co["baseUrl"] = ".";
|
|
102
|
+
}
|
|
103
|
+
return base;
|
|
104
|
+
}
|
|
105
|
+
export function appTsConfig(opts) {
|
|
106
|
+
const aliasBase = opts.hasSrcDir ? "./src/*" : "./*";
|
|
107
|
+
// Framework-specific compiler option overrides
|
|
108
|
+
const frameworkOverrides = frameworkCompilerOptions(opts.framework);
|
|
109
|
+
return {
|
|
110
|
+
$schema: "https://json.schemastore.org/tsconfig",
|
|
111
|
+
extends: "../../tsconfig.base.json",
|
|
112
|
+
compilerOptions: {
|
|
113
|
+
...frameworkOverrides,
|
|
114
|
+
// App-level alias: @/* → src/* or root
|
|
115
|
+
paths: {
|
|
116
|
+
"@/*": [aliasBase],
|
|
117
|
+
// Workspace packages resolved via inherited baseUrl paths from base
|
|
118
|
+
},
|
|
119
|
+
// Apps don't emit — the framework build tool handles that
|
|
120
|
+
noEmit: true,
|
|
121
|
+
},
|
|
122
|
+
// Only include the app's own source files
|
|
123
|
+
include: [
|
|
124
|
+
opts.hasSrcDir ? "src/**/*.ts" : "**/*.ts",
|
|
125
|
+
opts.hasSrcDir ? "src/**/*.tsx" : "**/*.tsx",
|
|
126
|
+
...(opts.framework === "nextjs"
|
|
127
|
+
? ["next-env.d.ts", ".next/types/**/*.ts"]
|
|
128
|
+
: []),
|
|
129
|
+
],
|
|
130
|
+
exclude: ["node_modules", "dist"],
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function frameworkCompilerOptions(framework) {
|
|
134
|
+
switch (framework) {
|
|
135
|
+
case "nextjs":
|
|
136
|
+
return {
|
|
137
|
+
lib: ["ES2022", "DOM", "DOM.Iterable"],
|
|
138
|
+
jsx: "preserve", // Next.js handles JSX transform
|
|
139
|
+
plugins: [{ name: "next" }], // enables Next.js TS plugin
|
|
140
|
+
allowJs: true,
|
|
141
|
+
incremental: true,
|
|
142
|
+
tsBuildInfoFile: ".next/cache/tsconfig.tsbuildinfo",
|
|
143
|
+
};
|
|
144
|
+
case "vite":
|
|
145
|
+
return {
|
|
146
|
+
lib: ["ES2022", "DOM", "DOM.Iterable"],
|
|
147
|
+
jsx: "react-jsx",
|
|
148
|
+
useDefineForClassFields: true,
|
|
149
|
+
};
|
|
150
|
+
case "remix":
|
|
151
|
+
return {
|
|
152
|
+
lib: ["ES2022", "DOM", "DOM.Iterable"],
|
|
153
|
+
jsx: "react-jsx",
|
|
154
|
+
moduleResolution: "Bundler", // Remix/Vite uses bundler resolution
|
|
155
|
+
module: "ESNext",
|
|
156
|
+
};
|
|
157
|
+
case "expo":
|
|
158
|
+
return {
|
|
159
|
+
lib: ["ES2022"],
|
|
160
|
+
jsx: "react-native",
|
|
161
|
+
allowSyntheticDefaultImports: true,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=tsconfigs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsconfigs.js","sourceRoot":"","sources":["../src/tsconfigs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAMH,iFAAiF;AAEjF,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC7C,OAAO;QACN,OAAO,EAAE,uCAAuC;QAChD,OAAO,EAAE,MAAM;QACf,eAAe,EAAE;YAChB,4BAA4B;YAC5B,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE,UAAU;YAClB,gBAAgB,EAAE,UAAU;YAC5B,GAAG,EAAE,CAAC,QAAQ,CAAC;YACf,qBAAqB;YACrB,MAAM,EAAE,IAAI;YACZ,wBAAwB,EAAE,IAAI;YAC9B,kBAAkB,EAAE,IAAI;YACxB,0BAA0B,EAAE,IAAI;YAChC,eAAe;YACf,WAAW,EAAE,IAAI;YACjB,cAAc,EAAE,IAAI;YACpB,SAAS,EAAE,IAAI;YACf,eAAe,EAAE,IAAI;YACrB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,IAAI;YACrB,qDAAqD;YACrD,OAAO,EAAE,GAAG;YACZ,KAAK,EAAE;gBACN,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC,uBAAuB,CAAC;aAC1C;SACD;KACD,CAAC;AACH,CAAC;AAcD,MAAM,UAAU,eAAe,CAAC,IAA4B;IAC3D,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,IAAI,OAAO,CAAC;IAC7C,MAAM,IAAI,GAA4B;QACrC,OAAO,EAAE,uCAAuC;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