@cedarjs/internal 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 (125) hide show
  1. package/package.json +23 -80
  2. package/dist/cjs/ast.d.ts +0 -27
  3. package/dist/cjs/ast.d.ts.map +0 -1
  4. package/dist/cjs/ast.js +0 -223
  5. package/dist/cjs/build/api-graphql-transforms.d.ts +0 -34
  6. package/dist/cjs/build/api-graphql-transforms.d.ts.map +0 -1
  7. package/dist/cjs/build/api-graphql-transforms.js +0 -150
  8. package/dist/cjs/build/api.d.ts +0 -9
  9. package/dist/cjs/build/api.d.ts.map +0 -1
  10. package/dist/cjs/build/api.js +0 -407
  11. package/dist/cjs/build/auto-import.d.ts +0 -10
  12. package/dist/cjs/build/auto-import.d.ts.map +0 -1
  13. package/dist/cjs/build/auto-import.js +0 -144
  14. package/dist/cjs/build/directory-named-import.d.ts +0 -2
  15. package/dist/cjs/build/directory-named-import.d.ts.map +0 -1
  16. package/dist/cjs/build/directory-named-import.js +0 -60
  17. package/dist/cjs/build/esbuild-plugin-api-graphql.d.ts +0 -6
  18. package/dist/cjs/build/esbuild-plugin-api-graphql.d.ts.map +0 -1
  19. package/dist/cjs/build/esbuild-plugin-api-graphql.js +0 -107
  20. package/dist/cjs/build/esbuild-plugin-cedar-otel-wrapping.d.ts +0 -13
  21. package/dist/cjs/build/esbuild-plugin-cedar-otel-wrapping.d.ts.map +0 -1
  22. package/dist/cjs/build/esbuild-plugin-cedar-otel-wrapping.js +0 -214
  23. package/dist/cjs/build/esbuild-plugin-handler-als-wrapping.d.ts +0 -4
  24. package/dist/cjs/build/esbuild-plugin-handler-als-wrapping.d.ts.map +0 -1
  25. package/dist/cjs/build/esbuild-plugin-handler-als-wrapping.js +0 -59
  26. package/dist/cjs/build/esm-extensions.d.ts +0 -33
  27. package/dist/cjs/build/esm-extensions.d.ts.map +0 -1
  28. package/dist/cjs/build/esm-extensions.js +0 -71
  29. package/dist/cjs/build/import-dir.d.ts +0 -22
  30. package/dist/cjs/build/import-dir.d.ts.map +0 -1
  31. package/dist/cjs/build/import-dir.js +0 -88
  32. package/dist/cjs/build/job-path-injector.d.ts +0 -15
  33. package/dist/cjs/build/job-path-injector.d.ts.map +0 -1
  34. package/dist/cjs/build/job-path-injector.js +0 -103
  35. package/dist/cjs/build/src-alias.d.ts +0 -14
  36. package/dist/cjs/build/src-alias.d.ts.map +0 -1
  37. package/dist/cjs/build/src-alias.js +0 -51
  38. package/dist/cjs/build/tsconfig-paths.d.ts +0 -2
  39. package/dist/cjs/build/tsconfig-paths.d.ts.map +0 -1
  40. package/dist/cjs/build/tsconfig-paths.js +0 -106
  41. package/dist/cjs/cliLogger.d.ts +0 -11
  42. package/dist/cjs/cliLogger.d.ts.map +0 -1
  43. package/dist/cjs/cliLogger.js +0 -36
  44. package/dist/cjs/dev.d.ts +0 -2
  45. package/dist/cjs/dev.d.ts.map +0 -1
  46. package/dist/cjs/dev.js +0 -41
  47. package/dist/cjs/files.d.ts +0 -56
  48. package/dist/cjs/files.d.ts.map +0 -1
  49. package/dist/cjs/files.js +0 -230
  50. package/dist/cjs/generate/clientPreset.d.ts +0 -17
  51. package/dist/cjs/generate/clientPreset.d.ts.map +0 -1
  52. package/dist/cjs/generate/clientPreset.js +0 -101
  53. package/dist/cjs/generate/generate.d.ts +0 -10
  54. package/dist/cjs/generate/generate.d.ts.map +0 -1
  55. package/dist/cjs/generate/generate.js +0 -97
  56. package/dist/cjs/generate/gqlormSchema.d.ts +0 -113
  57. package/dist/cjs/generate/gqlormSchema.d.ts.map +0 -1
  58. package/dist/cjs/generate/gqlormSchema.js +0 -1061
  59. package/dist/cjs/generate/graphqlCodeGen.d.ts +0 -16
  60. package/dist/cjs/generate/graphqlCodeGen.d.ts.map +0 -1
  61. package/dist/cjs/generate/graphqlCodeGen.js +0 -380
  62. package/dist/cjs/generate/graphqlSchema.d.ts +0 -8
  63. package/dist/cjs/generate/graphqlSchema.d.ts.map +0 -1
  64. package/dist/cjs/generate/graphqlSchema.js +0 -157
  65. package/dist/cjs/generate/plugins/rw-typescript-resolvers/index.d.ts +0 -7
  66. package/dist/cjs/generate/plugins/rw-typescript-resolvers/index.d.ts.map +0 -1
  67. package/dist/cjs/generate/plugins/rw-typescript-resolvers/index.js +0 -65
  68. package/dist/cjs/generate/plugins/rw-typescript-resolvers/visitor.d.ts +0 -10
  69. package/dist/cjs/generate/plugins/rw-typescript-resolvers/visitor.d.ts.map +0 -1
  70. package/dist/cjs/generate/plugins/rw-typescript-resolvers/visitor.js +0 -92
  71. package/dist/cjs/generate/possibleTypes.d.ts +0 -36
  72. package/dist/cjs/generate/possibleTypes.d.ts.map +0 -1
  73. package/dist/cjs/generate/possibleTypes.js +0 -106
  74. package/dist/cjs/generate/templates/all-currentUser.d.ts.template +0 -30
  75. package/dist/cjs/generate/templates/all-gqlorm.d.ts.template +0 -7
  76. package/dist/cjs/generate/templates/api-globImports.d.ts.template +0 -9
  77. package/dist/cjs/generate/templates/api-globalContext.d.ts.template +0 -7
  78. package/dist/cjs/generate/templates/api-scenarios.d.ts.template +0 -10
  79. package/dist/cjs/generate/templates/api-test-globals.d.ts.template +0 -5
  80. package/dist/cjs/generate/templates/mirror-cell-fragment.d.ts.template +0 -18
  81. package/dist/cjs/generate/templates/mirror-cell.d.ts.template +0 -13
  82. package/dist/cjs/generate/templates/mirror-directoryNamedModule.d.ts.template +0 -5
  83. package/dist/cjs/generate/templates/web-routerRoutes.d.ts.template +0 -20
  84. package/dist/cjs/generate/templates/web-routesPages.d.ts.template +0 -13
  85. package/dist/cjs/generate/templates/web-test-globals.d.ts.template +0 -7
  86. package/dist/cjs/generate/templates.d.ts +0 -6
  87. package/dist/cjs/generate/templates.d.ts.map +0 -1
  88. package/dist/cjs/generate/templates.js +0 -68
  89. package/dist/cjs/generate/trustedDocuments.d.ts +0 -3
  90. package/dist/cjs/generate/trustedDocuments.d.ts.map +0 -1
  91. package/dist/cjs/generate/trustedDocuments.js +0 -95
  92. package/dist/cjs/generate/typeDefinitions.d.ts +0 -31
  93. package/dist/cjs/generate/typeDefinitions.d.ts.map +0 -1
  94. package/dist/cjs/generate/typeDefinitions.js +0 -381
  95. package/dist/cjs/generate/types.d.ts +0 -6
  96. package/dist/cjs/generate/types.d.ts.map +0 -1
  97. package/dist/cjs/generate/types.js +0 -16
  98. package/dist/cjs/generate/watch.d.ts +0 -3
  99. package/dist/cjs/generate/watch.d.ts.map +0 -1
  100. package/dist/cjs/generate/watch.js +0 -132
  101. package/dist/cjs/gql.d.ts +0 -34
  102. package/dist/cjs/gql.d.ts.map +0 -1
  103. package/dist/cjs/gql.js +0 -134
  104. package/dist/cjs/index.d.ts +0 -11
  105. package/dist/cjs/index.d.ts.map +0 -1
  106. package/dist/cjs/index.js +0 -49
  107. package/dist/cjs/jsx.d.ts +0 -16
  108. package/dist/cjs/jsx.d.ts.map +0 -1
  109. package/dist/cjs/jsx.js +0 -101
  110. package/dist/cjs/jsxAttributeValue.d.ts +0 -2
  111. package/dist/cjs/jsxAttributeValue.d.ts.map +0 -1
  112. package/dist/cjs/jsxAttributeValue.js +0 -129
  113. package/dist/cjs/package.json +0 -1
  114. package/dist/cjs/project.d.ts +0 -8
  115. package/dist/cjs/project.d.ts.map +0 -1
  116. package/dist/cjs/project.js +0 -82
  117. package/dist/cjs/routes.d.ts +0 -42
  118. package/dist/cjs/routes.d.ts.map +0 -1
  119. package/dist/cjs/routes.js +0 -111
  120. package/dist/cjs/ts2js.d.ts +0 -40
  121. package/dist/cjs/ts2js.d.ts.map +0 -1
  122. package/dist/cjs/ts2js.js +0 -159
  123. package/dist/cjs/validateSchema.d.ts +0 -14
  124. package/dist/cjs/validateSchema.d.ts.map +0 -1
  125. package/dist/cjs/validateSchema.js +0 -195
@@ -1,103 +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 job_path_injector_exports = {};
30
- __export(job_path_injector_exports, {
31
- applyJobPathInjector: () => applyJobPathInjector
32
- });
33
- module.exports = __toCommonJS(job_path_injector_exports);
34
- var import_node_path = __toESM(require("node:path"), 1);
35
- var import_oxc_parser = require("oxc-parser");
36
- function applyJobPathInjector(code, filePath, jobsDir) {
37
- if (!code.includes("createJob")) {
38
- return null;
39
- }
40
- let program;
41
- try {
42
- program = (0, import_oxc_parser.parseSync)(filePath, code, { sourceType: "module" }).program;
43
- } catch (error) {
44
- console.warn("Failed to parse file:", filePath);
45
- console.warn(error);
46
- return null;
47
- }
48
- const importPath = import_node_path.default.relative(jobsDir, filePath);
49
- const importPathWithoutExtension = importPath.replace(/\.[^/.]+$/, "");
50
- const insertions = [];
51
- for (const node of program.body) {
52
- if (node.type !== "ExportNamedDeclaration") {
53
- continue;
54
- }
55
- const decl = node.declaration;
56
- if (decl?.type !== "VariableDeclaration") {
57
- continue;
58
- }
59
- for (const declarator of decl.declarations) {
60
- if (declarator.id.type !== "Identifier") {
61
- continue;
62
- }
63
- const init = declarator.init;
64
- if (init?.type !== "CallExpression") {
65
- continue;
66
- }
67
- const callee = init.callee;
68
- if (callee.type !== "MemberExpression" || callee.computed || callee.property.type !== "Identifier" || callee.property.name !== "createJob") {
69
- continue;
70
- }
71
- const configArg = init.arguments[0];
72
- if (configArg?.type !== "ObjectExpression") {
73
- continue;
74
- }
75
- const pathProperty = `path: ${JSON.stringify(importPathWithoutExtension)}`;
76
- const nameProperty = `name: ${JSON.stringify(declarator.id.name)}`;
77
- const lastProperty = configArg.properties.at(-1);
78
- if (lastProperty) {
79
- insertions.push({
80
- pos: lastProperty.end,
81
- text: `, ${pathProperty}, ${nameProperty}`
82
- });
83
- } else {
84
- insertions.push({
85
- pos: configArg.start + 1,
86
- text: `${pathProperty}, ${nameProperty}`
87
- });
88
- }
89
- }
90
- }
91
- if (insertions.length === 0) {
92
- return null;
93
- }
94
- let result = code;
95
- for (const { pos, text } of insertions.sort((a, b) => b.pos - a.pos)) {
96
- result = result.slice(0, pos) + text + result.slice(pos);
97
- }
98
- return result;
99
- }
100
- // Annotate the CommonJS export names for ESM import in node:
101
- 0 && (module.exports = {
102
- applyJobPathInjector
103
- });
@@ -1,14 +0,0 @@
1
- /**
2
- * Rewrites `src/` bare specifiers in source code to relative paths, so that the
3
- * esbuild API build (with `bundle: false`) produces output files with
4
- * resolvable import paths at runtime.
5
- *
6
- * This replaces the `babel-plugin-module-resolver` `src: './src'` alias for the
7
- * esbuild build paths. It is a plain function called inline from the existing
8
- * esbuild `onLoad` handlers — not an esbuild plugin itself.
9
- *
10
- * For a file at `api/src/functions/graphql.ts` importing `src/lib/db`, this
11
- * rewrites it to `../lib/db`.
12
- */
13
- export declare function applySrcAlias(code: string, fromDirRelativeToApiSrc: string): string;
14
- //# sourceMappingURL=src-alias.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"src-alias.d.ts","sourceRoot":"","sources":["../../../src/build/src-alias.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,uBAAuB,EAAE,MAAM,GAC9B,MAAM,CAWR"}
@@ -1,51 +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 src_alias_exports = {};
30
- __export(src_alias_exports, {
31
- applySrcAlias: () => applySrcAlias
32
- });
33
- module.exports = __toCommonJS(src_alias_exports);
34
- var import_node_path = __toESM(require("node:path"), 1);
35
- var import_project_config = require("@cedarjs/project-config");
36
- function applySrcAlias(code, fromDirRelativeToApiSrc) {
37
- return code.replace(
38
- /from\s+['"]src\/(.+?)['"]/g,
39
- (_match, rest) => {
40
- const target = import_node_path.default.relative(fromDirRelativeToApiSrc, rest);
41
- const formatted = (0, import_project_config.importStatementPath)(
42
- target.startsWith(".") ? target : "./" + target
43
- );
44
- return `from '${formatted}'`;
45
- }
46
- );
47
- }
48
- // Annotate the CommonJS export names for ESM import in node:
49
- 0 && (module.exports = {
50
- applySrcAlias
51
- });
@@ -1,2 +0,0 @@
1
- export declare function applyTsconfigPaths(code: string, filePath: string, cwd: string): string;
2
- //# sourceMappingURL=tsconfig-paths.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tsconfig-paths.d.ts","sourceRoot":"","sources":["../../../src/build/tsconfig-paths.ts"],"names":[],"mappings":"AA8FA,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAyCR"}
@@ -1,106 +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 tsconfig_paths_exports = {};
30
- __export(tsconfig_paths_exports, {
31
- applyTsconfigPaths: () => applyTsconfigPaths
32
- });
33
- module.exports = __toCommonJS(tsconfig_paths_exports);
34
- var import_node_path = __toESM(require("node:path"), 1);
35
- var import_tsconfig_paths = require("tsconfig-paths");
36
- var import_project_config = require("@cedarjs/project-config");
37
- const EXCLUDED_PATH_KEY_RE = /src\/|\$api\/\*|types\/\*|@cedarjs\/.*/;
38
- const RESOLVE_EXTENSIONS = [
39
- ".js",
40
- ".tsx",
41
- ".ts",
42
- ".jsx",
43
- ".mjs",
44
- ".mts",
45
- ".cjs"
46
- ];
47
- const BARE_IMPORT_RE = /\bfrom\s+(['"])([^'"./][^'"]*)\1/g;
48
- function getMatchPath(cwd) {
49
- const config = (0, import_tsconfig_paths.loadConfig)(cwd);
50
- if (config.resultType === "failed") {
51
- return null;
52
- }
53
- const paths = Object.fromEntries(
54
- Object.entries(config.paths).filter(
55
- ([key]) => !EXCLUDED_PATH_KEY_RE.test(key)
56
- )
57
- );
58
- if (Object.keys(paths).length === 0) {
59
- return null;
60
- }
61
- return (0, import_tsconfig_paths.createMatchPath)(config.absoluteBaseUrl, paths);
62
- }
63
- function resolveToFile(candidate) {
64
- if ((0, import_project_config.resolveFile)(candidate)) {
65
- return candidate;
66
- }
67
- if ((0, import_project_config.resolveFile)(import_node_path.default.join(candidate, "index"))) {
68
- return import_node_path.default.join(candidate, "index");
69
- }
70
- const basename = import_node_path.default.basename(candidate);
71
- if ((0, import_project_config.resolveFile)(import_node_path.default.join(candidate, basename))) {
72
- return import_node_path.default.join(candidate, basename);
73
- }
74
- return null;
75
- }
76
- function applyTsconfigPaths(code, filePath, cwd) {
77
- const matchPath = getMatchPath(cwd);
78
- if (!matchPath) {
79
- return code;
80
- }
81
- return code.replace(
82
- BARE_IMPORT_RE,
83
- (full, quote, importPath) => {
84
- const basename = importPath.split("/").pop();
85
- const rawMatch = matchPath(importPath, void 0, void 0, RESOLVE_EXTENSIONS) ?? (basename && matchPath(
86
- `${importPath}/${basename}`,
87
- void 0,
88
- void 0,
89
- RESOLVE_EXTENSIONS
90
- ));
91
- const resolved = rawMatch && resolveToFile(rawMatch);
92
- if (!resolved) {
93
- return full;
94
- }
95
- const relativePath = import_node_path.default.relative(import_node_path.default.dirname(filePath), resolved);
96
- const formatted = (0, import_project_config.importStatementPath)(
97
- relativePath.startsWith(".") ? relativePath : "./" + relativePath
98
- );
99
- return `from ${quote}${formatted}${quote}`;
100
- }
101
- );
102
- }
103
- // Annotate the CommonJS export names for ESM import in node:
104
- 0 && (module.exports = {
105
- applyTsconfigPaths
106
- });
@@ -1,11 +0,0 @@
1
- type CLog = (typeof console)['log'];
2
- /**
3
- * An alternative to createLogger which supports the same logging levels
4
- * but allows for full ANSI when printing to the console.
5
- */
6
- export declare const cliLogger: CLog & {
7
- trace: CLog;
8
- debug: CLog;
9
- };
10
- export {};
11
- //# sourceMappingURL=cliLogger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cliLogger.d.ts","sourceRoot":"","sources":["../../src/cliLogger.ts"],"names":[],"mappings":"AAIA,KAAK,IAAI,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,CAAC,CAAA;AAEnC;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,IAAI,GAAG;IAC7B,KAAK,EAAE,IAAI,CAAA;IACX,KAAK,EAAE,IAAI,CAAA;CAGZ,CAAA"}
@@ -1,36 +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 cliLogger_exports = {};
20
- __export(cliLogger_exports, {
21
- cliLogger: () => cliLogger
22
- });
23
- module.exports = __toCommonJS(cliLogger_exports);
24
- var import_logger = require("@cedarjs/api/logger");
25
- const logLevel = import_logger.defaultLoggerOptions.level;
26
- const cliLogger = function(...data) {
27
- console.log(...data);
28
- };
29
- cliLogger.trace = logLevel === "trace" ? console.log : () => {
30
- };
31
- cliLogger.debug = logLevel === "trace" || logLevel === "debug" ? console.log : () => {
32
- };
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {
35
- cliLogger
36
- });
package/dist/cjs/dev.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const shutdownPort: (port: number, method?: "tcp" | "udp") => Promise<void>;
2
- //# sourceMappingURL=dev.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/dev.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,SAAQ,KAAK,GAAG,KAAa,kBAEvE,CAAA"}
package/dist/cjs/dev.js DELETED
@@ -1,41 +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 dev_exports = {};
30
- __export(dev_exports, {
31
- shutdownPort: () => shutdownPort
32
- });
33
- module.exports = __toCommonJS(dev_exports);
34
- var import_kill_port = __toESM(require("kill-port"), 1);
35
- const shutdownPort = (port, method = "tcp") => {
36
- return (0, import_kill_port.default)(port, method);
37
- };
38
- // Annotate the CommonJS export names for ESM import in node:
39
- 0 && (module.exports = {
40
- shutdownPort
41
- });
@@ -1,56 +0,0 @@
1
- import { type Options as FastGlobOptions } from 'fast-glob';
2
- export declare const findCells: (cwd?: string) => string[];
3
- export declare const findPages: (cwd?: string) => string[];
4
- /**
5
- * This function finds all modules in the 'web' and 'api' directories excluding 'node_modules' and Cell files.
6
- * Cell files are also directory named modules but they have their special type mirror file, so they are ignored.
7
- *
8
- * @param {string} cwd - The directory path to start searching from. By default, it is the base path of the project.
9
- * @returns {Array} modules - An array of absolute paths for the found modules.
10
- *
11
- * @example
12
- * // Assuming the base directory of your project is '/Users/user/myproject'
13
- * findDirectoryNamedModules('/Users/user/myproject');
14
- * // This will return an array with the absolute paths of all matching files, e.g.:
15
- * // ['/Users/user/myproject/web/src/components/Author/Author.tsx', '/Users/user/myproject/web/src/pages/AboutPage/AboutPage.tsx']
16
- */
17
- export declare const findDirectoryNamedModules: (cwd?: string) => string[];
18
- export declare const findGraphQLSchemas: (cwd?: string) => string[];
19
- export declare const findApiFiles: (cwd?: string) => string[];
20
- export declare const findWebFiles: (cwd?: string) => string[];
21
- export declare const findApiServerFunctions: (cwd?: string) => string[];
22
- export declare const findApiDistFunctions: (params: {
23
- cwd: string;
24
- options?: FastGlobOptions;
25
- discoverFunctionsGlob?: string | string[];
26
- }) => string[];
27
- export declare const findRouteHooksSrc: (cwd?: string) => string[];
28
- export declare const isCellFile: (p: string) => boolean;
29
- export declare const findScripts: (cwd?: string) => string[];
30
- export declare const isPageFile: (p: string) => boolean;
31
- /**
32
- * This function checks if the given path belongs to a directory named module.
33
- * A directory named module is where the filename (without extension) is the same as the directory it is in.
34
- *
35
- * @param {string} p - The absolute path of the file.
36
- * @returns {boolean} - Returns true if the path belongs to a directory named module, false otherwise.
37
- *
38
- * @example
39
- * isDirectoryNamedModuleFile('/Users/user/myproject/web/src/components/Author/Author.tsx');
40
- * // Returns: true
41
- *
42
- * isDirectoryNamedModuleFile('/Users/user/myproject/web/src/components/Author/AuthorInfo.tsx');
43
- * // Returns: false
44
- */
45
- export declare const isDirectoryNamedModuleFile: (p: string) => boolean;
46
- export declare const isGraphQLSchemaFile: (p: string) => boolean;
47
- /**
48
- * The following patterns are supported for api functions:
49
- *
50
- * 1. a module at the top level: `/graphql.js`
51
- * 2. a module in a folder with a module of the same name: `/health/health.js`
52
- * 3. a module in a folder named index: `/x/index.js`
53
- */
54
- export declare const isApiFunction: (p: string, functionsPath: string) => boolean;
55
- export declare const isFileInsideFolder: (filePath: string, folderPath: string) => boolean;
56
- //# sourceMappingURL=files.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/files.ts"],"names":[],"mappings":"AAEA,OAAW,EAAE,KAAK,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAA;AAM/D,eAAO,MAAM,SAAS,GAAI,MAAK,MAA2B,aAOzD,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,MAAK,MAA6B,aAQ3D,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,GAAI,MAAK,MAAwB,aAUtE,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,MAAK,MAA+B,aAItE,CAAA;AASD,eAAO,MAAM,YAAY,GAAI,MAAK,MAA2B,aAO5D,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,MAAK,MAA2B,aAY5D,CAAA;AAED,eAAO,MAAM,sBAAsB,GACjC,MAAK,MAAiC,aAUvC,CAAA;AAKD,eAAO,MAAM,oBAAoB,GAAI,QAAQ;IAC3C,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,eAAe,CAAA;IACzB,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC1C,aAcA,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,MAAK,MAA2B,aAKjE,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,GAAG,MAAM,YA6BnC,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,MAAK,MAA2B,aAM3D,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,GAAG,MAAM,YAoBnC,CAAA;AACD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,0BAA0B,GAAI,GAAG,MAAM,YAGnD,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,GAAG,MAAM,YAQ5C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,GAAG,MAAM,EAAE,eAAe,MAAM,YAc7D,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,UAAU,MAAM,EAAE,YAAY,MAAM,YAYtE,CAAA"}