@tailorkit/vite 0.1.0-beta.45 → 0.1.0-beta.46
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/builder.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createTailorKitUploadManifest, tailorkitUploadManifestSchema } from "./upload-manifest.mjs";
|
|
2
2
|
import { loadTailorKitConfig } from "./config-loader.mjs";
|
|
3
|
-
import { d as appDatabasePaths, r as getClientSourceFiles, s as checkAppSchema, u as drizzleGenerateArguments } from "./file-routes-
|
|
3
|
+
import { d as appDatabasePaths, r as getClientSourceFiles, s as checkAppSchema, u as drizzleGenerateArguments } from "./file-routes-Cq20iqWz.mjs";
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
import { access } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
@@ -128,15 +128,13 @@ const createScope = (parent, functionScope = false) => ({
|
|
|
128
128
|
});
|
|
129
129
|
const bindingNames = (node) => {
|
|
130
130
|
if (!node) return [];
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
default: return [];
|
|
139
|
-
}
|
|
131
|
+
if (node.type === "Identifier") return [node.name];
|
|
132
|
+
else if (node.type === "RestElement") return bindingNames(node.argument);
|
|
133
|
+
else if (node.type === "AssignmentPattern") return bindingNames(node.left);
|
|
134
|
+
else if (node.type === "ArrayPattern") return node.elements.flatMap(bindingNames);
|
|
135
|
+
else if (node.type === "ObjectPattern") return node.properties.flatMap((property) => bindingNames(property.type === "Property" ? property.value : property.argument));
|
|
136
|
+
else if (node.type === "TSParameterProperty") return bindingNames(node.parameter);
|
|
137
|
+
return [];
|
|
140
138
|
};
|
|
141
139
|
const bind = (node, scope) => {
|
|
142
140
|
for (const name of bindingNames(node)) scope.bindings.set(name, "local");
|
|
@@ -181,44 +179,25 @@ const callScopes = (program) => {
|
|
|
181
179
|
const visit = (node, initialScope) => {
|
|
182
180
|
let scope = initialScope;
|
|
183
181
|
scopes.set(node, scope);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
break;
|
|
204
|
-
case "SwitchStatement":
|
|
205
|
-
visit(node.discriminant, scope);
|
|
206
|
-
scope = createScope(scope);
|
|
207
|
-
for (const branch of node.cases) visit(branch, scope);
|
|
208
|
-
return;
|
|
209
|
-
case "BlockStatement":
|
|
210
|
-
case "ForStatement":
|
|
211
|
-
case "ForInStatement":
|
|
212
|
-
case "ForOfStatement":
|
|
213
|
-
scope = createScope(scope);
|
|
214
|
-
break;
|
|
215
|
-
case "StaticBlock":
|
|
216
|
-
case "TSModuleBlock":
|
|
217
|
-
scope = createScope(scope, true);
|
|
218
|
-
break;
|
|
219
|
-
case "TSEnumDeclaration":
|
|
220
|
-
case "TSModuleDeclaration": bind(node.id, scope);
|
|
221
|
-
}
|
|
182
|
+
if (node.type === "ImportDeclaration") {
|
|
183
|
+
bindImports(node, scope);
|
|
184
|
+
return;
|
|
185
|
+
} else if (node.type === "VariableDeclaration") bindVariables(node, scope);
|
|
186
|
+
else if (node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") {
|
|
187
|
+
visitFunction(node, scope, visit);
|
|
188
|
+
return;
|
|
189
|
+
} else if (node.type === "ClassDeclaration" || node.type === "ClassExpression") scope = classScope(node, scope);
|
|
190
|
+
else if (node.type === "CatchClause") {
|
|
191
|
+
scope = createScope(scope);
|
|
192
|
+
bind(node.param, scope);
|
|
193
|
+
} else if (node.type === "SwitchStatement") {
|
|
194
|
+
visit(node.discriminant, scope);
|
|
195
|
+
scope = createScope(scope);
|
|
196
|
+
for (const branch of node.cases) visit(branch, scope);
|
|
197
|
+
return;
|
|
198
|
+
} else if (node.type === "BlockStatement" || node.type === "ForStatement" || node.type === "ForInStatement" || node.type === "ForOfStatement") scope = createScope(scope);
|
|
199
|
+
else if (node.type === "StaticBlock" || node.type === "TSModuleBlock") scope = createScope(scope, true);
|
|
200
|
+
else if (node.type === "TSEnumDeclaration" || node.type === "TSModuleDeclaration") bind(node.id, scope);
|
|
222
201
|
for (const child of childNodes(node)) visit(child, scope);
|
|
223
202
|
};
|
|
224
203
|
visit(program, createScope(void 0, true));
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createTailorKitUploadManifest, tailorkitUploadManifestSchema } from "./upload-manifest.mjs";
|
|
2
2
|
import { loadTailorKitConfig } from "./config-loader.mjs";
|
|
3
|
-
import { a as createDefineViewMatcher, c as isMissingFile, d as appDatabasePaths, i as inferFileView, l as getBuildEnvironment, n as fileRoutesPlugin, o as forEachSequential, s as checkAppSchema, t as createFileRouteEntry } from "./file-routes-
|
|
3
|
+
import { a as createDefineViewMatcher, c as isMissingFile, d as appDatabasePaths, i as inferFileView, l as getBuildEnvironment, n as fileRoutesPlugin, o as forEachSequential, s as checkAppSchema, t as createFileRouteEntry } from "./file-routes-Cq20iqWz.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as v from "valibot";
|
|
6
6
|
import { execFile } from "node:child_process";
|
|
@@ -141,14 +141,12 @@ const walk = (node, visit, ancestors = []) => {
|
|
|
141
141
|
};
|
|
142
142
|
const boundNames = (node) => {
|
|
143
143
|
if (!node) return [];
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
default: return [];
|
|
151
|
-
}
|
|
144
|
+
if (node.type === "Identifier") return [node.name];
|
|
145
|
+
else if (node.type === "RestElement") return boundNames(node.argument);
|
|
146
|
+
else if (node.type === "AssignmentPattern") return boundNames(node.left);
|
|
147
|
+
else if (node.type === "ArrayPattern") return node.elements.flatMap(boundNames);
|
|
148
|
+
else if (node.type === "ObjectPattern") return node.properties.flatMap((p) => boundNames(p.type === "Property" ? p.value : p.argument));
|
|
149
|
+
return [];
|
|
152
150
|
};
|
|
153
151
|
const declarations = (node) => {
|
|
154
152
|
if (node.type === "VariableDeclaration") return node.declarations.flatMap((d) => boundNames(d.id));
|
|
@@ -762,7 +760,7 @@ const tailorkit = (options = {}) => {
|
|
|
762
760
|
enforce: "pre",
|
|
763
761
|
name: "tailorkit-browser-server-boundary",
|
|
764
762
|
async resolveId(id, importer) {
|
|
765
|
-
if (/^(?:@tailorkit\/app\/server$|tailorkit\/(?:server|app\/server)$|effect(?:\/|$))/u.test(id) || importer !== void 0 && importer !== null && importer !== "" && path.resolve(path.dirname(importer), id) === serverEntry) throw new Error("App server implementations cannot be imported into a browser bundle. Import api from #tailorkit and server types with import type.");
|
|
763
|
+
if (/^(?:@tailorkit\/(?:app\/server|app-db)$|tailorkit\/(?:server|db|app\/server)$|effect(?:\/|$))/u.test(id) || importer !== void 0 && importer !== null && importer !== "" && path.resolve(path.dirname(importer), id) === serverEntry) throw new Error("App server implementations cannot be imported into a browser bundle. Import api from #tailorkit and server types with import type.");
|
|
766
764
|
if (importer !== void 0 && importer !== null && importer !== "") {
|
|
767
765
|
if ((await this.resolve(id, importer, { skipSelf: true }))?.id.split("?")[0] === serverEntry) throw new Error("App server implementations cannot be imported into a browser bundle. Import api from #tailorkit and server types with import type.");
|
|
768
766
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailorkit/vite",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.46",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@tailorkit/app": "0.1.0-beta.
|
|
50
|
+
"@tailorkit/app": "0.1.0-beta.46",
|
|
51
51
|
"cosmiconfig": "^10.0.1",
|
|
52
52
|
"valibot": "^1.5.0"
|
|
53
53
|
},
|