@cedarjs/internal 5.0.6 → 5.0.7-next.219
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/ast.d.ts +1 -0
- package/dist/ast.d.ts.map +1 -1
- package/dist/ast.js +21 -0
- package/dist/build/api-graphql-transforms.d.ts +34 -0
- package/dist/build/api-graphql-transforms.d.ts.map +1 -0
- package/dist/build/api-graphql-transforms.js +129 -0
- package/dist/build/api.d.ts +2 -0
- package/dist/build/api.d.ts.map +1 -1
- package/dist/build/api.js +202 -39
- package/dist/build/auto-import.d.ts +10 -0
- package/dist/build/auto-import.d.ts.map +1 -0
- package/dist/build/auto-import.js +120 -0
- package/dist/build/directory-named-import.d.ts +2 -0
- package/dist/build/directory-named-import.d.ts.map +1 -0
- package/dist/build/directory-named-import.js +26 -0
- package/dist/build/esbuild-plugin-api-graphql.d.ts +6 -0
- package/dist/build/esbuild-plugin-api-graphql.d.ts.map +1 -0
- package/dist/build/esbuild-plugin-api-graphql.js +80 -0
- package/dist/build/esbuild-plugin-cedar-otel-wrapping.d.ts +13 -0
- package/dist/build/esbuild-plugin-cedar-otel-wrapping.d.ts.map +1 -0
- package/dist/build/esbuild-plugin-cedar-otel-wrapping.js +180 -0
- package/dist/build/esbuild-plugin-handler-als-wrapping.d.ts +4 -0
- package/dist/build/esbuild-plugin-handler-als-wrapping.d.ts.map +1 -0
- package/dist/build/{esbuild-plugin-cedar-context-wrapping.js → esbuild-plugin-handler-als-wrapping.js} +12 -12
- package/dist/build/esm-extensions.d.ts +33 -0
- package/dist/build/esm-extensions.d.ts.map +1 -0
- package/dist/build/esm-extensions.js +37 -0
- package/dist/build/import-dir.d.ts +22 -0
- package/dist/build/import-dir.d.ts.map +1 -0
- package/dist/build/import-dir.js +54 -0
- package/dist/build/job-path-injector.d.ts +15 -0
- package/dist/build/job-path-injector.d.ts.map +1 -0
- package/dist/build/job-path-injector.js +69 -0
- package/dist/build/src-alias.d.ts +14 -0
- package/dist/build/src-alias.d.ts.map +1 -0
- package/dist/build/src-alias.js +17 -0
- package/dist/build/tsconfig-paths.d.ts +2 -0
- package/dist/build/tsconfig-paths.d.ts.map +1 -0
- package/dist/build/tsconfig-paths.js +72 -0
- package/dist/generate/clientPreset.d.ts.map +1 -1
- package/dist/generate/clientPreset.js +10 -3
- package/dist/generate/graphqlSchema.d.ts.map +1 -1
- package/dist/generate/templates/mirror-cell-fragment.d.ts.template +18 -0
- package/dist/generate/templates.d.ts.map +1 -1
- package/dist/generate/templates.js +1 -6
- package/dist/generate/typeDefinitions.d.ts.map +1 -1
- package/dist/generate/typeDefinitions.js +15 -1
- package/dist/gql.d.ts +20 -0
- package/dist/gql.d.ts.map +1 -1
- package/dist/gql.js +24 -0
- package/dist/jsx.d.ts.map +1 -1
- package/dist/routes.d.ts.map +1 -1
- package/package.json +52 -88
- package/dist/build/esbuild-plugin-cedar-context-wrapping.d.ts +0 -4
- package/dist/build/esbuild-plugin-cedar-context-wrapping.d.ts.map +0 -1
- package/dist/cjs/ast.d.ts +0 -26
- package/dist/cjs/ast.d.ts.map +0 -1
- package/dist/cjs/ast.js +0 -201
- package/dist/cjs/build/api.d.ts +0 -7
- package/dist/cjs/build/api.d.ts.map +0 -1
- package/dist/cjs/build/api.js +0 -251
- package/dist/cjs/build/esbuild-plugin-cedar-context-wrapping.d.ts +0 -4
- package/dist/cjs/build/esbuild-plugin-cedar-context-wrapping.d.ts.map +0 -1
- package/dist/cjs/build/esbuild-plugin-cedar-context-wrapping.js +0 -59
- package/dist/cjs/cliLogger.d.ts +0 -11
- package/dist/cjs/cliLogger.d.ts.map +0 -1
- package/dist/cjs/cliLogger.js +0 -36
- package/dist/cjs/dev.d.ts +0 -2
- package/dist/cjs/dev.d.ts.map +0 -1
- package/dist/cjs/dev.js +0 -41
- package/dist/cjs/files.d.ts +0 -56
- package/dist/cjs/files.d.ts.map +0 -1
- package/dist/cjs/files.js +0 -230
- package/dist/cjs/generate/clientPreset.d.ts +0 -17
- package/dist/cjs/generate/clientPreset.d.ts.map +0 -1
- package/dist/cjs/generate/clientPreset.js +0 -84
- package/dist/cjs/generate/generate.d.ts +0 -10
- package/dist/cjs/generate/generate.d.ts.map +0 -1
- package/dist/cjs/generate/generate.js +0 -97
- package/dist/cjs/generate/gqlormSchema.d.ts +0 -113
- package/dist/cjs/generate/gqlormSchema.d.ts.map +0 -1
- package/dist/cjs/generate/gqlormSchema.js +0 -1061
- package/dist/cjs/generate/graphqlCodeGen.d.ts +0 -16
- package/dist/cjs/generate/graphqlCodeGen.d.ts.map +0 -1
- package/dist/cjs/generate/graphqlCodeGen.js +0 -380
- package/dist/cjs/generate/graphqlSchema.d.ts +0 -8
- package/dist/cjs/generate/graphqlSchema.d.ts.map +0 -1
- package/dist/cjs/generate/graphqlSchema.js +0 -157
- package/dist/cjs/generate/plugins/rw-typescript-resolvers/index.d.ts +0 -7
- package/dist/cjs/generate/plugins/rw-typescript-resolvers/index.d.ts.map +0 -1
- package/dist/cjs/generate/plugins/rw-typescript-resolvers/index.js +0 -65
- package/dist/cjs/generate/plugins/rw-typescript-resolvers/visitor.d.ts +0 -10
- package/dist/cjs/generate/plugins/rw-typescript-resolvers/visitor.d.ts.map +0 -1
- package/dist/cjs/generate/plugins/rw-typescript-resolvers/visitor.js +0 -92
- package/dist/cjs/generate/possibleTypes.d.ts +0 -36
- package/dist/cjs/generate/possibleTypes.d.ts.map +0 -1
- package/dist/cjs/generate/possibleTypes.js +0 -106
- package/dist/cjs/generate/templates/all-currentUser.d.ts.template +0 -30
- package/dist/cjs/generate/templates/all-gqlorm.d.ts.template +0 -7
- package/dist/cjs/generate/templates/api-globImports.d.ts.template +0 -9
- package/dist/cjs/generate/templates/api-globalContext.d.ts.template +0 -7
- package/dist/cjs/generate/templates/api-scenarios.d.ts.template +0 -10
- package/dist/cjs/generate/templates/api-test-globals.d.ts.template +0 -5
- package/dist/cjs/generate/templates/mirror-cell.d.ts.template +0 -13
- package/dist/cjs/generate/templates/mirror-directoryNamedModule.d.ts.template +0 -5
- package/dist/cjs/generate/templates/web-routerRoutes.d.ts.template +0 -20
- package/dist/cjs/generate/templates/web-routesPages.d.ts.template +0 -13
- package/dist/cjs/generate/templates/web-test-globals.d.ts.template +0 -7
- package/dist/cjs/generate/templates.d.ts +0 -6
- package/dist/cjs/generate/templates.d.ts.map +0 -1
- package/dist/cjs/generate/templates.js +0 -68
- package/dist/cjs/generate/trustedDocuments.d.ts +0 -3
- package/dist/cjs/generate/trustedDocuments.d.ts.map +0 -1
- package/dist/cjs/generate/trustedDocuments.js +0 -95
- package/dist/cjs/generate/typeDefinitions.d.ts +0 -31
- package/dist/cjs/generate/typeDefinitions.d.ts.map +0 -1
- package/dist/cjs/generate/typeDefinitions.js +0 -372
- package/dist/cjs/generate/types.d.ts +0 -6
- package/dist/cjs/generate/types.d.ts.map +0 -1
- package/dist/cjs/generate/types.js +0 -16
- package/dist/cjs/generate/watch.d.ts +0 -3
- package/dist/cjs/generate/watch.d.ts.map +0 -1
- package/dist/cjs/generate/watch.js +0 -132
- package/dist/cjs/gql.d.ts +0 -14
- package/dist/cjs/gql.d.ts.map +0 -1
- package/dist/cjs/gql.js +0 -108
- package/dist/cjs/index.d.ts +0 -11
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -49
- package/dist/cjs/jsx.d.ts +0 -16
- package/dist/cjs/jsx.d.ts.map +0 -1
- package/dist/cjs/jsx.js +0 -101
- package/dist/cjs/jsxAttributeValue.d.ts +0 -2
- package/dist/cjs/jsxAttributeValue.d.ts.map +0 -1
- package/dist/cjs/jsxAttributeValue.js +0 -129
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/project.d.ts +0 -8
- package/dist/cjs/project.d.ts.map +0 -1
- package/dist/cjs/project.js +0 -82
- package/dist/cjs/routes.d.ts +0 -42
- package/dist/cjs/routes.d.ts.map +0 -1
- package/dist/cjs/routes.js +0 -111
- package/dist/cjs/ts2js.d.ts +0 -40
- package/dist/cjs/ts2js.d.ts.map +0 -1
- package/dist/cjs/ts2js.js +0 -159
- package/dist/cjs/validateSchema.d.ts +0 -14
- package/dist/cjs/validateSchema.d.ts.map +0 -1
- package/dist/cjs/validateSchema.js +0 -195
package/dist/cjs/ast.js
DELETED
|
@@ -1,201 +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 ast_exports = {};
|
|
30
|
-
__export(ast_exports, {
|
|
31
|
-
fileToAst: () => fileToAst,
|
|
32
|
-
getCellGqlQuery: () => getCellGqlQuery,
|
|
33
|
-
getDefaultExportLocation: () => getDefaultExportLocation,
|
|
34
|
-
getGqlQueries: () => getGqlQueries,
|
|
35
|
-
getNamedExports: () => getNamedExports,
|
|
36
|
-
hasDefaultExport: () => hasDefaultExport
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(ast_exports);
|
|
39
|
-
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
40
|
-
var import_path = __toESM(require("path"), 1);
|
|
41
|
-
var import_core = require("@babel/core");
|
|
42
|
-
var import_parser = require("@babel/parser");
|
|
43
|
-
var import_traverse = __toESM(require("@babel/traverse"), 1);
|
|
44
|
-
var import_ansis = __toESM(require("ansis"), 1);
|
|
45
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
46
|
-
var import_files = require("./files.js");
|
|
47
|
-
const traverse = import_traverse.default.default || import_traverse.default;
|
|
48
|
-
const fileToAst = (filePath) => {
|
|
49
|
-
const code = import_node_fs.default.readFileSync(filePath, "utf-8");
|
|
50
|
-
const isJsxFile = import_path.default.extname(filePath).match(/[jt]sx$/) || (0, import_files.isFileInsideFolder)(filePath, (0, import_project_config.getPaths)().web.base);
|
|
51
|
-
const plugins = [
|
|
52
|
-
"typescript",
|
|
53
|
-
"nullishCoalescingOperator",
|
|
54
|
-
"objectRestSpread",
|
|
55
|
-
isJsxFile && "jsx"
|
|
56
|
-
].filter(Boolean);
|
|
57
|
-
try {
|
|
58
|
-
return (0, import_parser.parse)(code, {
|
|
59
|
-
sourceType: "module",
|
|
60
|
-
plugins
|
|
61
|
-
});
|
|
62
|
-
} catch (e) {
|
|
63
|
-
console.error(import_ansis.default.red(`Error parsing: ${filePath}`));
|
|
64
|
-
console.error(e);
|
|
65
|
-
throw new Error(e?.message);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
const getNamedExports = (ast) => {
|
|
69
|
-
const namedExports = [];
|
|
70
|
-
traverse(ast, {
|
|
71
|
-
ExportNamedDeclaration(path2) {
|
|
72
|
-
const specifiers = path2.node?.specifiers;
|
|
73
|
-
if (specifiers.length) {
|
|
74
|
-
for (const s of specifiers) {
|
|
75
|
-
const id = s.exported;
|
|
76
|
-
namedExports.push({
|
|
77
|
-
name: id.name,
|
|
78
|
-
type: "re-export",
|
|
79
|
-
location: {
|
|
80
|
-
line: id.loc?.start.line ?? 1,
|
|
81
|
-
column: id.loc?.start.column ?? 0
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const declaration = path2.node.declaration;
|
|
88
|
-
if (!declaration) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (declaration.type === "VariableDeclaration") {
|
|
92
|
-
const id = declaration.declarations[0].id;
|
|
93
|
-
namedExports.push({
|
|
94
|
-
name: id.name,
|
|
95
|
-
type: "variable",
|
|
96
|
-
location: {
|
|
97
|
-
line: id.loc?.start.line ?? 1,
|
|
98
|
-
column: id.loc?.start.column ?? 0
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
} else if (declaration.type === "FunctionDeclaration") {
|
|
102
|
-
namedExports.push({
|
|
103
|
-
name: declaration?.id?.name,
|
|
104
|
-
type: "function",
|
|
105
|
-
location: {
|
|
106
|
-
line: declaration?.id?.loc?.start.line ?? 1,
|
|
107
|
-
column: declaration?.id?.loc?.start.column ?? 0
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
} else if (declaration.type === "ClassDeclaration") {
|
|
111
|
-
namedExports.push({
|
|
112
|
-
name: declaration?.id?.name,
|
|
113
|
-
type: "class",
|
|
114
|
-
location: {
|
|
115
|
-
line: declaration?.id?.loc?.start.line ?? 1,
|
|
116
|
-
column: declaration?.id?.loc?.start.column ?? 0
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
return namedExports;
|
|
123
|
-
};
|
|
124
|
-
const getGqlQueries = (ast) => {
|
|
125
|
-
const gqlQueries = [];
|
|
126
|
-
traverse(ast, {
|
|
127
|
-
TaggedTemplateExpression(path2) {
|
|
128
|
-
const gqlTag = path2.node.tag;
|
|
129
|
-
if (gqlTag.type === "Identifier" && gqlTag.name === "gql") {
|
|
130
|
-
gqlQueries.push(path2.node.quasi.quasis[0].value.raw);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
return gqlQueries;
|
|
135
|
-
};
|
|
136
|
-
const getCellGqlQuery = (ast) => {
|
|
137
|
-
let cellQuery = void 0;
|
|
138
|
-
traverse(ast, {
|
|
139
|
-
ExportNamedDeclaration({ node }) {
|
|
140
|
-
if (node.exportKind === "value" && import_core.types.isVariableDeclaration(node.declaration)) {
|
|
141
|
-
const exportedQueryNode = node.declaration.declarations.find(
|
|
142
|
-
(d) => {
|
|
143
|
-
return import_core.types.isIdentifier(d.id) && d.id.name === "QUERY" && import_core.types.isTaggedTemplateExpression(d.init);
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
if (exportedQueryNode) {
|
|
147
|
-
const templateExpression = exportedQueryNode.init;
|
|
148
|
-
cellQuery = templateExpression.quasi.quasis[0].value.raw;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
return cellQuery;
|
|
155
|
-
};
|
|
156
|
-
const hasDefaultExport = (ast) => {
|
|
157
|
-
let exported = false;
|
|
158
|
-
traverse(ast, {
|
|
159
|
-
ExportDefaultDeclaration() {
|
|
160
|
-
exported = true;
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
return exported;
|
|
165
|
-
};
|
|
166
|
-
const getDefaultExportLocation = (ast) => {
|
|
167
|
-
let defaultExport;
|
|
168
|
-
traverse(ast, {
|
|
169
|
-
ExportDefaultDeclaration(path2) {
|
|
170
|
-
defaultExport = path2.node;
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
if (!defaultExport) {
|
|
174
|
-
return null;
|
|
175
|
-
}
|
|
176
|
-
if (import_core.types.isIdentifier(defaultExport.declaration) && import_core.types.isFile(ast)) {
|
|
177
|
-
const exportedName = defaultExport.declaration.name;
|
|
178
|
-
const declaration = ast.program.body.find((node) => {
|
|
179
|
-
return import_core.types.isVariableDeclaration(node) && node.declarations.find((d) => {
|
|
180
|
-
return import_core.types.isVariableDeclarator(d) && import_core.types.isIdentifier(d.id) && d.id.name === exportedName;
|
|
181
|
-
});
|
|
182
|
-
});
|
|
183
|
-
return {
|
|
184
|
-
line: declaration?.loc?.start.line ?? 1,
|
|
185
|
-
column: declaration?.loc?.start.column ?? 0
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
return {
|
|
189
|
-
line: defaultExport.loc?.start.line ?? 1,
|
|
190
|
-
column: defaultExport.loc?.start.column ?? 0
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
194
|
-
0 && (module.exports = {
|
|
195
|
-
fileToAst,
|
|
196
|
-
getCellGqlQuery,
|
|
197
|
-
getDefaultExportLocation,
|
|
198
|
-
getGqlQueries,
|
|
199
|
-
getNamedExports,
|
|
200
|
-
hasDefaultExport
|
|
201
|
-
});
|
package/dist/cjs/build/api.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { BuildOptions } from 'esbuild';
|
|
2
|
-
export declare const buildApi: () => Promise<import("esbuild").BuildResult<BuildOptions>>;
|
|
3
|
-
export declare const rebuildApi: () => Promise<import("esbuild").BuildResult<BuildOptions>>;
|
|
4
|
-
export declare const cleanApiBuild: () => Promise<void>;
|
|
5
|
-
export declare const buildApiWithVite: () => Promise<import("rollup").RollupOutput | import("rollup").RollupOutput[] | import("rollup").RollupWatcher>;
|
|
6
|
-
export declare function fixSourceMaps(distDir: string, srcDir: string): Promise<void>;
|
|
7
|
-
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/build/api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,YAAY,EAAe,MAAM,SAAS,CAAA;AAiBtE,eAAO,MAAM,QAAQ,4DAIpB,CAAA;AAED,eAAO,MAAM,UAAU,4DAStB,CAAA;AAED,eAAO,MAAM,aAAa,qBAGzB,CAAA;AA8FD,eAAO,MAAM,gBAAgB,iHAqD5B,CAAA;AAcD,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAoDf"}
|
package/dist/cjs/build/api.js
DELETED
|
@@ -1,251 +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 api_exports = {};
|
|
30
|
-
__export(api_exports, {
|
|
31
|
-
buildApi: () => buildApi,
|
|
32
|
-
buildApiWithVite: () => buildApiWithVite,
|
|
33
|
-
cleanApiBuild: () => cleanApiBuild,
|
|
34
|
-
fixSourceMaps: () => fixSourceMaps,
|
|
35
|
-
rebuildApi: () => rebuildApi
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(api_exports);
|
|
38
|
-
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
39
|
-
var import_node_path = __toESM(require("node:path"), 1);
|
|
40
|
-
var import_esbuild = require("esbuild");
|
|
41
|
-
var import_vite = require("vite");
|
|
42
|
-
var import_babel_config = require("@cedarjs/babel-config");
|
|
43
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
44
|
-
var import_files = require("../files.js");
|
|
45
|
-
var import_esbuild_plugin_cedar_context_wrapping = require("./esbuild-plugin-cedar-context-wrapping.js");
|
|
46
|
-
let BUILD_CTX = null;
|
|
47
|
-
const buildApi = async () => {
|
|
48
|
-
BUILD_CTX?.dispose();
|
|
49
|
-
BUILD_CTX = null;
|
|
50
|
-
return transpileApi((0, import_files.findApiFiles)());
|
|
51
|
-
};
|
|
52
|
-
const rebuildApi = async () => {
|
|
53
|
-
const apiFiles = (0, import_files.findApiFiles)();
|
|
54
|
-
if (!BUILD_CTX) {
|
|
55
|
-
BUILD_CTX = await (0, import_esbuild.context)(getEsbuildOptions(apiFiles));
|
|
56
|
-
}
|
|
57
|
-
const result = await BUILD_CTX.rebuild();
|
|
58
|
-
const cedarPaths = (0, import_project_config.getPaths)();
|
|
59
|
-
await fixSourceMaps(cedarPaths.api.dist, cedarPaths.api.src);
|
|
60
|
-
return result;
|
|
61
|
-
};
|
|
62
|
-
const cleanApiBuild = async () => {
|
|
63
|
-
const cedarPaths = (0, import_project_config.getPaths)();
|
|
64
|
-
return import_node_fs.default.promises.rm(cedarPaths.api.dist, { recursive: true, force: true });
|
|
65
|
-
};
|
|
66
|
-
const runCedarBabelTransformsPlugin = {
|
|
67
|
-
name: "cedar-esbuild-babel-transform",
|
|
68
|
-
setup(build2) {
|
|
69
|
-
const cedarConfig = (0, import_project_config.getConfig)();
|
|
70
|
-
build2.onLoad({ filter: /\.(js|ts|tsx|jsx)$/ }, async (args) => {
|
|
71
|
-
const fileContents = await import_node_fs.default.promises.readFile(args.path, "utf-8");
|
|
72
|
-
const transformedCode = await (0, import_babel_config.transformWithBabel)(
|
|
73
|
-
fileContents,
|
|
74
|
-
args.path,
|
|
75
|
-
(0, import_babel_config.getApiSideBabelPlugins)({
|
|
76
|
-
openTelemetry: cedarConfig.experimental.opentelemetry.enabled && cedarConfig.experimental.opentelemetry.wrapApi,
|
|
77
|
-
projectIsEsm: (0, import_project_config.projectSideIsEsm)("api")
|
|
78
|
-
})
|
|
79
|
-
);
|
|
80
|
-
if (transformedCode?.code) {
|
|
81
|
-
const functionsDir = (0, import_vite.normalizePath)(
|
|
82
|
-
import_node_path.default.join((0, import_project_config.getPaths)().api.src, "functions")
|
|
83
|
-
);
|
|
84
|
-
const code = (0, import_vite.normalizePath)(args.path).startsWith(functionsDir + "/") ? (0, import_esbuild_plugin_cedar_context_wrapping.applyContextWrapping)(transformedCode.code, {
|
|
85
|
-
projectIsEsm: (0, import_project_config.projectSideIsEsm)("api")
|
|
86
|
-
}) ?? transformedCode.code : transformedCode.code;
|
|
87
|
-
return {
|
|
88
|
-
contents: code,
|
|
89
|
-
loader: "js"
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
throw new Error(`Could not transform file: ${args.path}`);
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
function createCedarViteApiPlugin() {
|
|
97
|
-
const cedarConfig = (0, import_project_config.getConfig)();
|
|
98
|
-
const isEsm = (0, import_project_config.projectSideIsEsm)("api");
|
|
99
|
-
return {
|
|
100
|
-
name: "cedar-vite-api-babel-transform",
|
|
101
|
-
enforce: "pre",
|
|
102
|
-
async transform(code, id) {
|
|
103
|
-
if (!/\.(js|ts|tsx|jsx)$/.test(id)) {
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
if (id.includes("node_modules")) {
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
const cedarPaths = (0, import_project_config.getPaths)();
|
|
110
|
-
if (!(0, import_vite.normalizePath)(id).startsWith((0, import_vite.normalizePath)(cedarPaths.api.base))) {
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
const transformedCode = await (0, import_babel_config.transformWithBabel)(
|
|
114
|
-
code,
|
|
115
|
-
id,
|
|
116
|
-
(0, import_babel_config.getApiSideBabelPlugins)({
|
|
117
|
-
openTelemetry: cedarConfig.experimental.opentelemetry.enabled && cedarConfig.experimental.opentelemetry.wrapApi,
|
|
118
|
-
projectIsEsm: isEsm
|
|
119
|
-
}),
|
|
120
|
-
true
|
|
121
|
-
);
|
|
122
|
-
if (transformedCode?.code) {
|
|
123
|
-
const functionsDir = (0, import_vite.normalizePath)(
|
|
124
|
-
import_node_path.default.join(cedarPaths.api.src, "functions")
|
|
125
|
-
);
|
|
126
|
-
const code2 = (0, import_vite.normalizePath)(id).startsWith(functionsDir + "/") ? (0, import_esbuild_plugin_cedar_context_wrapping.applyContextWrapping)(transformedCode.code, {
|
|
127
|
-
projectIsEsm: isEsm
|
|
128
|
-
}) ?? transformedCode.code : transformedCode.code;
|
|
129
|
-
return {
|
|
130
|
-
code: code2,
|
|
131
|
-
map: transformedCode.map ?? null
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
throw new Error(`Could not transform file: ${id}`);
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
const buildApiWithVite = async () => {
|
|
139
|
-
const cedarPaths = (0, import_project_config.getPaths)();
|
|
140
|
-
const isEsm = (0, import_project_config.projectSideIsEsm)("api");
|
|
141
|
-
const format = isEsm ? "es" : "cjs";
|
|
142
|
-
const apiFiles = (0, import_files.findApiFiles)();
|
|
143
|
-
const input = {};
|
|
144
|
-
for (const f of apiFiles) {
|
|
145
|
-
const key = import_node_path.default.relative(cedarPaths.api.src, f).replace(/\.(ts|tsx|mts|js|jsx|mjs)$/, "");
|
|
146
|
-
input[key] = f;
|
|
147
|
-
}
|
|
148
|
-
return (0, import_vite.build)({
|
|
149
|
-
root: cedarPaths.api.base,
|
|
150
|
-
logLevel: "warn",
|
|
151
|
-
build: {
|
|
152
|
-
ssr: true,
|
|
153
|
-
sourcemap: true,
|
|
154
|
-
outDir: cedarPaths.api.dist,
|
|
155
|
-
rollupOptions: {
|
|
156
|
-
input,
|
|
157
|
-
output: {
|
|
158
|
-
format,
|
|
159
|
-
preserveModules: true,
|
|
160
|
-
preserveModulesRoot: cedarPaths.api.src,
|
|
161
|
-
entryFileNames: "[name].js",
|
|
162
|
-
// Directives (and other entry modules) intentionally use both named
|
|
163
|
-
// and default exports (e.g. `export const schema` + `export default`).
|
|
164
|
-
// Tell Rollup to expect this so it doesn't warn about mixed exports.
|
|
165
|
-
exports: "named"
|
|
166
|
-
},
|
|
167
|
-
external: (id) => {
|
|
168
|
-
if (id.startsWith("node:")) {
|
|
169
|
-
return true;
|
|
170
|
-
}
|
|
171
|
-
if (!id.startsWith(".") && !import_node_path.default.isAbsolute(id)) {
|
|
172
|
-
return true;
|
|
173
|
-
}
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
plugins: [createCedarViteApiPlugin()]
|
|
179
|
-
});
|
|
180
|
-
};
|
|
181
|
-
const transpileApi = async (files) => {
|
|
182
|
-
const result = await (0, import_esbuild.build)(getEsbuildOptions(files));
|
|
183
|
-
const cedarPaths = (0, import_project_config.getPaths)();
|
|
184
|
-
await fixSourceMaps(cedarPaths.api.dist, cedarPaths.api.src);
|
|
185
|
-
return result;
|
|
186
|
-
};
|
|
187
|
-
async function fixSourceMaps(distDir, srcDir) {
|
|
188
|
-
let entries;
|
|
189
|
-
try {
|
|
190
|
-
entries = await import_node_fs.default.promises.readdir(distDir, {
|
|
191
|
-
recursive: true,
|
|
192
|
-
withFileTypes: true
|
|
193
|
-
});
|
|
194
|
-
} catch {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
const mapFiles = entries.filter((e) => e.isFile() && e.name.endsWith(".js.map")).map((e) => import_node_path.default.join(e.parentPath ?? e.path, e.name));
|
|
198
|
-
await Promise.all(
|
|
199
|
-
mapFiles.map(async (mapFile) => {
|
|
200
|
-
try {
|
|
201
|
-
const raw = await import_node_fs.default.promises.readFile(mapFile, "utf8");
|
|
202
|
-
const map = JSON.parse(raw);
|
|
203
|
-
if (!Array.isArray(map.sources) || map.sources.length === 0) {
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
const jsFile = mapFile.slice(0, -4);
|
|
207
|
-
const baseName = import_node_path.default.relative(distDir, jsFile).replace(/\.js$/, "");
|
|
208
|
-
const srcFile = [".ts", ".tsx", ".jsx", ".js"].map((ext) => import_node_path.default.join(srcDir, baseName + ext)).find((f) => import_node_fs.default.existsSync(f));
|
|
209
|
-
if (!srcFile) {
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
const correctRelPath = (0, import_vite.normalizePath)(
|
|
213
|
-
import_node_path.default.relative(import_node_path.default.dirname(mapFile), srcFile)
|
|
214
|
-
);
|
|
215
|
-
if (map.sources[0] === correctRelPath) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
map.sources = [correctRelPath];
|
|
219
|
-
await import_node_fs.default.promises.writeFile(mapFile, JSON.stringify(map), "utf8");
|
|
220
|
-
} catch {
|
|
221
|
-
}
|
|
222
|
-
})
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
function getEsbuildOptions(files) {
|
|
226
|
-
const cedarPaths = (0, import_project_config.getPaths)();
|
|
227
|
-
const format = (0, import_project_config.projectSideIsEsm)("api") ? "esm" : "cjs";
|
|
228
|
-
return {
|
|
229
|
-
absWorkingDir: cedarPaths.api.base,
|
|
230
|
-
entryPoints: files,
|
|
231
|
-
platform: "node",
|
|
232
|
-
target: "node24",
|
|
233
|
-
format,
|
|
234
|
-
allowOverwrite: true,
|
|
235
|
-
bundle: false,
|
|
236
|
-
plugins: [runCedarBabelTransformsPlugin],
|
|
237
|
-
outdir: cedarPaths.api.dist,
|
|
238
|
-
// setting this to 'true' will generate an external sourcemap x.js.map
|
|
239
|
-
// AND set the sourceMappingURL comment
|
|
240
|
-
// (setting it to 'external' will ONLY generate the file, but won't add the comment)
|
|
241
|
-
sourcemap: true
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
245
|
-
0 && (module.exports = {
|
|
246
|
-
buildApi,
|
|
247
|
-
buildApiWithVite,
|
|
248
|
-
cleanApiBuild,
|
|
249
|
-
fixSourceMaps,
|
|
250
|
-
rebuildApi
|
|
251
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"esbuild-plugin-cedar-context-wrapping.d.ts","sourceRoot":"","sources":["../../../src/build/esbuild-plugin-cedar-context-wrapping.ts"],"names":[],"mappings":"AAOA,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,EAAE,YAAoB,EAAE,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAO,GACxD,MAAM,GAAG,IAAI,CA0Cf"}
|
|
@@ -1,59 +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 esbuild_plugin_cedar_context_wrapping_exports = {};
|
|
20
|
-
__export(esbuild_plugin_cedar_context_wrapping_exports, {
|
|
21
|
-
applyContextWrapping: () => applyContextWrapping
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(esbuild_plugin_cedar_context_wrapping_exports);
|
|
24
|
-
function applyContextWrapping(code, { projectIsEsm = false } = {}) {
|
|
25
|
-
const handlerRe = /^export\s+(?:const|let|var)\s+handler(?:[^=]|=>)*?=(?![>=])/m;
|
|
26
|
-
const handlerMatch = handlerRe.exec(code);
|
|
27
|
-
if (!handlerMatch) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
const afterEquals = code.slice(handlerMatch.index + handlerMatch[0].length).trimStart();
|
|
31
|
-
const isAsync = /^async(?:\s*[\(\*]|\s+function)/.test(afterEquals);
|
|
32
|
-
const storePath = projectIsEsm ? "@cedarjs/context/dist/store.js" : "@cedarjs/context/dist/store";
|
|
33
|
-
const importStatement = `import { getAsyncStoreInstance as __rw_getAsyncStoreInstance } from '${storePath}'
|
|
34
|
-
`;
|
|
35
|
-
const handlerStart = handlerMatch.index;
|
|
36
|
-
const before = code.slice(0, handlerStart);
|
|
37
|
-
const after = code.slice(handlerStart);
|
|
38
|
-
const renamed = after.replace(handlerRe, "const __rw_handler =");
|
|
39
|
-
const wrappedHandler = `
|
|
40
|
-
export const handler = ${isAsync ? "async " : ""}(__rw_event, __rw__context) => {
|
|
41
|
-
// The store will be undefined if no context isolation has been performed yet
|
|
42
|
-
const __rw_contextStore = __rw_getAsyncStoreInstance().getStore()
|
|
43
|
-
if (__rw_contextStore === undefined) {
|
|
44
|
-
return __rw_getAsyncStoreInstance().run(
|
|
45
|
-
new Map(),
|
|
46
|
-
__rw_handler,
|
|
47
|
-
__rw_event,
|
|
48
|
-
__rw__context
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
return __rw_handler(__rw_event, __rw__context)
|
|
52
|
-
}
|
|
53
|
-
`;
|
|
54
|
-
return before + importStatement + renamed + wrappedHandler;
|
|
55
|
-
}
|
|
56
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
-
0 && (module.exports = {
|
|
58
|
-
applyContextWrapping
|
|
59
|
-
});
|
package/dist/cjs/cliLogger.d.ts
DELETED
|
@@ -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"}
|
package/dist/cjs/cliLogger.js
DELETED
|
@@ -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
package/dist/cjs/dev.d.ts.map
DELETED
|
@@ -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
|
-
});
|