@cedarjs/cli-helpers 7.1.0 → 7.1.1-next.469
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/auth/authFiles.d.ts +9 -1
- package/dist/auth/authFiles.d.ts.map +1 -1
- package/dist/auth/authFiles.js +44 -22
- package/dist/auth/authTasks.d.ts +37 -1
- package/dist/auth/authTasks.d.ts.map +1 -1
- package/dist/auth/authTasks.js +74 -3
- package/dist/auth/setupHelpers.d.ts +2 -1
- package/dist/auth/setupHelpers.d.ts.map +1 -1
- package/dist/auth/setupHelpers.js +5 -2
- package/dist/lib/colors.d.ts +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +10 -24
- package/dist/lib/transpileTSToJS.d.ts +18 -0
- package/dist/lib/transpileTSToJS.d.ts.map +1 -0
- package/dist/lib/transpileTSToJS.js +38 -0
- package/dist/lib/tty.d.ts +11 -0
- package/dist/lib/tty.d.ts.map +1 -0
- package/dist/lib/tty.js +16 -0
- package/dist/lib/version.js +5 -5
- package/package.json +70 -18
- package/dist/index.d.ts +0 -12
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -20
package/dist/auth/authFiles.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
interface FilesArgs {
|
|
2
2
|
basedir: string;
|
|
3
3
|
webAuthn: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Selects the `*.oauth.*` template variant, the same way `webAuthn` selects
|
|
6
|
+
* the `*.webAuthn.*` variant. When both are true, the most specific
|
|
7
|
+
* template available is preferred (`*.webAuthn.oauth.*`), falling back to
|
|
8
|
+
* a single-variant or the base template when a more specific one doesn't
|
|
9
|
+
* exist for a given template file.
|
|
10
|
+
*/
|
|
11
|
+
oauth?: boolean;
|
|
4
12
|
}
|
|
5
13
|
/**
|
|
6
14
|
* Get the api side file paths and file contents to write
|
|
@@ -14,7 +22,7 @@ interface FilesArgs {
|
|
|
14
22
|
* }
|
|
15
23
|
* ```
|
|
16
24
|
*/
|
|
17
|
-
export declare const apiSideFiles: ({ basedir, webAuthn }: FilesArgs) => Promise<Record<string, string>>;
|
|
25
|
+
export declare const apiSideFiles: ({ basedir, webAuthn, oauth, }: FilesArgs) => Promise<Record<string, string>>;
|
|
18
26
|
/**
|
|
19
27
|
* Loops through the keys in `filesRecord` and generates unique file paths if
|
|
20
28
|
* they conflict with existing files
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authFiles.d.ts","sourceRoot":"","sources":["../../src/auth/authFiles.ts"],"names":[],"mappings":"AASA,UAAU,SAAS;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"authFiles.d.ts","sourceRoot":"","sources":["../../src/auth/authFiles.ts"],"names":[],"mappings":"AASA,UAAU,SAAS;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AA+DD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAU,+BAIhC,SAAS,oCA4CX,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,QAAQ,EAAE,MAAM,0BAwCjB"}
|
package/dist/auth/authFiles.js
CHANGED
|
@@ -4,37 +4,59 @@ import pascalcase from "pascalcase";
|
|
|
4
4
|
import { transformTSToJS } from "../lib/index.js";
|
|
5
5
|
import { getPaths } from "../lib/paths.js";
|
|
6
6
|
import { isTypeScriptProject } from "../lib/project.js";
|
|
7
|
-
const
|
|
7
|
+
const VARIANT_TAGS = ["webAuthn", "oauth"];
|
|
8
|
+
function parseTemplateFileName(fileName) {
|
|
9
|
+
const parts = fileName.split(".");
|
|
10
|
+
const baseName = parts[0];
|
|
11
|
+
const ext = parts.at(-2);
|
|
12
|
+
const tags = parts.slice(1, -2).filter((part) => VARIANT_TAGS.includes(part));
|
|
13
|
+
return { baseName, tags, ext };
|
|
14
|
+
}
|
|
15
|
+
function pickTemplateVariants(templateFiles, activeTags) {
|
|
16
|
+
const candidatesByKey = /* @__PURE__ */ new Map();
|
|
17
|
+
for (const fileName of templateFiles) {
|
|
18
|
+
const { baseName, tags, ext } = parseTemplateFileName(fileName);
|
|
19
|
+
const key = `${baseName}.${ext}`;
|
|
20
|
+
const candidates = candidatesByKey.get(key) ?? [];
|
|
21
|
+
candidates.push({ fileName, tags });
|
|
22
|
+
candidatesByKey.set(key, candidates);
|
|
23
|
+
}
|
|
24
|
+
const picked = [];
|
|
25
|
+
for (const candidates of candidatesByKey.values()) {
|
|
26
|
+
const applicable = candidates.filter(
|
|
27
|
+
(candidate) => candidate.tags.every((tag) => activeTags.includes(tag))
|
|
28
|
+
);
|
|
29
|
+
const mostSpecific = applicable.reduce(
|
|
30
|
+
(best, candidate) => candidate.tags.length > best.tags.length ? candidate : best
|
|
31
|
+
);
|
|
32
|
+
picked.push(mostSpecific);
|
|
33
|
+
}
|
|
34
|
+
return picked;
|
|
35
|
+
}
|
|
36
|
+
const apiSideFiles = async ({
|
|
37
|
+
basedir,
|
|
38
|
+
webAuthn,
|
|
39
|
+
oauth = false
|
|
40
|
+
}) => {
|
|
8
41
|
const apiSrcPath = getPaths().api.src;
|
|
9
42
|
const apiBaseTemplatePath = path.join(basedir, "templates", "api");
|
|
10
43
|
const templateDirectories = fs.readdirSync(apiBaseTemplatePath);
|
|
11
44
|
let filesRecord = {};
|
|
45
|
+
const activeTags = [
|
|
46
|
+
...webAuthn ? ["webAuthn"] : [],
|
|
47
|
+
...oauth ? ["oauth"] : []
|
|
48
|
+
];
|
|
12
49
|
for (const dir of templateDirectories) {
|
|
13
50
|
const templateFiles = fs.readdirSync(path.join(apiBaseTemplatePath, dir));
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let outputFileName = fileName.replace(/\.template$/, "");
|
|
51
|
+
const pickedVariants = pickTemplateVariants(templateFiles, activeTags);
|
|
52
|
+
const filePaths = pickedVariants.map(({ fileName }) => {
|
|
53
|
+
const { baseName, ext } = parseTemplateFileName(fileName);
|
|
54
|
+
let outputFileName = `${baseName}.${ext}`;
|
|
19
55
|
if (!isTypeScriptProject()) {
|
|
20
56
|
outputFileName = outputFileName.replace(/\.ts(x?)$/, ".js$1");
|
|
21
57
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
const webAuthnFileName = fileName.split(".").reverse().map((part, i) => i === 1 ? "webAuthn." + part : part).reverse().join(".");
|
|
26
|
-
if (templateFiles.includes(webAuthnFileName)) {
|
|
27
|
-
return { templateFileName: webAuthnFileName, outputFileName };
|
|
28
|
-
} else {
|
|
29
|
-
return { templateFileName: fileName, outputFileName };
|
|
30
|
-
}
|
|
31
|
-
}).map((f) => {
|
|
32
|
-
const templateFilePath = path.join(
|
|
33
|
-
apiBaseTemplatePath,
|
|
34
|
-
dir,
|
|
35
|
-
f.templateFileName
|
|
36
|
-
);
|
|
37
|
-
const outputFilePath = path.join(apiSrcPath, dir, f.outputFileName);
|
|
58
|
+
const templateFilePath = path.join(apiBaseTemplatePath, dir, fileName);
|
|
59
|
+
const outputFilePath = path.join(apiSrcPath, dir, outputFileName);
|
|
38
60
|
return { templateFilePath, outputFilePath };
|
|
39
61
|
});
|
|
40
62
|
for (const paths of filePaths) {
|
package/dist/auth/authTasks.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ListrRenderer, ListrTask, ListrTaskWrapper } from 'listr2';
|
|
2
|
+
import type { ExistingFiles } from '../lib/index.js';
|
|
2
3
|
export declare const getWebAppPath: () => string;
|
|
3
4
|
export declare const addApiConfig: ({ replaceExistingImport, authDecoderImport, }: {
|
|
4
5
|
replaceExistingImport: boolean;
|
|
@@ -31,7 +32,15 @@ export declare const addConfigToRoutes: () => {
|
|
|
31
32
|
*
|
|
32
33
|
* @returns Listr task
|
|
33
34
|
*/
|
|
34
|
-
export declare const generateAuthApiFiles: <Renderer extends typeof ListrRenderer>(basedir: string, webAuthn: boolean) => ListrTask<AuthGeneratorCtx, Renderer>;
|
|
35
|
+
export declare const generateAuthApiFiles: <Renderer extends typeof ListrRenderer>(basedir: string, webAuthn: boolean, oauth?: boolean) => ListrTask<AuthGeneratorCtx, Renderer>;
|
|
36
|
+
/**
|
|
37
|
+
* Exported for testing
|
|
38
|
+
*
|
|
39
|
+
* @returns `true` if writing `filesRecord` with the given `existingFiles`
|
|
40
|
+
* strategy writes `api/src/lib/auth.{ts,js}`, which is where the auth
|
|
41
|
+
* provider's `requireAuth` function lives
|
|
42
|
+
*/
|
|
43
|
+
export declare function writesApiAuthLib(filesRecord: Record<string, string>, existingFiles: ExistingFiles): boolean;
|
|
35
44
|
export declare const addAuthConfigToGqlApi: <Renderer extends typeof ListrRenderer, FallbackRenderer extends typeof ListrRenderer>(authDecoderImport?: string) => {
|
|
36
45
|
title: string;
|
|
37
46
|
task: (ctx: AuthGeneratorCtx, _task: ListrTaskWrapper<AuthGeneratorCtx, Renderer, FallbackRenderer>) => void;
|
|
@@ -41,9 +50,36 @@ export interface AuthGeneratorCtx {
|
|
|
41
50
|
setupMode: AuthSetupMode;
|
|
42
51
|
provider: string;
|
|
43
52
|
force: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Set by `generateAuthApiFiles`. `true` when setup writes the auth
|
|
55
|
+
* provider's `api/src/lib/auth.{ts,js}` file, replacing any existing
|
|
56
|
+
* `requireAuth` implementation
|
|
57
|
+
*/
|
|
58
|
+
apiAuthLibWritten?: boolean;
|
|
44
59
|
}
|
|
45
60
|
export declare const setAuthSetupMode: <Renderer extends typeof ListrRenderer, FallbackRenderer extends typeof ListrRenderer>(force: boolean) => {
|
|
46
61
|
title: string;
|
|
47
62
|
task: (ctx: AuthGeneratorCtx, task: ListrTaskWrapper<AuthGeneratorCtx, Renderer, FallbackRenderer>) => Promise<void>;
|
|
48
63
|
};
|
|
64
|
+
/**
|
|
65
|
+
* Exported for testing
|
|
66
|
+
*
|
|
67
|
+
* @param content - The contents of requireAuth.test.{ts,js}
|
|
68
|
+
* @returns The content with the stub test case replaced, or `undefined` if
|
|
69
|
+
* the unmodified stub test case isn't part of the content
|
|
70
|
+
*/
|
|
71
|
+
export declare const replaceStubRequireAuthTestCase: (content: string) => string | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* New Cedar apps ship with a test for the `requireAuth` directive that
|
|
74
|
+
* asserts the behavior of the stub `requireAuth` function. Setting up auth
|
|
75
|
+
* replaces that stub, so this task replaces the stub test case with test
|
|
76
|
+
* cases matching the real implementation. The test is only updated when
|
|
77
|
+
* setup writes `api/src/lib/auth.{ts,js}` (for example, not when the user
|
|
78
|
+
* declines overwriting existing files). Test files that don't contain the
|
|
79
|
+
* unmodified stub test case are left as they are.
|
|
80
|
+
*/
|
|
81
|
+
export declare const updateRequireAuthTest: <Renderer extends typeof ListrRenderer, FallbackRenderer extends typeof ListrRenderer>() => {
|
|
82
|
+
title: string;
|
|
83
|
+
task: (ctx: AuthGeneratorCtx, task: ListrTaskWrapper<AuthGeneratorCtx, Renderer, FallbackRenderer>) => void;
|
|
84
|
+
};
|
|
49
85
|
//# sourceMappingURL=authTasks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authTasks.d.ts","sourceRoot":"","sources":["../../src/auth/authTasks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"authTasks.d.ts","sourceRoot":"","sources":["../../src/auth/authTasks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAKxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAsBpD,eAAO,MAAM,aAAa,cAA2B,CAAA;AAwDrD,eAAO,MAAM,YAAY,GAAI,+CAG1B;IACD,qBAAqB,EAAE,OAAO,CAAA;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,SAgDA,CAAA;AAmCD,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,YAE9C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,WA6CjD,CAAA;AAuED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,SAAS,OAAO,aAAa,OAClC,SAAS,CAAC,gBAAgB,EAAE,QAAQ,CA8CxC,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,EAAE,UAAU,OAAO;;gBAgC1C,gBAAgB;CA0CrC,CAAA;AAED,eAAO,MAAM,iBAAiB;;;CAmB7B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,SAAS,OAAO,aAAa,EACxE,SAAS,MAAM,EACf,UAAU,OAAO,EACjB,eAAa,KACZ,SAAS,CAAC,gBAAgB,EAAE,QAAQ,CAkDtC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,aAAa,EAAE,aAAa,WAW7B;AASD,eAAO,MAAM,qBAAqB,GAChC,QAAQ,SAAS,OAAO,aAAa,EACrC,gBAAgB,SAAS,OAAO,aAAa,EAE7C,oBAAoB,MAAM;;gBAInB,gBAAgB,SACd,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,CAAC;CAcvE,CAAA;AAEF,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,SAAS,GACT,SAAS,GACT,SAAS,CAAA;AAEb,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,aAAa,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;IACd;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAED,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,SAAS,OAAO,aAAa,EACrC,gBAAgB,SAAS,OAAO,aAAa,EAE7C,OAAO,OAAO;;gBAKL,gBAAgB,QACf,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,CAAC;CA2CzE,CAAA;AAmCD;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,GAAI,SAAS,MAAM,uBAW7D,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,SAAS,OAAO,aAAa,EACrC,gBAAgB,SAAS,OAAO,aAAa;;gBAItC,gBAAgB,QACf,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,CAAC;CAmCtE,CAAA"}
|
package/dist/auth/authTasks.js
CHANGED
|
@@ -264,7 +264,7 @@ const addConfigToRoutes = () => {
|
|
|
264
264
|
}
|
|
265
265
|
};
|
|
266
266
|
};
|
|
267
|
-
const generateAuthApiFiles = (basedir, webAuthn) => {
|
|
267
|
+
const generateAuthApiFiles = (basedir, webAuthn, oauth = false) => {
|
|
268
268
|
return {
|
|
269
269
|
title: "Generating auth api side files...",
|
|
270
270
|
task: async (ctx, task) => {
|
|
@@ -273,7 +273,7 @@ const generateAuthApiFiles = (basedir, webAuthn) => {
|
|
|
273
273
|
"Could not find api/src directory. Cannot continue setup!"
|
|
274
274
|
);
|
|
275
275
|
}
|
|
276
|
-
let filesRecord = await apiSideFiles({ basedir, webAuthn });
|
|
276
|
+
let filesRecord = await apiSideFiles({ basedir, webAuthn, oauth });
|
|
277
277
|
let existingFiles = "FAIL";
|
|
278
278
|
if (ctx.setupMode === "FORCE") {
|
|
279
279
|
existingFiles = "OVERWRITE";
|
|
@@ -294,12 +294,21 @@ const generateAuthApiFiles = (basedir, webAuthn) => {
|
|
|
294
294
|
filesRecord = uniqueFilesRecord;
|
|
295
295
|
existingFiles = "FAIL";
|
|
296
296
|
}
|
|
297
|
+
ctx.apiAuthLibWritten = writesApiAuthLib(filesRecord, existingFiles);
|
|
297
298
|
return writeFilesTask(filesRecord, {
|
|
298
299
|
existingFiles
|
|
299
300
|
});
|
|
300
301
|
}
|
|
301
302
|
};
|
|
302
303
|
};
|
|
304
|
+
function writesApiAuthLib(filesRecord, existingFiles) {
|
|
305
|
+
const authLibPaths = ["ts", "js"].map(
|
|
306
|
+
(ext) => path.join(getPaths().api.src, "lib", `auth.${ext}`)
|
|
307
|
+
);
|
|
308
|
+
return Object.keys(filesRecord).some(
|
|
309
|
+
(filePath) => authLibPaths.includes(filePath) && (existingFiles === "OVERWRITE" || !fs.existsSync(filePath))
|
|
310
|
+
);
|
|
311
|
+
}
|
|
303
312
|
function findExistingFiles(filesMap) {
|
|
304
313
|
return Object.keys(filesMap).filter((filePath) => fs.existsSync(filePath)).map((filePath) => filePath.replace(getPaths().base, ""));
|
|
305
314
|
}
|
|
@@ -338,6 +347,65 @@ const setAuthSetupMode = (force) => {
|
|
|
338
347
|
}
|
|
339
348
|
};
|
|
340
349
|
};
|
|
350
|
+
const STUB_REQUIRE_AUTH_TEST_CASE = ` it('requireAuth has stub implementation. Should not throw when current user', () => {
|
|
351
|
+
// If you want to set values in context, pass it through e.g.
|
|
352
|
+
// mockRedwoodDirective(requireAuth, { context: { currentUser: { id: 1, name: 'Lebron McGretzky' } }})
|
|
353
|
+
const mockExecution = mockRedwoodDirective(requireAuth, { context: {} })
|
|
354
|
+
|
|
355
|
+
expect(mockExecution).not.toThrowError()
|
|
356
|
+
})`;
|
|
357
|
+
const REQUIRE_AUTH_TEST_CASES = ` it('throws when there is no current user', () => {
|
|
358
|
+
const mockExecution = mockRedwoodDirective(requireAuth, { context: {} })
|
|
359
|
+
|
|
360
|
+
expect(mockExecution).toThrowError("You don't have permission to do that.")
|
|
361
|
+
})
|
|
362
|
+
|
|
363
|
+
it('does not throw when there is a current user', () => {
|
|
364
|
+
// The mocked user should have the same shape as what getCurrentUser()
|
|
365
|
+
// in api/src/lib/auth returns
|
|
366
|
+
const mockExecution = mockRedwoodDirective(requireAuth, {
|
|
367
|
+
context: { currentUser: { id: 1 } },
|
|
368
|
+
})
|
|
369
|
+
|
|
370
|
+
expect(mockExecution).not.toThrowError()
|
|
371
|
+
})`;
|
|
372
|
+
const replaceStubRequireAuthTestCase = (content) => {
|
|
373
|
+
const eol = content.includes("\r\n") ? "\r\n" : "\n";
|
|
374
|
+
const normalizedContent = content.replaceAll("\r\n", "\n");
|
|
375
|
+
if (!normalizedContent.includes(STUB_REQUIRE_AUTH_TEST_CASE)) {
|
|
376
|
+
return void 0;
|
|
377
|
+
}
|
|
378
|
+
return normalizedContent.replace(STUB_REQUIRE_AUTH_TEST_CASE, REQUIRE_AUTH_TEST_CASES).replaceAll("\n", eol);
|
|
379
|
+
};
|
|
380
|
+
const updateRequireAuthTest = () => ({
|
|
381
|
+
title: "Updating requireAuth directive test...",
|
|
382
|
+
task: (ctx, task) => {
|
|
383
|
+
if (!ctx.apiAuthLibWritten) {
|
|
384
|
+
task.skip(
|
|
385
|
+
"Keeping the requireAuth directive test as is, because the existing requireAuth implementation is kept"
|
|
386
|
+
);
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
const testFilePath = ["ts", "js"].map(
|
|
390
|
+
(ext) => path.join(
|
|
391
|
+
getPaths().api.directives,
|
|
392
|
+
"requireAuth",
|
|
393
|
+
`requireAuth.test.${ext}`
|
|
394
|
+
)
|
|
395
|
+
).find((filePath) => fs.existsSync(filePath));
|
|
396
|
+
if (!testFilePath) {
|
|
397
|
+
task.skip("No requireAuth directive test found");
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
const content = fs.readFileSync(testFilePath, "utf-8");
|
|
401
|
+
const newContent = replaceStubRequireAuthTestCase(content);
|
|
402
|
+
if (newContent === void 0) {
|
|
403
|
+
task.skip("Keeping the customized requireAuth directive test as is");
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
fs.writeFileSync(testFilePath, newContent);
|
|
407
|
+
}
|
|
408
|
+
});
|
|
341
409
|
export {
|
|
342
410
|
addApiConfig,
|
|
343
411
|
addAuthConfigToGqlApi,
|
|
@@ -348,5 +416,8 @@ export {
|
|
|
348
416
|
getWebAppPath,
|
|
349
417
|
hasAuthProvider,
|
|
350
418
|
removeAuthProvider,
|
|
351
|
-
|
|
419
|
+
replaceStubRequireAuthTestCase,
|
|
420
|
+
setAuthSetupMode,
|
|
421
|
+
updateRequireAuthTest,
|
|
422
|
+
writesApiAuthLib
|
|
352
423
|
};
|
|
@@ -13,6 +13,7 @@ export interface AuthHandlerArgs {
|
|
|
13
13
|
provider: string;
|
|
14
14
|
authDecoderImport?: string;
|
|
15
15
|
webAuthn?: boolean;
|
|
16
|
+
oauth?: boolean;
|
|
16
17
|
webPackages?: string[];
|
|
17
18
|
apiPackages?: string[];
|
|
18
19
|
extraTasks?: (ListrTask<AuthGeneratorCtx> | undefined)[];
|
|
@@ -23,5 +24,5 @@ export interface AuthHandlerArgs {
|
|
|
23
24
|
* basedir assumes that you must have a templates folder in that directory.
|
|
24
25
|
* See folder structure of auth providers in packages/auth-providers/<provider>/setup/src
|
|
25
26
|
*/
|
|
26
|
-
export declare const standardAuthHandler: ({ basedir, forceArg, provider, authDecoderImport, webAuthn, webPackages, apiPackages, extraTasks, notes, verbose, }: AuthHandlerArgs) => Promise<void>;
|
|
27
|
+
export declare const standardAuthHandler: ({ basedir, forceArg, provider, authDecoderImport, webAuthn, oauth, webPackages, apiPackages, extraTasks, notes, verbose, }: AuthHandlerArgs) => Promise<void>;
|
|
27
28
|
//# sourceMappingURL=setupHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupHelpers.d.ts","sourceRoot":"","sources":["../../src/auth/setupHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAGvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAWjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"setupHelpers.d.ts","sourceRoot":"","sources":["../../src/auth/setupHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAGvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAWjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAWtD,YAAY,EAAE,gBAAgB,EAAE,CAAA;AAEhC,eAAO,MAAM,mBAAmB,GAAI,OAAO,IAAI;;;;EAoB9C,CAAA;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,UAAU,CAAC,EAAE,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC,EAAE,CAAA;IACxD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AASD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAU,4HAYvC,eAAe,kBAkFjB,CAAA"}
|
|
@@ -13,7 +13,8 @@ import {
|
|
|
13
13
|
addConfigToWebApp,
|
|
14
14
|
setAuthSetupMode,
|
|
15
15
|
createWebAuth,
|
|
16
|
-
generateAuthApiFiles
|
|
16
|
+
generateAuthApiFiles,
|
|
17
|
+
updateRequireAuthTest
|
|
17
18
|
} from "./authTasks.js";
|
|
18
19
|
const standardAuthBuilder = (yargs) => {
|
|
19
20
|
return yargs.option("force", {
|
|
@@ -42,6 +43,7 @@ const standardAuthHandler = async ({
|
|
|
42
43
|
provider,
|
|
43
44
|
authDecoderImport,
|
|
44
45
|
webAuthn = false,
|
|
46
|
+
oauth = false,
|
|
45
47
|
webPackages = [],
|
|
46
48
|
apiPackages = [],
|
|
47
49
|
extraTasks,
|
|
@@ -51,7 +53,8 @@ const standardAuthHandler = async ({
|
|
|
51
53
|
const tasks = new Listr(
|
|
52
54
|
[
|
|
53
55
|
setAuthSetupMode(forceArg),
|
|
54
|
-
generateAuthApiFiles(basedir, webAuthn),
|
|
56
|
+
generateAuthApiFiles(basedir, webAuthn, oauth),
|
|
57
|
+
updateRequireAuthTest(),
|
|
55
58
|
addConfigToWebApp(),
|
|
56
59
|
createWebAuth(basedir, webAuthn),
|
|
57
60
|
addConfigToRoutes(),
|
package/dist/lib/colors.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Canonical color/style palette for all Cedar CLI packages.
|
|
3
3
|
*
|
|
4
4
|
* Import from here rather than defining local copies:
|
|
5
|
-
* import { colors } from '@cedarjs/cli-helpers'
|
|
5
|
+
* import { colors } from '@cedarjs/cli-helpers/colors'
|
|
6
6
|
*
|
|
7
7
|
* If you need a color that isn't here, add it here rather than
|
|
8
8
|
* introducing a one-off in another package.
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EAEd,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAW9B,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,EAAE,SAAS,MAAM,6BAgBhE,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,oBAsB9B,CAAA;AAED,eAAO,MAAM,QAAQ,GACnB,kBAAkB,MAAM,EACxB,kBAAkB,MAAM,KACvB,OAAO,CAAC,MAAM,CAwBhB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,CAAA;AAEzD,eAAO,MAAM,SAAS,GAAI,QAAQ,SAAS,OAAO,aAAa,EAC7D,QAAQ,MAAM,EACd,UAAU,MAAM,EAChB,oBAA4B;IAAE,aAAa,CAAC,EAAE,aAAa,CAAA;CAAO,EAGlE,OAAM,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAI/C,SAoBF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,OAAO,aAAa,EAClE,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,SAAS;IAAE,aAAa,EAAE,aAAa,CAAA;CAAE,qCAuB1C,CAAA"}
|
package/dist/lib/index.js
CHANGED
|
@@ -1,37 +1,23 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import { pathToFileURL } from "node:url";
|
|
3
3
|
import path from "path";
|
|
4
|
-
import * as babel from "@babel/core";
|
|
5
4
|
import { Listr } from "listr2";
|
|
6
5
|
import { format } from "prettier";
|
|
7
6
|
import { colors } from "./colors.js";
|
|
8
7
|
import { getPaths } from "./paths.js";
|
|
8
|
+
import { transpileTSToJS } from "./transpileTSToJS.js";
|
|
9
9
|
const transformTSToJS = (filename, content) => {
|
|
10
10
|
if (!content) {
|
|
11
11
|
return content;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
configFile: false,
|
|
19
|
-
plugins: [
|
|
20
|
-
[
|
|
21
|
-
"@babel/plugin-transform-typescript",
|
|
22
|
-
{
|
|
23
|
-
isTSX: true,
|
|
24
|
-
allExtensions: true
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
],
|
|
28
|
-
retainLines: true
|
|
29
|
-
});
|
|
30
|
-
if (!babelFileResult?.code) {
|
|
31
|
-
console.error(colors.error(`Could not transform ${filename} to JS`));
|
|
13
|
+
let code;
|
|
14
|
+
try {
|
|
15
|
+
code = transpileTSToJS(filename, content);
|
|
16
|
+
} catch (e) {
|
|
17
|
+
console.error(colors.error(e instanceof Error ? e.message : String(e)));
|
|
32
18
|
process.exit(1);
|
|
33
19
|
}
|
|
34
|
-
return prettify(filename.replace(/\.ts(x)?$/, ".js$1"),
|
|
20
|
+
return prettify(filename.replace(/\.ts(x)?$/, ".js$1"), code);
|
|
35
21
|
};
|
|
36
22
|
const getPrettierOptions = async () => {
|
|
37
23
|
try {
|
|
@@ -39,10 +25,10 @@ const getPrettierOptions = async () => {
|
|
|
39
25
|
const mjsPath = path.join(getPaths().base, "prettier.config.mjs");
|
|
40
26
|
const prettierConfigPath = fs.existsSync(cjsPath) ? cjsPath : mjsPath;
|
|
41
27
|
const { default: options } = await import(pathToFileURL(prettierConfigPath).href);
|
|
42
|
-
if (options.
|
|
43
|
-
options.
|
|
28
|
+
if (options.tailwindStylesheet?.startsWith(".")) {
|
|
29
|
+
options.tailwindStylesheet = path.join(
|
|
44
30
|
process.env.CEDAR_CWD ?? process.env.RWJS_CWD ?? process.cwd(),
|
|
45
|
-
options.
|
|
31
|
+
options.tailwindStylesheet
|
|
46
32
|
);
|
|
47
33
|
}
|
|
48
34
|
return options;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strips the TypeScript syntax from `content` and returns the resulting
|
|
3
|
+
* JavaScript source. Everything that is not TypeScript syntax, including JSX,
|
|
4
|
+
* comments, blank lines and indentation, is kept byte-for-byte, so the output
|
|
5
|
+
* only needs formatting.
|
|
6
|
+
*
|
|
7
|
+
* `import type` statements, `type` specifiers and imports whose bindings are
|
|
8
|
+
* only used as types are removed. Lines that only held removed syntax (for
|
|
9
|
+
* example an `import type` line or an `interface` body) are dropped so they
|
|
10
|
+
* do not turn into stray blank lines.
|
|
11
|
+
*
|
|
12
|
+
* `filename` is used for error messages. The content is always parsed as TSX
|
|
13
|
+
* because templates can contain JSX regardless of their extension.
|
|
14
|
+
*
|
|
15
|
+
* Throws when sucrase reports a syntax error.
|
|
16
|
+
*/
|
|
17
|
+
export declare function transpileTSToJS(filename: string, content: string): string;
|
|
18
|
+
//# sourceMappingURL=transpileTSToJS.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transpileTSToJS.d.ts","sourceRoot":"","sources":["../../src/lib/transpileTSToJS.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAwBhE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { transform } from "sucrase";
|
|
2
|
+
const BLANK_LINE_REGEX = /^[ \t]*$/;
|
|
3
|
+
function transpileTSToJS(filename, content) {
|
|
4
|
+
let code;
|
|
5
|
+
try {
|
|
6
|
+
code = transform(content, {
|
|
7
|
+
// `jsx` is required to parse JSX at all. `jsxRuntime: 'preserve'` keeps
|
|
8
|
+
// the JSX untouched so the project's own build compiles it.
|
|
9
|
+
transforms: ["typescript", "jsx"],
|
|
10
|
+
jsxRuntime: "preserve",
|
|
11
|
+
// Keep modern ECMAScript syntax (optional chaining, class fields, ...)
|
|
12
|
+
// as written.
|
|
13
|
+
disableESTransforms: true,
|
|
14
|
+
keepUnusedImports: false,
|
|
15
|
+
filePath: filename
|
|
16
|
+
}).code;
|
|
17
|
+
} catch (e) {
|
|
18
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
19
|
+
throw new Error(
|
|
20
|
+
`Could not transform ${filename} from TypeScript to JavaScript:
|
|
21
|
+
${message}`
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
return dropEmptiedLines(content, code);
|
|
25
|
+
}
|
|
26
|
+
function dropEmptiedLines(input, output) {
|
|
27
|
+
const inputLines = input.split("\n");
|
|
28
|
+
const outputLines = output.split("\n");
|
|
29
|
+
if (inputLines.length !== outputLines.length) {
|
|
30
|
+
return output;
|
|
31
|
+
}
|
|
32
|
+
return outputLines.filter(
|
|
33
|
+
(line, index) => !BLANK_LINE_REGEX.test(line) || BLANK_LINE_REGEX.test(inputLines[index])
|
|
34
|
+
).join("\n");
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
transpileTSToJS
|
|
38
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompting libraries (e.g. `prompts`) hang indefinitely when stdin isn't a
|
|
3
|
+
* TTY - piped input, CI, or a backgrounded process never sends a keypress,
|
|
4
|
+
* so the prompt neither resolves nor throws.
|
|
5
|
+
*
|
|
6
|
+
* Call this immediately before any interactive confirm/prompt that's only
|
|
7
|
+
* reached when a flag was left unset, so a non-interactive invocation exits
|
|
8
|
+
* with a clear, actionable error instead of hanging.
|
|
9
|
+
*/
|
|
10
|
+
export declare function requireTTYOrExit(flagHint: string): void;
|
|
11
|
+
//# sourceMappingURL=tty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tty.d.ts","sourceRoot":"","sources":["../../src/lib/tty.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAYvD"}
|
package/dist/lib/tty.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
2
|
+
import { colors } from "./colors.js";
|
|
3
|
+
function requireTTYOrExit(flagHint) {
|
|
4
|
+
if (process.stdin.isTTY) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
const error = new Error(
|
|
8
|
+
`Cannot prompt for confirmation in a non-interactive terminal. Please pass ${flagHint} explicitly.`
|
|
9
|
+
);
|
|
10
|
+
errorTelemetry(process.argv, error.message);
|
|
11
|
+
console.error(colors.error(error.message));
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
requireTTYOrExit
|
|
16
|
+
};
|
package/dist/lib/version.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import
|
|
3
|
+
import { rangesIntersect, sort, tryParse } from "verkit";
|
|
4
4
|
import { getPaths } from "@cedarjs/project-config";
|
|
5
5
|
function getCorrespondingTag(version, distTags) {
|
|
6
6
|
return Object.entries(distTags).find(([_, v]) => v === version)?.[0];
|
|
@@ -12,7 +12,7 @@ async function getCompatibilityData(packageName, preferredVersionOrTag) {
|
|
|
12
12
|
})
|
|
13
13
|
);
|
|
14
14
|
const projectRedwoodVersion = projectPackageJson.devDependencies["@cedarjs/core"];
|
|
15
|
-
const semverVersion =
|
|
15
|
+
const semverVersion = tryParse(preferredVersionOrTag);
|
|
16
16
|
const isUsingTag = semverVersion === null;
|
|
17
17
|
const res = await fetch(`https://registry.npmjs.org/${packageName}`);
|
|
18
18
|
const packument = await res.json();
|
|
@@ -34,7 +34,7 @@ async function getCompatibilityData(packageName, preferredVersionOrTag) {
|
|
|
34
34
|
}
|
|
35
35
|
const preferredVersion = isUsingTag ? packument["dist-tags"][preferredVersionOrTag] : preferredVersionOrTag;
|
|
36
36
|
const packageRedwoodSpecification = packument.versions[preferredVersion].engines?.redwoodjs;
|
|
37
|
-
if (packageRedwoodSpecification !== void 0 &&
|
|
37
|
+
if (packageRedwoodSpecification !== void 0 && rangesIntersect(projectRedwoodVersion, packageRedwoodSpecification)) {
|
|
38
38
|
const tag = getCorrespondingTag(preferredVersion, packument["dist-tags"]);
|
|
39
39
|
return {
|
|
40
40
|
preferred: {
|
|
@@ -47,13 +47,13 @@ async function getCompatibilityData(packageName, preferredVersionOrTag) {
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
const versions =
|
|
50
|
+
const versions = sort(Object.keys(packument.versions));
|
|
51
51
|
for (let i = versions.length - 1; i >= 0; i--) {
|
|
52
52
|
const redwoodVersionRequired = packument.versions[versions[i]].engines?.redwoodjs;
|
|
53
53
|
if (redwoodVersionRequired === void 0) {
|
|
54
54
|
continue;
|
|
55
55
|
}
|
|
56
|
-
if (
|
|
56
|
+
if (rangesIntersect(projectRedwoodVersion, redwoodVersionRequired)) {
|
|
57
57
|
return {
|
|
58
58
|
preferred: {
|
|
59
59
|
tag: getCorrespondingTag(preferredVersion, packument["dist-tags"]),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/cli-helpers",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.1-next.469",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -9,12 +9,6 @@
|
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"default": {
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
15
|
-
"default": "./dist/index.js"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
12
|
"./loadEnvFiles": {
|
|
19
13
|
"default": {
|
|
20
14
|
"types": "./dist/lib/loadEnvFiles.d.ts",
|
|
@@ -56,9 +50,68 @@
|
|
|
56
50
|
"types": "./dist/packageManager/workspaces.d.ts",
|
|
57
51
|
"default": "./dist/packageManager/workspaces.js"
|
|
58
52
|
}
|
|
53
|
+
},
|
|
54
|
+
"./fileHelpers": {
|
|
55
|
+
"default": {
|
|
56
|
+
"types": "./dist/lib/index.d.ts",
|
|
57
|
+
"default": "./dist/lib/index.js"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"./colors": {
|
|
61
|
+
"default": {
|
|
62
|
+
"types": "./dist/lib/colors.d.ts",
|
|
63
|
+
"default": "./dist/lib/colors.js"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"./paths": {
|
|
67
|
+
"default": {
|
|
68
|
+
"types": "./dist/lib/paths.d.ts",
|
|
69
|
+
"default": "./dist/lib/paths.js"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"./project": {
|
|
73
|
+
"default": {
|
|
74
|
+
"types": "./dist/lib/project.d.ts",
|
|
75
|
+
"default": "./dist/lib/project.js"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"./transpileTSToJS": {
|
|
79
|
+
"default": {
|
|
80
|
+
"types": "./dist/lib/transpileTSToJS.d.ts",
|
|
81
|
+
"default": "./dist/lib/transpileTSToJS.js"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"./tty": {
|
|
85
|
+
"default": {
|
|
86
|
+
"types": "./dist/lib/tty.d.ts",
|
|
87
|
+
"default": "./dist/lib/tty.js"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"./version": {
|
|
91
|
+
"default": {
|
|
92
|
+
"types": "./dist/lib/version.d.ts",
|
|
93
|
+
"default": "./dist/lib/version.js"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"./auth/setupHelpers": {
|
|
97
|
+
"default": {
|
|
98
|
+
"types": "./dist/auth/setupHelpers.d.ts",
|
|
99
|
+
"default": "./dist/auth/setupHelpers.js"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"./installHelpers": {
|
|
103
|
+
"default": {
|
|
104
|
+
"types": "./dist/lib/installHelpers.d.ts",
|
|
105
|
+
"default": "./dist/lib/installHelpers.js"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"./telemetry": {
|
|
109
|
+
"default": {
|
|
110
|
+
"types": "./dist/telemetry/index.d.ts",
|
|
111
|
+
"default": "./dist/telemetry/index.js"
|
|
112
|
+
}
|
|
59
113
|
}
|
|
60
114
|
},
|
|
61
|
-
"types": "./dist/index.d.ts",
|
|
62
115
|
"files": [
|
|
63
116
|
"dist"
|
|
64
117
|
],
|
|
@@ -72,10 +125,9 @@
|
|
|
72
125
|
"test:watch": "vitest watch"
|
|
73
126
|
},
|
|
74
127
|
"dependencies": {
|
|
75
|
-
"@
|
|
76
|
-
"@cedarjs/
|
|
77
|
-
"@
|
|
78
|
-
"@listr2/prompt-adapter-enquirer": "4.3.2",
|
|
128
|
+
"@cedarjs/project-config": "7.1.1-next.469",
|
|
129
|
+
"@cedarjs/telemetry": "7.1.1-next.469",
|
|
130
|
+
"@listr2/prompt-adapter-enquirer": "4.3.3",
|
|
79
131
|
"@opentelemetry/api": "1.9.1",
|
|
80
132
|
"ansis": "4.4.0",
|
|
81
133
|
"dotenv": "16.6.1",
|
|
@@ -85,19 +137,19 @@
|
|
|
85
137
|
"listr2": "10.2.2",
|
|
86
138
|
"lodash": "4.18.1",
|
|
87
139
|
"pascalcase": "1.0.0",
|
|
88
|
-
"prettier": "3.9.
|
|
140
|
+
"prettier": "3.9.10",
|
|
89
141
|
"prompts": "2.4.2",
|
|
90
|
-
"
|
|
91
|
-
"
|
|
142
|
+
"smol-toml": "1.9.1",
|
|
143
|
+
"sucrase": "3.35.1",
|
|
92
144
|
"termi-link": "1.1.0",
|
|
145
|
+
"verkit": "0.5.0",
|
|
93
146
|
"yargs-parser": "21.1.1"
|
|
94
147
|
},
|
|
95
148
|
"devDependencies": {
|
|
96
|
-
"@cedarjs/framework-tools": "7.1.
|
|
149
|
+
"@cedarjs/framework-tools": "7.1.1-next.469",
|
|
97
150
|
"@types/dotenv-defaults": "^5.0.0",
|
|
98
|
-
"@types/lodash": "4.17.
|
|
151
|
+
"@types/lodash": "4.17.26",
|
|
99
152
|
"@types/pascalcase": "1.0.3",
|
|
100
|
-
"@types/semver": "^7",
|
|
101
153
|
"@types/yargs": "17.0.35",
|
|
102
154
|
"@types/yargs-parser": "21.0.3",
|
|
103
155
|
"prettier-plugin-tailwindcss": "0.8.1",
|
package/dist/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './lib/index.js';
|
|
2
|
-
export * from './lib/colors.js';
|
|
3
|
-
export { loadEnvFiles } from './lib/loadEnvFiles.js';
|
|
4
|
-
export { loadDefaultEnvFiles, loadNodeEnvDerivedEnvFile, loadUserSpecifiedEnvFiles, } from './lib/loadEnvFiles.js';
|
|
5
|
-
export * from './lib/paths.js';
|
|
6
|
-
export * from './lib/project.js';
|
|
7
|
-
export * from './lib/version.js';
|
|
8
|
-
export * from './auth/setupHelpers.js';
|
|
9
|
-
export type { AuthHandlerArgs, AuthGeneratorCtx } from './auth/setupHelpers.js';
|
|
10
|
-
export * from './lib/installHelpers.js';
|
|
11
|
-
export * from './telemetry/index.js';
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE/E,cAAc,yBAAyB,CAAA;AAEvC,cAAc,sBAAsB,CAAA"}
|
package/dist/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export * from "./lib/index.js";
|
|
2
|
-
export * from "./lib/colors.js";
|
|
3
|
-
import { loadEnvFiles } from "./lib/loadEnvFiles.js";
|
|
4
|
-
import {
|
|
5
|
-
loadDefaultEnvFiles,
|
|
6
|
-
loadNodeEnvDerivedEnvFile,
|
|
7
|
-
loadUserSpecifiedEnvFiles
|
|
8
|
-
} from "./lib/loadEnvFiles.js";
|
|
9
|
-
export * from "./lib/paths.js";
|
|
10
|
-
export * from "./lib/project.js";
|
|
11
|
-
export * from "./lib/version.js";
|
|
12
|
-
export * from "./auth/setupHelpers.js";
|
|
13
|
-
export * from "./lib/installHelpers.js";
|
|
14
|
-
export * from "./telemetry/index.js";
|
|
15
|
-
export {
|
|
16
|
-
loadDefaultEnvFiles,
|
|
17
|
-
loadEnvFiles,
|
|
18
|
-
loadNodeEnvDerivedEnvFile,
|
|
19
|
-
loadUserSpecifiedEnvFiles
|
|
20
|
-
};
|