@cedarjs/cli-helpers 6.0.0-canary.2771 → 6.0.0-canary.2773

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.
Files changed (56) hide show
  1. package/dist/lib/project.d.ts.map +1 -1
  2. package/dist/lib/project.js +2 -1
  3. package/package.json +14 -46
  4. package/dist/cjs/auth/authFiles.d.ts +0 -44
  5. package/dist/cjs/auth/authFiles.d.ts.map +0 -1
  6. package/dist/cjs/auth/authFiles.js +0 -109
  7. package/dist/cjs/auth/authTasks.d.ts +0 -49
  8. package/dist/cjs/auth/authTasks.d.ts.map +0 -1
  9. package/dist/cjs/auth/authTasks.js +0 -391
  10. package/dist/cjs/auth/setupHelpers.d.ts +0 -27
  11. package/dist/cjs/auth/setupHelpers.d.ts.map +0 -1
  12. package/dist/cjs/auth/setupHelpers.js +0 -141
  13. package/dist/cjs/index.d.ts +0 -12
  14. package/dist/cjs/index.d.ts.map +0 -1
  15. package/dist/cjs/index.js +0 -52
  16. package/dist/cjs/lib/colors.d.ts +0 -24
  17. package/dist/cjs/lib/colors.d.ts.map +0 -1
  18. package/dist/cjs/lib/colors.js +0 -52
  19. package/dist/cjs/lib/index.d.ts +0 -22
  20. package/dist/cjs/lib/index.d.ts.map +0 -1
  21. package/dist/cjs/lib/index.js +0 -147
  22. package/dist/cjs/lib/installHelpers.d.ts +0 -17
  23. package/dist/cjs/lib/installHelpers.d.ts.map +0 -1
  24. package/dist/cjs/lib/installHelpers.js +0 -65
  25. package/dist/cjs/lib/loadEnvFiles.d.ts +0 -5
  26. package/dist/cjs/lib/loadEnvFiles.d.ts.map +0 -1
  27. package/dist/cjs/lib/loadEnvFiles.js +0 -99
  28. package/dist/cjs/lib/paths.d.ts +0 -6
  29. package/dist/cjs/lib/paths.d.ts.map +0 -1
  30. package/dist/cjs/lib/paths.js +0 -42
  31. package/dist/cjs/lib/project.d.ts +0 -44
  32. package/dist/cjs/lib/project.d.ts.map +0 -1
  33. package/dist/cjs/lib/project.js +0 -268
  34. package/dist/cjs/lib/version.d.ts +0 -17
  35. package/dist/cjs/lib/version.d.ts.map +0 -1
  36. package/dist/cjs/lib/version.js +0 -107
  37. package/dist/cjs/package.json +0 -1
  38. package/dist/cjs/packageManager/display.d.ts +0 -90
  39. package/dist/cjs/packageManager/display.d.ts.map +0 -1
  40. package/dist/cjs/packageManager/display.js +0 -139
  41. package/dist/cjs/packageManager/exec.d.ts +0 -77
  42. package/dist/cjs/packageManager/exec.d.ts.map +0 -1
  43. package/dist/cjs/packageManager/exec.js +0 -152
  44. package/dist/cjs/packageManager/index.d.ts +0 -13
  45. package/dist/cjs/packageManager/index.d.ts.map +0 -1
  46. package/dist/cjs/packageManager/index.js +0 -73
  47. package/dist/cjs/packageManager/packages.d.ts +0 -39
  48. package/dist/cjs/packageManager/packages.d.ts.map +0 -1
  49. package/dist/cjs/packageManager/packages.js +0 -91
  50. package/dist/cjs/packageManager/workspaces.d.ts +0 -4
  51. package/dist/cjs/packageManager/workspaces.d.ts.map +0 -1
  52. package/dist/cjs/packageManager/workspaces.js +0 -93
  53. package/dist/cjs/telemetry/index.d.ts +0 -20
  54. package/dist/cjs/telemetry/index.d.ts.map +0 -1
  55. package/dist/cjs/telemetry/index.js +0 -64
  56. package/dist/package.json +0 -1
@@ -1,52 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var colors_exports = {};
30
- __export(colors_exports, {
31
- colors: () => colors
32
- });
33
- module.exports = __toCommonJS(colors_exports);
34
- var import_ansis = __toESM(require("ansis"), 1);
35
- const colors = {
36
- error: import_ansis.default.bold.red,
37
- warning: import_ansis.default.hex("#ffa500"),
38
- highlight: import_ansis.default.hex("#ffa500"),
39
- success: import_ansis.default.green,
40
- info: import_ansis.default.gray,
41
- bold: import_ansis.default.bold,
42
- underline: import_ansis.default.underline,
43
- note: import_ansis.default.blue,
44
- tip: import_ansis.default.green,
45
- important: import_ansis.default.magenta,
46
- caution: import_ansis.default.red,
47
- link: import_ansis.default.underline
48
- };
49
- // Annotate the CommonJS export names for ESM import in node:
50
- 0 && (module.exports = {
51
- colors
52
- });
@@ -1,22 +0,0 @@
1
- import type { ListrTaskWrapper, ListrRenderer } from 'listr2';
2
- import { Listr } from 'listr2';
3
- export declare const transformTSToJS: (filename: string, content: string) => string | Promise<string>;
4
- /**
5
- * This returns the config present in `prettier.config.cjs` or
6
- * `prettier.config.mjs` of a Cedar project.
7
- */
8
- export declare const getPrettierOptions: () => Promise<any>;
9
- export declare const prettify: (templateFilename: string, renderedTemplate: string) => Promise<string>;
10
- export type ExistingFiles = 'OVERWRITE' | 'SKIP' | 'FAIL';
11
- export declare const writeFile: <Renderer extends typeof ListrRenderer>(target: string, contents: string, { existingFiles }?: {
12
- existingFiles?: ExistingFiles;
13
- }, task?: ListrTaskWrapper<never, Renderer, Renderer>) => void;
14
- /**
15
- * Creates a list of tasks that write files to the disk.
16
- *
17
- * @param files - {[filepath]: contents}
18
- */
19
- export declare const writeFilesTask: <Renderer extends typeof ListrRenderer>(files: Record<string, string>, options: {
20
- existingFiles: ExistingFiles;
21
- }) => Listr<never, Renderer, Renderer>;
22
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EAEd,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAU9B,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,EAAE,SAAS,MAAM,6BA8BhE,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"}
@@ -1,147 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var lib_exports = {};
30
- __export(lib_exports, {
31
- getPrettierOptions: () => getPrettierOptions,
32
- prettify: () => prettify,
33
- transformTSToJS: () => transformTSToJS,
34
- writeFile: () => writeFile,
35
- writeFilesTask: () => writeFilesTask
36
- });
37
- module.exports = __toCommonJS(lib_exports);
38
- var import_node_fs = __toESM(require("node:fs"), 1);
39
- var import_node_url = require("node:url");
40
- var import_path = __toESM(require("path"), 1);
41
- var babel = __toESM(require("@babel/core"), 1);
42
- var import_listr2 = require("listr2");
43
- var import_prettier = require("prettier");
44
- var import_colors = require("./colors.js");
45
- var import_paths = require("./paths.js");
46
- const transformTSToJS = (filename, content) => {
47
- if (!content) {
48
- return content;
49
- }
50
- const babelFileResult = babel.transform(content, {
51
- filename,
52
- // If you ran `yarn cedar generate` in `./web` transformSync would import the `.babelrc.js` file,
53
- // in `./web`? despite us setting `configFile: false`.
54
- cwd: process.env.NODE_ENV === "test" ? void 0 : (0, import_paths.getPaths)().base,
55
- configFile: false,
56
- plugins: [
57
- [
58
- "@babel/plugin-transform-typescript",
59
- {
60
- isTSX: true,
61
- allExtensions: true
62
- }
63
- ]
64
- ],
65
- retainLines: true
66
- });
67
- if (!babelFileResult?.code) {
68
- console.error(import_colors.colors.error(`Could not transform ${filename} to JS`));
69
- process.exit(1);
70
- }
71
- return prettify(filename.replace(/\.ts(x)?$/, ".js$1"), babelFileResult.code);
72
- };
73
- const getPrettierOptions = async () => {
74
- try {
75
- const cjsPath = import_path.default.join((0, import_paths.getPaths)().base, "prettier.config.cjs");
76
- const mjsPath = import_path.default.join((0, import_paths.getPaths)().base, "prettier.config.mjs");
77
- const prettierConfigPath = import_node_fs.default.existsSync(cjsPath) ? cjsPath : mjsPath;
78
- const { default: options } = await import((0, import_node_url.pathToFileURL)(prettierConfigPath).href);
79
- if (options.tailwindConfig?.startsWith(".")) {
80
- options.tailwindConfig = import_path.default.join(
81
- process.env.CEDAR_CWD ?? process.env.RWJS_CWD ?? process.cwd(),
82
- options.tailwindConfig
83
- );
84
- }
85
- return options;
86
- } catch {
87
- return void 0;
88
- }
89
- };
90
- const prettify = async (templateFilename, renderedTemplate) => {
91
- const parser = {
92
- ".css": "css",
93
- ".js": "babel",
94
- ".cjs": "babel",
95
- ".mjs": "babel",
96
- ".ts": "babel-ts",
97
- ".mts": "babel-ts",
98
- ".tsx": "babel-ts"
99
- }[import_path.default.extname(templateFilename.replace(".template", ""))];
100
- if (typeof parser === "undefined") {
101
- return renderedTemplate;
102
- }
103
- const prettierOptions = await getPrettierOptions();
104
- return (0, import_prettier.format)(renderedTemplate, {
105
- ...prettierOptions,
106
- parser
107
- });
108
- };
109
- const writeFile = (target, contents, { existingFiles = "FAIL" } = {}, task = {}) => {
110
- const { base } = (0, import_paths.getPaths)();
111
- task.title = `Writing \`./${import_path.default.relative(base, target)}\``;
112
- const exists = import_node_fs.default.existsSync(target);
113
- if (exists && existingFiles === "FAIL") {
114
- throw new Error(`${target} already exists.`);
115
- }
116
- if (exists && existingFiles === "SKIP") {
117
- task.skip(`Skipping update of \`./${import_path.default.relative(base, target)}\``);
118
- return;
119
- }
120
- const filename = import_path.default.basename(target);
121
- const targetDir = target.replace(filename, "");
122
- import_node_fs.default.mkdirSync(targetDir, { recursive: true });
123
- import_node_fs.default.writeFileSync(target, contents);
124
- task.title = `Successfully wrote file \`./${import_path.default.relative(base, target)}\``;
125
- };
126
- const writeFilesTask = (files, options) => {
127
- const { base } = (0, import_paths.getPaths)();
128
- return new import_listr2.Listr(
129
- Object.keys(files).map((file) => {
130
- const contents = files[file];
131
- return {
132
- title: `...waiting to write file \`./${import_path.default.relative(base, file)}\`...`,
133
- task: (_ctx, task) => {
134
- return writeFile(file, contents, options, task);
135
- }
136
- };
137
- })
138
- );
139
- };
140
- // Annotate the CommonJS export names for ESM import in node:
141
- 0 && (module.exports = {
142
- getPrettierOptions,
143
- prettify,
144
- transformTSToJS,
145
- writeFile,
146
- writeFilesTask
147
- });
@@ -1,17 +0,0 @@
1
- export declare const addWebPackages: (webPackages: string[]) => {
2
- title: string;
3
- task: () => Promise<void>;
4
- };
5
- export declare const addApiPackages: (apiPackages: string[]) => {
6
- title: string;
7
- task: () => Promise<void>;
8
- };
9
- export declare const addRootPackages: (packages: string[], devDependency?: boolean) => {
10
- title: string;
11
- task: () => Promise<void>;
12
- };
13
- export declare const installPackages: {
14
- title: string;
15
- task: () => Promise<void>;
16
- };
17
- //# sourceMappingURL=installHelpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"installHelpers.d.ts","sourceRoot":"","sources":["../../../src/lib/installHelpers.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,cAAc,GAAI,aAAa,MAAM,EAAE;;;CAMlD,CAAA;AAEF,eAAO,MAAM,cAAc,GAAI,aAAa,MAAM,EAAE;;;CAMlD,CAAA;AAEF,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,EAAE,EAAE,uBAAqB;;;CAQxE,CAAA;AAED,eAAO,MAAM,eAAe;;;CAM3B,CAAA"}
@@ -1,65 +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
- var installHelpers_exports = {};
20
- __export(installHelpers_exports, {
21
- addApiPackages: () => addApiPackages,
22
- addRootPackages: () => addRootPackages,
23
- addWebPackages: () => addWebPackages,
24
- installPackages: () => installPackages
25
- });
26
- module.exports = __toCommonJS(installHelpers_exports);
27
- var import_packages = require("../packageManager/packages.js");
28
- var import_paths = require("./paths.js");
29
- const addWebPackages = (webPackages) => ({
30
- title: `Adding required web packages...`,
31
- task: async () => {
32
- const cwd = (0, import_paths.getPaths)().web.base;
33
- await (0, import_packages.addWorkspacePackages)("web", webPackages, { cwd });
34
- }
35
- });
36
- const addApiPackages = (apiPackages) => ({
37
- title: "Adding required api packages...",
38
- task: async () => {
39
- const cwd = (0, import_paths.getPaths)().api.base;
40
- await (0, import_packages.addWorkspacePackages)("api", apiPackages, { cwd });
41
- }
42
- });
43
- const addRootPackages = (packages, devDependency = false) => {
44
- return {
45
- title: "Installing packages...",
46
- task: async () => {
47
- const cwd = (0, import_paths.getPaths)().base;
48
- await (0, import_packages.addRootPackages)(packages, { cwd, dev: devDependency });
49
- }
50
- };
51
- };
52
- const installPackages = {
53
- title: "Installing packages...",
54
- task: async () => {
55
- const cwd = (0, import_paths.getPaths)().base;
56
- await (0, import_packages.installPackages)({ cwd });
57
- }
58
- };
59
- // Annotate the CommonJS export names for ESM import in node:
60
- 0 && (module.exports = {
61
- addApiPackages,
62
- addRootPackages,
63
- addWebPackages,
64
- installPackages
65
- });
@@ -1,5 +0,0 @@
1
- export declare function loadEnvFiles(): void;
2
- export declare function loadDefaultEnvFiles(cwd: string): void;
3
- export declare function loadNodeEnvDerivedEnvFile(cwd: string): void;
4
- export declare function loadUserSpecifiedEnvFiles(cwd: string, loadEnvFiles: string[]): void;
5
- //# sourceMappingURL=loadEnvFiles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loadEnvFiles.d.ts","sourceRoot":"","sources":["../../../src/lib/loadEnvFiles.ts"],"names":[],"mappings":"AAUA,wBAAgB,YAAY,SAsB3B;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,QAM9C;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,QAcpD;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAW5E"}
@@ -1,99 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var loadEnvFiles_exports = {};
30
- __export(loadEnvFiles_exports, {
31
- loadDefaultEnvFiles: () => loadDefaultEnvFiles,
32
- loadEnvFiles: () => loadEnvFiles,
33
- loadNodeEnvDerivedEnvFile: () => loadNodeEnvDerivedEnvFile,
34
- loadUserSpecifiedEnvFiles: () => loadUserSpecifiedEnvFiles
35
- });
36
- module.exports = __toCommonJS(loadEnvFiles_exports);
37
- var import_node_fs = __toESM(require("node:fs"), 1);
38
- var import_node_path = __toESM(require("node:path"), 1);
39
- var import_dotenv = require("dotenv");
40
- var import_dotenv_defaults = require("dotenv-defaults");
41
- var import_helpers = require("yargs/helpers");
42
- var import_yargs_parser = __toESM(require("yargs-parser"), 1);
43
- var import_project_config = require("@cedarjs/project-config");
44
- function loadEnvFiles() {
45
- if (process.env.CEDAR_ENV_FILES_LOADED) {
46
- return;
47
- }
48
- const { base } = (0, import_project_config.getPaths)();
49
- loadDefaultEnvFiles(base);
50
- loadNodeEnvDerivedEnvFile(base);
51
- const { loadEnvFiles: loadEnvFiles2 } = (0, import_yargs_parser.default)((0, import_helpers.hideBin)(process.argv), {
52
- array: ["load-env-files"],
53
- default: {
54
- loadEnvFiles: []
55
- }
56
- });
57
- if (loadEnvFiles2.length > 0) {
58
- loadUserSpecifiedEnvFiles(base, loadEnvFiles2);
59
- }
60
- process.env.CEDAR_ENV_FILES_LOADED = "true";
61
- }
62
- function loadDefaultEnvFiles(cwd) {
63
- (0, import_dotenv_defaults.config)({
64
- path: import_node_path.default.join(cwd, ".env"),
65
- defaults: import_node_path.default.join(cwd, ".env.defaults"),
66
- multiline: true
67
- });
68
- }
69
- function loadNodeEnvDerivedEnvFile(cwd) {
70
- if (!process.env.NODE_ENV) {
71
- return;
72
- }
73
- const nodeEnvDerivedEnvFilePath = import_node_path.default.join(
74
- cwd,
75
- `.env.${process.env.NODE_ENV}`
76
- );
77
- if (!import_node_fs.default.existsSync(nodeEnvDerivedEnvFilePath)) {
78
- return;
79
- }
80
- (0, import_dotenv.config)({ path: nodeEnvDerivedEnvFilePath, override: true });
81
- }
82
- function loadUserSpecifiedEnvFiles(cwd, loadEnvFiles2) {
83
- for (const suffix of loadEnvFiles2) {
84
- const envPath = import_node_path.default.join(cwd, `.env.${suffix}`);
85
- if (!import_node_fs.default.existsSync(envPath)) {
86
- throw new Error(
87
- `Couldn't find an .env file at '${envPath}' as specified by '--load-env-files'`
88
- );
89
- }
90
- (0, import_dotenv.config)({ path: envPath, override: true });
91
- }
92
- }
93
- // Annotate the CommonJS export names for ESM import in node:
94
- 0 && (module.exports = {
95
- loadDefaultEnvFiles,
96
- loadEnvFiles,
97
- loadNodeEnvDerivedEnvFile,
98
- loadUserSpecifiedEnvFiles
99
- });
@@ -1,6 +0,0 @@
1
- /**
2
- * This wraps the core version of getPaths into something that catches the exception
3
- * and displays a helpful error message.
4
- */
5
- export declare function getPaths(): import("@cedarjs/project-config").Paths;
6
- //# sourceMappingURL=paths.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/lib/paths.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,wBAAgB,QAAQ,4CAUvB"}
@@ -1,42 +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
- var paths_exports = {};
20
- __export(paths_exports, {
21
- getPaths: () => getPaths
22
- });
23
- module.exports = __toCommonJS(paths_exports);
24
- var import_project_config = require("@cedarjs/project-config");
25
- var import_colors = require("./colors.js");
26
- function isErrorWithMessage(e) {
27
- return !!e.message;
28
- }
29
- function getPaths() {
30
- try {
31
- return (0, import_project_config.getPaths)();
32
- } catch (e) {
33
- if (isErrorWithMessage(e)) {
34
- console.error(import_colors.colors.error(e.message));
35
- }
36
- process.exit(1);
37
- }
38
- }
39
- // Annotate the CommonJS export names for ESM import in node:
40
- 0 && (module.exports = {
41
- getPaths
42
- });
@@ -1,44 +0,0 @@
1
- import type { Config } from '@cedarjs/project-config';
2
- export declare const getGraphqlPath: () => string | null;
3
- export declare const graphFunctionDoesExist: () => boolean | "" | null;
4
- export declare const isTypeScriptProject: () => boolean;
5
- export declare const getInstalledRedwoodVersion: () => any;
6
- /**
7
- * Updates the project's cedar.toml file to include the specified packages
8
- * plugin
9
- *
10
- * Uses toml parsing to determine if the plugin is already included in the file
11
- * and only adds it if it is not.
12
- *
13
- * Writes the updated config to the file system by appending strings, not
14
- * stringify-ing the toml.
15
- */
16
- export declare const updateTomlConfig: (packageName: string) => void;
17
- export declare const updateTomlConfigTask: (packageName: string) => {
18
- title: string;
19
- task: () => void;
20
- };
21
- export declare const addEnvVarTask: (name: string, value: string, comment: string) => {
22
- title: string;
23
- task: () => void;
24
- };
25
- export declare const addEnvVar: (name: string, value: string, comment: string) => string | void;
26
- /**
27
- * This sets the `CEDAR_CWD` env var to the redwood project directory. This is typically required for internal
28
- * redwood packages to work correctly. For example, `@cedarjs/project-config` uses this when reading config
29
- * or paths.
30
- *
31
- * @param cwd Explicitly set the redwood cwd. If not set, we'll try to determine it automatically. You likely
32
- * only want to set this based on some specific input, like a CLI flag.
33
- */
34
- export declare function setRedwoodCWD(cwd?: string): void;
35
- /**
36
- * Create or update the given setting, in the given section, with the given value.
37
- *
38
- * If the section already exists it adds the new setting last
39
- * If the section, and the setting, already exists, the setting is updated
40
- * If the section does not exist it is created at the end of the file and the setting is added
41
- * If the setting exists in the section, but is commented out, it will be uncommented and updated
42
- */
43
- export declare function setTomlSetting(section: keyof Config, setting: string, value: string | boolean | number): void;
44
- //# sourceMappingURL=project.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/lib/project.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAWrD,eAAO,MAAM,cAAc,qBAE1B,CAAA;AAED,eAAO,MAAM,sBAAsB,2BAGlC,CAAA;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA;AAED,eAAO,MAAM,0BAA0B,WAQtC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,SAkDnD,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,aAAa,MAAM;;;CAOvD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM;;;CAOzE,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM,kBAqCrE,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,QAmCzC;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,QA0HjC"}