@fluixi/ts-plugin 0.1.0-alpha.24 → 0.1.0-alpha.26
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/auto-import.d.ts +43 -0
- package/dist/auto-import.d.ts.map +1 -0
- package/dist/cache.d.ts +29 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/collect.d.ts +33 -0
- package/dist/collect.d.ts.map +1 -0
- package/dist/completion.d.ts +11 -0
- package/dist/completion.d.ts.map +1 -0
- package/dist/diagnostics.d.ts +23 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/elements.d.ts +21 -0
- package/dist/elements.d.ts.map +1 -0
- package/dist/fixes.d.ts +19 -0
- package/dist/fixes.d.ts.map +1 -0
- package/dist/hover.d.ts +11 -0
- package/dist/hover.d.ts.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +418 -7
- package/dist/infer.d.ts +45 -0
- package/dist/infer.d.ts.map +1 -0
- package/dist/navigation.d.ts +48 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/pieces.d.ts +20 -0
- package/dist/pieces.d.ts.map +1 -0
- package/dist/props.d.ts +19 -0
- package/dist/props.d.ts.map +1 -0
- package/dist/rules.d.ts +49 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +417 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/package.json +11 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,IAAI;;;;;;;;;;;;CAYP,CAAC;AAKX,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAYtD;AAsFD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,EAAE,EAAE,OAAO,EAAE,EACb,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,EAAE,CAAC,oBAAoB,GAAG,SAAS,GACxC,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAapB;AAwBD,8CAA8C;AAC9C,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,OAAO,EAAE,EACb,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,EAAE,CAAC,oBAAoB,GAC7B,EAAE,CAAC,UAAU,EAAE,CAyNjB;AAeD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,EAAE,EAAE,OAAO,EAAE,EACb,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,EAAE,CAAC,oBAAoB,GAC5B,EAAE,CAAC,aAAa,GAAG,IAAI,CA2DzB"}
|
package/dist/rules.js
ADDED
|
@@ -0,0 +1,417 @@
|
|
|
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
|
+
|
|
20
|
+
// src/rules.ts
|
|
21
|
+
var rules_exports = {};
|
|
22
|
+
__export(rules_exports, {
|
|
23
|
+
RULE: () => RULE,
|
|
24
|
+
envAuthDiagnostics: () => envAuthDiagnostics,
|
|
25
|
+
envPublicFix: () => envPublicFix,
|
|
26
|
+
isServerFile: () => isServerFile,
|
|
27
|
+
publicEnvNames: () => publicEnvNames
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(rules_exports);
|
|
30
|
+
var RULE = {
|
|
31
|
+
envNotPublic: 9101,
|
|
32
|
+
serverReadInBrowser: 9102,
|
|
33
|
+
importMetaEnv: 9103,
|
|
34
|
+
secretInEnvPublic: 9104,
|
|
35
|
+
secretInBrowser: 9105,
|
|
36
|
+
audienceUnchecked: 9106,
|
|
37
|
+
weakAlgorithm: 9107,
|
|
38
|
+
dpopBareVerify: 9108,
|
|
39
|
+
guardWithoutRoles: 9109,
|
|
40
|
+
weakCookie: 9110,
|
|
41
|
+
localStorageTokens: 9111
|
|
42
|
+
};
|
|
43
|
+
var SECRETISH = /(SECRET|PASSWORD|PASSWD|PRIVATE_KEY|CLIENT_SECRET|CREDENTIALS?)($|_)/;
|
|
44
|
+
var VITE_BUILTINS = /* @__PURE__ */ new Set(["DEV", "PROD", "SSR", "MODE", "BASE_URL"]);
|
|
45
|
+
function isServerFile(fileName) {
|
|
46
|
+
const f = fileName.replace(/\\/g, "/");
|
|
47
|
+
return /\.server\.[cm]?[jt]sx?$/.test(f) || /\/src\/api\//.test(f) || /\/src\/middleware\.[cm]?[jt]s$/.test(f) || /\/(fluixi|vite)\.config\.[cm]?[jt]s$/.test(f) || /\/src\/entry-server\.[cm]?[jt]sx?$/.test(f) || // Tests run under Node, never in a page.
|
|
48
|
+
/\.(spec|test)\.[cm]?[jt]sx?$/.test(f) || /\/(tests?|__tests__)\//.test(f);
|
|
49
|
+
}
|
|
50
|
+
function importsOf(ts, sf) {
|
|
51
|
+
const out = /* @__PURE__ */ new Map();
|
|
52
|
+
for (const stmt of sf.statements) {
|
|
53
|
+
if (!ts.isImportDeclaration(stmt) || !ts.isStringLiteral(stmt.moduleSpecifier)) continue;
|
|
54
|
+
const bindings = stmt.importClause?.namedBindings;
|
|
55
|
+
if (!bindings || !ts.isNamedImports(bindings)) continue;
|
|
56
|
+
for (const el of bindings.elements) {
|
|
57
|
+
out.set(el.name.text, { module: stmt.moduleSpecifier.text, name: (el.propertyName ?? el.name).text });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
function sideOf(ts, test) {
|
|
63
|
+
if (ts.isParenthesizedExpression(test)) return sideOf(ts, test.expression);
|
|
64
|
+
if (ts.isPrefixUnaryExpression(test) && test.operator === ts.SyntaxKind.ExclamationToken) {
|
|
65
|
+
const inner = sideOf(ts, test.operand);
|
|
66
|
+
return inner === "server" ? "browser" : inner === "browser" ? "server" : null;
|
|
67
|
+
}
|
|
68
|
+
if (ts.isPropertyAccessExpression(test) && test.name.text === "SSR" && ts.isPropertyAccessExpression(test.expression) && test.expression.name.text === "env" && ts.isMetaProperty(test.expression.expression)) {
|
|
69
|
+
return "server";
|
|
70
|
+
}
|
|
71
|
+
if (ts.isBinaryExpression(test)) {
|
|
72
|
+
const op = test.operatorToken.kind;
|
|
73
|
+
const eq = op === ts.SyntaxKind.EqualsEqualsEqualsToken || op === ts.SyntaxKind.EqualsEqualsToken;
|
|
74
|
+
const ne = op === ts.SyntaxKind.ExclamationEqualsEqualsToken || op === ts.SyntaxKind.ExclamationEqualsToken;
|
|
75
|
+
if (!eq && !ne) return null;
|
|
76
|
+
const typeofGlobal = (n) => ts.isTypeOfExpression(n) && ts.isIdentifier(n.expression) && ["window", "document"].includes(n.expression.text);
|
|
77
|
+
const undef = (n) => ts.isStringLiteral(n) && n.text === "undefined";
|
|
78
|
+
if (typeofGlobal(test.left) && undef(test.right) || typeofGlobal(test.right) && undef(test.left)) {
|
|
79
|
+
return eq ? "server" : "browser";
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
var isUseServer = (ts, body) => {
|
|
85
|
+
if (!body || !ts.isBlock(body)) return false;
|
|
86
|
+
const first = body.statements[0];
|
|
87
|
+
return !!first && ts.isExpressionStatement(first) && ts.isStringLiteral(first.expression) && first.expression.text === "use server";
|
|
88
|
+
};
|
|
89
|
+
function inServerContext(ts, node, sf) {
|
|
90
|
+
const first = sf.statements[0];
|
|
91
|
+
if (first && ts.isExpressionStatement(first) && ts.isStringLiteral(first.expression) && first.expression.text === "use server") {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
for (let child = node, parent = node.parent; parent; child = parent, parent = parent.parent) {
|
|
95
|
+
if ((ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(parent) || ts.isArrowFunction(parent)) && isUseServer(ts, parent.body)) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
if (ts.isIfStatement(parent) || ts.isConditionalExpression(parent)) {
|
|
99
|
+
const side = sideOf(ts, ts.isIfStatement(parent) ? parent.expression : parent.condition);
|
|
100
|
+
const whenTrue = ts.isIfStatement(parent) ? parent.thenStatement : parent.whenTrue;
|
|
101
|
+
const whenFalse = ts.isIfStatement(parent) ? parent.elseStatement : parent.whenFalse;
|
|
102
|
+
if (side === "server" && child === whenTrue) return true;
|
|
103
|
+
if (side === "browser" && child === whenFalse) return true;
|
|
104
|
+
}
|
|
105
|
+
if (ts.isBinaryExpression(parent) && parent.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken && child === parent.right && sideOf(ts, parent.left) === "server") {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
function publicEnvNames(ts, program, fileName, host) {
|
|
112
|
+
const checker = program.getTypeChecker();
|
|
113
|
+
let moduleSymbol;
|
|
114
|
+
if (host) {
|
|
115
|
+
const resolved = ts.resolveModuleName("@fluixi/start/env", fileName, program.getCompilerOptions(), host).resolvedModule;
|
|
116
|
+
const target = resolved && program.getSourceFile(resolved.resolvedFileName);
|
|
117
|
+
if (target) moduleSymbol = checker.getSymbolAtLocation(target);
|
|
118
|
+
}
|
|
119
|
+
moduleSymbol ??= checker.getAmbientModules().find((m) => m.name.replace(/"/g, "") === "@fluixi/start/env");
|
|
120
|
+
const iface = moduleSymbol && checker.getExportsOfModule(moduleSymbol).find((s) => s.name === "PublicEnv");
|
|
121
|
+
if (!iface) return null;
|
|
122
|
+
const names = checker.getPropertiesOfType(checker.getDeclaredTypeOfSymbol(iface)).map((p) => p.name);
|
|
123
|
+
return names.length ? new Set(names) : null;
|
|
124
|
+
}
|
|
125
|
+
var propsOf = (ts, obj) => {
|
|
126
|
+
const map = /* @__PURE__ */ new Map();
|
|
127
|
+
for (const p of obj.properties) {
|
|
128
|
+
if (ts.isPropertyAssignment(p) && (ts.isIdentifier(p.name) || ts.isStringLiteral(p.name))) map.set(p.name.text, p);
|
|
129
|
+
}
|
|
130
|
+
return map;
|
|
131
|
+
};
|
|
132
|
+
var isFalse = (ts, e) => !!e && e.kind === ts.SyntaxKind.FalseKeyword;
|
|
133
|
+
var OAUTH_CONFIG_CALLS = /* @__PURE__ */ new Set([
|
|
134
|
+
"createAuthService",
|
|
135
|
+
"createBrowserClient",
|
|
136
|
+
"createServerClient",
|
|
137
|
+
"createServiceClient",
|
|
138
|
+
"createTokenIntrospector",
|
|
139
|
+
"oauthRoutes",
|
|
140
|
+
"authServerModule",
|
|
141
|
+
"sessionLocals"
|
|
142
|
+
]);
|
|
143
|
+
function envAuthDiagnostics(ts, program, fileName, host) {
|
|
144
|
+
const sf = program.getSourceFile(fileName);
|
|
145
|
+
if (!sf || sf.isDeclarationFile || /[\\/]node_modules[\\/]/.test(fileName)) return [];
|
|
146
|
+
const text = sf.text;
|
|
147
|
+
const isConfig = /[\\/]fluixi\.config\.[cm]?[jt]s$/.test(fileName);
|
|
148
|
+
if (!isConfig && !/fluixi|\$env|import\.meta\.env|process\.env/.test(text)) return [];
|
|
149
|
+
const out = [];
|
|
150
|
+
const add = (node, code, category, messageText) => out.push({ start: node.getStart(sf), length: node.getWidth(sf), code, category, messageText, source: "fluixi" });
|
|
151
|
+
const imports = importsOf(ts, sf);
|
|
152
|
+
const serverFile = isServerFile(fileName);
|
|
153
|
+
const browserSide = (node) => !serverFile && !inServerContext(ts, node, sf);
|
|
154
|
+
const fromModule = (callee, prefix) => {
|
|
155
|
+
if (!ts.isIdentifier(callee)) return null;
|
|
156
|
+
const hit = imports.get(callee.text);
|
|
157
|
+
return hit && (hit.module === prefix || hit.module.startsWith(prefix + "/")) ? hit.name : null;
|
|
158
|
+
};
|
|
159
|
+
let publicNames;
|
|
160
|
+
const isPublic = (key) => {
|
|
161
|
+
if (publicNames === void 0) publicNames = publicEnvNames(ts, program, fileName, host);
|
|
162
|
+
return publicNames === null || publicNames.has(key) || key.startsWith("VITE_");
|
|
163
|
+
};
|
|
164
|
+
const envNotPublic = (lit) => {
|
|
165
|
+
if (!browserSide(lit) || isPublic(lit.text)) return;
|
|
166
|
+
add(
|
|
167
|
+
lit,
|
|
168
|
+
RULE.envNotPublic,
|
|
169
|
+
ts.DiagnosticCategory.Warning,
|
|
170
|
+
`${lit.text} is not in env.public, so the browser has no value for it, and the build refuses this read in browser code. If it is public, add it to env.public in fluixi.config.ts. If it is a secret, read it on the server and pass the page what it needs.`
|
|
171
|
+
);
|
|
172
|
+
};
|
|
173
|
+
const dpopVerifiers = /* @__PURE__ */ new Set();
|
|
174
|
+
const guardsWithoutRoles = /* @__PURE__ */ new Set();
|
|
175
|
+
const visit = (node) => {
|
|
176
|
+
if (ts.isCallExpression(node)) {
|
|
177
|
+
const callee = node.expression;
|
|
178
|
+
const envFn = ts.isIdentifier(callee) && callee.text === "$env" ? "env" : fromModule(callee, "@fluixi/start");
|
|
179
|
+
const oauthFn = fromModule(callee, "@fluixi/oauth2");
|
|
180
|
+
const sessionFn = fromModule(callee, "@fluixi/session");
|
|
181
|
+
const arg0 = node.arguments[0];
|
|
182
|
+
if (envFn === "env" && arg0 && ts.isStringLiteral(arg0)) envNotPublic(arg0);
|
|
183
|
+
if (envFn === "pickEnv" && arg0 && ts.isObjectLiteralExpression(arg0)) {
|
|
184
|
+
for (const p of arg0.properties) {
|
|
185
|
+
if (!ts.isPropertyAssignment(p)) continue;
|
|
186
|
+
if (ts.isStringLiteral(p.initializer)) envNotPublic(p.initializer);
|
|
187
|
+
else if (ts.isObjectLiteralExpression(p.initializer)) {
|
|
188
|
+
const key = propsOf(ts, p.initializer).get("key")?.initializer;
|
|
189
|
+
if (key && ts.isStringLiteral(key)) envNotPublic(key);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (envFn === "serverEnv" && browserSide(node)) {
|
|
194
|
+
add(
|
|
195
|
+
callee,
|
|
196
|
+
RULE.serverReadInBrowser,
|
|
197
|
+
ts.DiagnosticCategory.Warning,
|
|
198
|
+
'serverEnv() in code the browser runs throws there: server-only values are not in the bundle. Read it in an API route, middleware or a "use server" function.'
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
if (ts.isIdentifier(callee) && dpopVerifiers.has(callee.text)) {
|
|
202
|
+
add(
|
|
203
|
+
callee,
|
|
204
|
+
RULE.dpopBareVerify,
|
|
205
|
+
ts.DiagnosticCategory.Error,
|
|
206
|
+
`${callee.text} requires DPoP, and a bare token carries no proof, so every call is refused. Use ${callee.text}.fromRequest(request).`
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
if (ts.isIdentifier(callee) && guardsWithoutRoles.has(callee.text)) {
|
|
210
|
+
const req = node.arguments[1];
|
|
211
|
+
if (req && ts.isObjectLiteralExpression(req)) {
|
|
212
|
+
const props = propsOf(ts, req);
|
|
213
|
+
const role = props.get("role") ?? props.get("allRoles");
|
|
214
|
+
if (role) {
|
|
215
|
+
add(
|
|
216
|
+
role.name,
|
|
217
|
+
RULE.guardWithoutRoles,
|
|
218
|
+
ts.DiagnosticCategory.Error,
|
|
219
|
+
`${callee.text} was built without \`roles\`, so a role requirement throws on the first request. Pass one of rolesFrom to createApiGuard.`
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const configs = [];
|
|
225
|
+
if (oauthFn && OAUTH_CONFIG_CALLS.has(oauthFn) || oauthFn === "createTokenVerifier" || sessionFn === "createSessionCookie") {
|
|
226
|
+
if (arg0 && ts.isObjectLiteralExpression(arg0)) {
|
|
227
|
+
configs.push(arg0);
|
|
228
|
+
const nested = propsOf(ts, arg0).get("config")?.initializer;
|
|
229
|
+
if (oauthFn === "createAuthService" && nested && ts.isObjectLiteralExpression(nested)) configs.push(nested);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
for (const obj of configs) {
|
|
233
|
+
const props = propsOf(ts, obj);
|
|
234
|
+
const tokens = props.get("tokens")?.initializer;
|
|
235
|
+
const browserTokens = tokens && ts.isStringLiteral(tokens) && tokens.text === "browser" || oauthFn === "createBrowserClient";
|
|
236
|
+
for (const secret of ["clientSecret", "privateKey"]) {
|
|
237
|
+
const p = props.get(secret);
|
|
238
|
+
if (p && (browserTokens || browserSide(p) && oauthFn !== "createTokenVerifier")) {
|
|
239
|
+
add(
|
|
240
|
+
p.name,
|
|
241
|
+
RULE.secretInBrowser,
|
|
242
|
+
ts.DiagnosticCategory.Error,
|
|
243
|
+
`${secret} in ${browserTokens ? "a tokens: 'browser' client" : "code the browser runs"} ships to every visitor, and anything shipped to a browser is not a secret. A browser client uses PKCE without one; keep ${secret} on the server.`
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (oauthFn === "createTokenVerifier") {
|
|
248
|
+
const audience = props.get("audience");
|
|
249
|
+
if (audience && isFalse(ts, audience.initializer) && !props.has("authorizedParty") && !props.has("require")) {
|
|
250
|
+
add(
|
|
251
|
+
audience,
|
|
252
|
+
RULE.audienceUnchecked,
|
|
253
|
+
ts.DiagnosticCategory.Warning,
|
|
254
|
+
"audience: false with no authorizedParty or require accepts a token minted for any client of the same issuer. Pin authorizedParty to your client id, or check a claim in require."
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
const algs = props.get("algorithms")?.initializer;
|
|
258
|
+
if (algs && ts.isArrayLiteralExpression(algs)) {
|
|
259
|
+
for (const el of algs.elements) {
|
|
260
|
+
if (ts.isStringLiteral(el) && (/^HS/.test(el.text) || el.text === "none")) {
|
|
261
|
+
add(
|
|
262
|
+
el,
|
|
263
|
+
RULE.weakAlgorithm,
|
|
264
|
+
ts.DiagnosticCategory.Error,
|
|
265
|
+
el.text === "none" ? '"none" accepts an unsigned token as valid.' : `${el.text} verifies with a shared secret; with a provider's public key it lets anyone who has that key sign tokens. Use RS256 or ES256.`
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
const cookieKey = props.get(sessionFn === "createSessionCookie" ? "secret" : "cookieSecret");
|
|
272
|
+
if (cookieKey && ts.isStringLiteral(cookieKey.initializer) && cookieKey.initializer.text.length < 32) {
|
|
273
|
+
add(
|
|
274
|
+
cookieKey.initializer,
|
|
275
|
+
RULE.weakCookie,
|
|
276
|
+
ts.DiagnosticCategory.Error,
|
|
277
|
+
"The session cookie is encrypted with a key derived from this, and under 32 characters it is short enough to guess. Read a long random value with serverEnv."
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
const secure = props.get(sessionFn === "createSessionCookie" ? "secure" : "secureCookie");
|
|
281
|
+
if (secure && isFalse(ts, secure.initializer)) {
|
|
282
|
+
add(
|
|
283
|
+
secure,
|
|
284
|
+
RULE.weakCookie,
|
|
285
|
+
ts.DiagnosticCategory.Warning,
|
|
286
|
+
"The session cookie will also be sent over plain http. Keep this for local work only: derive it, e.g. from whether the app URL is https."
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
const storage = props.get("storage")?.initializer;
|
|
290
|
+
if (storage && ts.isStringLiteral(storage) && storage.text === "local" && browserTokens) {
|
|
291
|
+
add(
|
|
292
|
+
storage,
|
|
293
|
+
RULE.localStorageTokens,
|
|
294
|
+
ts.DiagnosticCategory.Suggestion,
|
|
295
|
+
"storage: 'local' keeps the refresh token after the tab closes, so injected script can reach it for longer. 'session', the default, ends with the tab."
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (ts.isPropertyAccessExpression(node)) {
|
|
301
|
+
const obj = node.expression;
|
|
302
|
+
if (ts.isIdentifier(obj) && obj.text === "process" && node.name.text === "env" && browserSide(node)) {
|
|
303
|
+
add(
|
|
304
|
+
node,
|
|
305
|
+
RULE.serverReadInBrowser,
|
|
306
|
+
ts.DiagnosticCategory.Warning,
|
|
307
|
+
"process.env does not exist in the browser. Use $env('NAME'), which reads the public set there and anything on the server."
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
if (ts.isPropertyAccessExpression(obj) && obj.name.text === "env" && ts.isMetaProperty(obj.expression) && !VITE_BUILTINS.has(node.name.text) && !node.name.text.startsWith("VITE_")) {
|
|
311
|
+
add(
|
|
312
|
+
node,
|
|
313
|
+
RULE.importMetaEnv,
|
|
314
|
+
ts.DiagnosticCategory.Warning,
|
|
315
|
+
`import.meta.env.${node.name.text} is undefined in the browser: Vite only defines VITE_ names there. Use $env('${node.name.text}') and declare it in env.public if it is public.`
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (/[\\/]fluixi\.config\.[cm]?[jt]s$/.test(fileName) && ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && node.name.text === "public" && ts.isArrayLiteralExpression(node.initializer) && ts.isObjectLiteralExpression(node.parent) && ts.isPropertyAssignment(node.parent.parent) && ts.isIdentifier(node.parent.parent.name) && node.parent.parent.name.text === "env") {
|
|
320
|
+
for (const el of node.initializer.elements) {
|
|
321
|
+
if (ts.isStringLiteral(el) && SECRETISH.test(el.text)) {
|
|
322
|
+
add(
|
|
323
|
+
el,
|
|
324
|
+
RULE.secretInEnvPublic,
|
|
325
|
+
ts.DiagnosticCategory.Error,
|
|
326
|
+
`${el.text} reads like a secret, and env.public puts its value in the browser bundle; the build refuses it. Remove it and read it with serverEnv() on the server. If the name only looks like a secret, set FLUIXI_ALLOW_PUBLIC_SECRETS=true.`
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
ts.forEachChild(node, visit);
|
|
332
|
+
};
|
|
333
|
+
const collect = (node) => {
|
|
334
|
+
if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer && ts.isCallExpression(node.initializer)) {
|
|
335
|
+
const fn = fromModule(node.initializer.expression, "@fluixi/oauth2");
|
|
336
|
+
const opts = node.initializer.arguments[0];
|
|
337
|
+
if (opts && ts.isObjectLiteralExpression(opts)) {
|
|
338
|
+
const props = propsOf(ts, opts);
|
|
339
|
+
if (fn === "createTokenVerifier" && props.get("dpop")?.initializer.kind === ts.SyntaxKind.TrueKeyword) dpopVerifiers.add(node.name.text);
|
|
340
|
+
if (fn === "createApiGuard" && !props.has("roles") && !opts.properties.some((p) => ts.isSpreadAssignment(p))) {
|
|
341
|
+
guardsWithoutRoles.add(node.name.text);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
ts.forEachChild(node, collect);
|
|
346
|
+
};
|
|
347
|
+
collect(sf);
|
|
348
|
+
visit(sf);
|
|
349
|
+
return out.map((d) => ({ ...d, file: sf }));
|
|
350
|
+
}
|
|
351
|
+
var CONFIG_NAMES = ["fluixi.config.ts", "fluixi.config.mts", "fluixi.config.js", "fluixi.config.mjs"];
|
|
352
|
+
function findConfig(fileName, host) {
|
|
353
|
+
let dir = fileName.replace(/\\/g, "/").replace(/\/[^/]*$/, "");
|
|
354
|
+
for (; ; ) {
|
|
355
|
+
for (const name of CONFIG_NAMES) if (host.fileExists(`${dir}/${name}`)) return `${dir}/${name}`;
|
|
356
|
+
const up = dir.replace(/\/[^/]*$/, "");
|
|
357
|
+
if (!up || up === dir) return null;
|
|
358
|
+
dir = up;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
function envPublicFix(ts, program, fileName, position, host) {
|
|
362
|
+
const sf = program.getSourceFile(fileName);
|
|
363
|
+
if (!sf) return null;
|
|
364
|
+
let literal;
|
|
365
|
+
const find = (node) => {
|
|
366
|
+
if (literal || position < node.getFullStart() || position > node.getEnd()) return;
|
|
367
|
+
if (ts.isStringLiteral(node) && position >= node.getStart(sf) && position <= node.getEnd()) literal = node;
|
|
368
|
+
else ts.forEachChild(node, find);
|
|
369
|
+
};
|
|
370
|
+
find(sf);
|
|
371
|
+
if (!literal || SECRETISH.test(literal.text)) return null;
|
|
372
|
+
const configPath = findConfig(fileName, host);
|
|
373
|
+
const configText = configPath && host.readFile(configPath);
|
|
374
|
+
if (!configPath || !configText) return null;
|
|
375
|
+
const config = ts.createSourceFile(configPath, configText, ts.ScriptTarget.Latest, true);
|
|
376
|
+
let list;
|
|
377
|
+
const search = (node) => {
|
|
378
|
+
if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && node.name.text === "public" && ts.isArrayLiteralExpression(node.initializer) && ts.isPropertyAssignment(node.parent.parent) && ts.isIdentifier(node.parent.parent.name) && node.parent.parent.name.text === "env") {
|
|
379
|
+
list = node.initializer;
|
|
380
|
+
}
|
|
381
|
+
if (!list) ts.forEachChild(node, search);
|
|
382
|
+
};
|
|
383
|
+
search(config);
|
|
384
|
+
if (!list) return null;
|
|
385
|
+
const quote = list.elements.find(ts.isStringLiteral)?.getText(config).startsWith('"') ? '"' : "'";
|
|
386
|
+
const entry = `${quote}${literal.text}${quote}`;
|
|
387
|
+
const last = list.elements[list.elements.length - 1];
|
|
388
|
+
let change;
|
|
389
|
+
if (!last) {
|
|
390
|
+
change = { span: { start: list.getStart(config) + 1, length: 0 }, newText: entry };
|
|
391
|
+
} else {
|
|
392
|
+
const multiline = configText.slice(list.getStart(config), last.getStart(config)).includes("\n");
|
|
393
|
+
const lineStart = configText.lastIndexOf("\n", last.getStart(config)) + 1;
|
|
394
|
+
const indent = configText.slice(lineStart, last.getStart(config));
|
|
395
|
+
const trailingComma = list.elements.hasTrailingComma;
|
|
396
|
+
const at = trailingComma ? configText.indexOf(",", last.getEnd()) + 1 : last.getEnd();
|
|
397
|
+
const lead = trailingComma ? "" : ",";
|
|
398
|
+
change = {
|
|
399
|
+
span: { start: at, length: 0 },
|
|
400
|
+
newText: multiline ? `${lead}
|
|
401
|
+
${indent}${entry}${trailingComma ? "," : ""}` : `${lead} ${entry}`
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
return {
|
|
405
|
+
fixName: "fluixiAddEnvPublic",
|
|
406
|
+
description: `Add ${literal.text} to env.public`,
|
|
407
|
+
changes: [{ fileName: configPath, textChanges: [change] }]
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
411
|
+
0 && (module.exports = {
|
|
412
|
+
RULE,
|
|
413
|
+
envAuthDiagnostics,
|
|
414
|
+
envPublicFix,
|
|
415
|
+
isServerFile,
|
|
416
|
+
publicEnvNames
|
|
417
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/typescript.d.ts","../../compiler/dist/resolve/component-resolver.d.cts","../../compiler/dist/resolve/builtins.d.cts","../src/auto-import.ts","../../template-parser/dist/ast.d.cts","../../template-parser/dist/reader.d.cts","../../template-parser/dist/directives.d.cts","../../template-parser/dist/parser.d.cts","../../template-parser/dist/index.d.cts","../src/pieces.ts","../src/cache.ts","../src/collect.ts","../src/infer.ts","../src/completion.ts","../src/diagnostics.ts","../src/elements.ts","../src/fixes.ts","../src/hover.ts","../src/props.ts","../src/rules.ts","../src/navigation.ts","../src/index.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/assert.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/assert/strict.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/globals.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/async_hooks.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/buffer.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/child_process.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/cluster.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/console.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/constants.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/crypto.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/dgram.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/dns.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/dns/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/domain.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/dom-events.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/events.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/fs.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/fs/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/http.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/http2.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/https.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/inspector.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/module.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/net.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/os.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/path.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/process.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/punycode.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/querystring.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/readline.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/readline/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/repl.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/stream.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/stream/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/stream/web.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/string_decoder.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/test.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/timers.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/timers/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/tls.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/trace_events.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/tty.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/url.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/util.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/v8.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/vm.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/wasi.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/worker_threads.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/zlib.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/globals.global.d.ts","../../../node_modules/.pnpm/@types+node@18.16.9/node_modules/@types/node/index.d.ts"],"fileIdsList":[[75,121],[78,121],[79,84,112,121],[80,91,92,99,109,120,121],[80,81,91,99,121],[82,121],[83,84,92,100,121],[84,109,117,121],[85,87,91,99,121],[86,121],[87,88,121],[91,121],[89,91,121],[91,92,93,109,120,121],[91,92,93,106,109,112,121],[121,125],[121],[87,91,94,99,109,120,121],[91,92,94,95,99,109,117,120,121],[94,96,109,117,120,121],[75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127],[91,97,121],[98,120,121],[87,91,99,109,121],[100,121],[101,121],[78,102,121],[103,119,121,125],[104,121],[105,121],[91,106,107,121],[106,108,121,123],[79,91,109,110,111,112,121],[79,109,111,121],[109,110,121],[112,121],[113,121],[91,115,116,121],[115,116,121],[84,99,109,117,121],[118,121],[99,119,121],[79,94,105,120,121],[84,121],[109,121,122],[121,123],[121,124],[79,84,91,93,102,109,120,121,123,125],[109,121,126],[54,121],[57,121],[57,58,59,60,121],[57,58,59,121],[52,53,55,121],[52,53,61,62,121],[52,53,61,63,121],[52,53,65,121],[52,53,61,63,65,121],[52,53,67,121],[52,53,56,61,63,121],[52,53,64,65,66,67,68,69,70,71,72,73,121],[52,53,61,121],[52,53,121]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6a5253138c5432c68a1510c70fe78a644fe2e632111ba778e1978010d6edfec","impliedFormat":1},{"version":"e134052a6b1ded61693b4037f615dc72f14e2881e79c1ddbff6c514c8a516b05","impliedFormat":1},{"version":"811e0b7359817e86e7ae175be62cabc915b96b732745f072597c1b700a99de90","impliedFormat":1},{"version":"d696c1935d47646416fb7a0fedfeddcbcd31b4589a8a97f013a080aa931f2718","impliedFormat":1},{"version":"22736a4a948bf00b82f8a0c2c9cb1386521b6e65a05dbbd2500212b772a7c88f","signature":"b14e062c00405d86fbfc0255e59c73f841629dff3773c3e78ac4b3daa2752c18","impliedFormat":1},{"version":"b6d1e2738126977add7efae2c2b627625c900af38ce28ee8da4da8a197663cc7","impliedFormat":1},{"version":"4caf44a7e758a1894383229c6f6882c6681a71aec788b1eba12c0d3937d5ff94","impliedFormat":1},{"version":"69319487cb9a8a6dc2b388327b9f2968dccfa889f9e9db5866355f73f94b0834","impliedFormat":1},{"version":"d110e7fbae6861649b0dc175c3214581efff15d9faf6855959cb97287054ba11","impliedFormat":1},{"version":"160548db7ed369d595e54280a5dcc5b45b6686dea02c9ac1a874fec36a19099f","impliedFormat":1},{"version":"059a7ad1c0e8afd881608b05a211d8ebc9971be2ac74e7583e6ba2211ae8d296","signature":"5a44d0979ef59b95cdbbcdded75c08bab7ffe14c895bcebc6fd8269a81849f10","impliedFormat":1},{"version":"5ad4000399a8416db2c09e009764adaaebf3a0e50151045afd5c19a653718f7f","signature":"9740dcffe68e3ca5b7e6d80bf44ac85f4d971ee1d2fbdac657e98e67c5a27cf8","impliedFormat":1},{"version":"72678730bae22fdc813bc346bdb6ae05bcbba7cf137dd0d9eb5da3be0d58e087","signature":"9f2ecddf60efdb4ed509a2c39e7905d79001b440139ed3100b9d4c7a2f3c55d9","impliedFormat":1},{"version":"95eebde8493cb56d266118e2330c8390a611302e4cc18534202c95e6c0fdaa64","signature":"150b622813fa9a8c91b821f7e51bc61b090164d83803f633a18e67aa1f083c82","impliedFormat":1},{"version":"5f546960103a8849a0381eb4d615f29a6b8c0df000419999cb9a2576aa148df0","signature":"79a3880855891df84c640f4ca724702d112015ed63bef2a72c4ce9cb24e426c2","impliedFormat":1},{"version":"fed86bb0f370a4a388eb7bd18f591930614a9cea99b1b942fd8a43961a7cdb1f","signature":"26fef5cefc1c50430a3550723bcda7d8091d1e3f56e9cfcc7cfbd4a19b18ec3b","impliedFormat":1},{"version":"fa3e90057e70be90be98569d93d4d74091f599a76d8d42687740fcfba380f58a","signature":"9c99e196f44fa92bed30e6f6bf578bdf6feb81b57c0618d5aeb77e5a7a1c7dba","impliedFormat":1},{"version":"7201d12fbb1bc762989727eae3ba81697f442eb967b7cf02c993393b8b467a95","signature":"22bca6a3e6f387c4d370481e8749e9233e1ff82286e7f41a5a12bf9760974ab9","impliedFormat":1},{"version":"cb92933733f03af3a4bcf0f9df76564b358ef4d777396e4783900814cee89090","signature":"ee4a7b5f310d9a6055800d21e1657f7b8a980040d7c26b43a879cb98ae71cac3","impliedFormat":1},{"version":"a75b1b09672097c66408c994a2976f2a352e055a66be4e97b67cd43e6463acce","signature":"901da605c845ad34ae4c8a8906ca8bf1c4b7b719a5d71c7a006bc2182f357cdb","impliedFormat":1},{"version":"fdafac1e9527163b0232c24b4d7126d619e4db722664a392e4bba179ed0eed2d","signature":"e03cdbfbea4ff13363fb2de540224e971a3dd1e2fdd3e5a114a622ce9626f028","impliedFormat":1},{"version":"96e628c09ea23f5821737ad185bc481e44519ba9f177a6342466b43be14199fa","signature":"0b514b9cbdd90984ce8bb26045e93ed67aab50a04db78ddc0af1997c099dfbaf","impliedFormat":1},{"version":"d18033c1608a375e28458826466ecefc4483f9f89fa72f67ba3422149581a4b9","signature":"0f25eb3afc91e8f4cb3cfa3aa654d665213b76960de97abcbfe4bfcde3723954","impliedFormat":1},{"version":"7e771891adaa85b690266bc37bd6eb43bc57eecc4b54693ead36467e7369952a","impliedFormat":1},{"version":"a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a","impliedFormat":1},{"version":"f749812878fecfa53cfc13b36e5d35086fb6377983a9df44175da83ccc23af1f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7d2e3fea24c712c99c03ad8f556abedbfe105f87f1be10b95dbd409d24bc05a3","impliedFormat":1},{"version":"211e3f15fbced4ab4be19f49ffa990b9ff20d749d33b65ff753be691e7616239","affectsGlobalScope":true,"impliedFormat":1},{"version":"3719525a8f6ab731e3dfd585d9f87df55ec7d50d461df84f74eb4d68bb165244","impliedFormat":1},{"version":"5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713","impliedFormat":1},{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true,"impliedFormat":1},{"version":"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","impliedFormat":1},{"version":"e596c9bb2f29a2699fdd4ae89139612652245192f67f45617c5a4b20832aaae9","impliedFormat":1},{"version":"bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","impliedFormat":1},{"version":"1cdcfc1f624d6c08aa12c73935f6e13f095919cd99edf95752951796eb225729","impliedFormat":1},{"version":"4eaff3d8e10676fd7913d8c108890e71c688e1e7d52f6d1d55c39514f493dc47","impliedFormat":1},{"version":"14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","impliedFormat":1},{"version":"5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea","impliedFormat":1},{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true,"impliedFormat":1},{"version":"00dee7cdca8b8420c47ea4a31a34b8e8294013ebc4f463fd941e867e7bf05029","affectsGlobalScope":true,"impliedFormat":1},{"version":"3256f3cccd578f9e7fe3a28096c505634bebcee8afb738ffa99368e536ca3a0b","impliedFormat":1},{"version":"1c84b46267610a34028edfd0d035509341751262bac1062857f3c8df7aff7153","impliedFormat":1},{"version":"7f138842074d0a40681775af008c8452093b68c383c94de31759e853c6d06b5c","impliedFormat":1},{"version":"a3d541d303ee505053f5dcbf9fafb65cac3d5631037501cd616195863a6c5740","impliedFormat":1},{"version":"8d3c583a07e0c37e876908c2d5da575019f689df8d9fa4c081d99119d53dba22","impliedFormat":1},{"version":"2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58","impliedFormat":1},{"version":"e630e5528e899219ae319e83bef54bf3bcb91b01d76861ecf881e8e614b167f0","affectsGlobalScope":true,"impliedFormat":1},{"version":"bcebb922784739bdb34c18ee51095d25a92b560c78ccd2eaacd6bd00f7443d83","impliedFormat":1},{"version":"7ee6ed878c4528215c82b664fe0cfe80e8b4da6c0d4cc80869367868774db8b1","impliedFormat":1},{"version":"b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30","impliedFormat":1},{"version":"4989e92ba5b69b182d2caaea6295af52b7dc73a4f7a2e336a676722884e7139d","affectsGlobalScope":true,"impliedFormat":1},{"version":"0715e4cd28ad471b2a93f3e552ff51a3ae423417a01a10aa1d3bc7c6b95059d6","affectsGlobalScope":true,"impliedFormat":1},{"version":"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","impliedFormat":1},{"version":"210d54cd652ec0fec8c8916e4af59bb341065576ecda039842f9ffb2e908507c","impliedFormat":1},{"version":"36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","impliedFormat":1},{"version":"0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","impliedFormat":1},{"version":"25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","impliedFormat":1},{"version":"4f3fdeba4e28e21aa719c081b8dc8f91d47e12e773389b9d35679c08151c9d37","impliedFormat":1},{"version":"1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","impliedFormat":1},{"version":"69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","impliedFormat":1},{"version":"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","impliedFormat":1},{"version":"23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","impliedFormat":1},{"version":"f69ff39996a61a0dd10f4bce73272b52e8024a4d58b13ab32bf4712909d0a2b7","impliedFormat":1},{"version":"3c4ba1dd9b12ffa284b565063108f2f031d150ea15b8fafbdc17f5d2a07251f3","affectsGlobalScope":true,"impliedFormat":1},{"version":"e10177274a35a9d07c825615340b2fcde2f610f53f3fb40269fd196b4288dda6","impliedFormat":1},{"version":"1422cd9e705adcc09088fda85a900c2b70e3ad36ea85846f68bd1a884cdf4e2b","impliedFormat":1},{"version":"3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","impliedFormat":1},{"version":"5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2","impliedFormat":1},{"version":"a73ae8c0e62103bb9e21bb6538700881bf135b9a8b125b857ec68edfa0da4ed3","affectsGlobalScope":true,"impliedFormat":1},{"version":"e1c1b2fbe236bf7ee3e342eeae7e20efb8988a0ac7da1cbbfa2c1f66b76c3423","affectsGlobalScope":true,"impliedFormat":1},{"version":"868831cab82b65dfe1d68180e898af1f2101e89ba9b754d1db6fb8cc2fac1921","impliedFormat":1},{"version":"0fe8985a28f82c450a04a6edf1279d7181c0893f37da7d2a27f8efd4fd5edb03","impliedFormat":1},{"version":"e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa","impliedFormat":1},{"version":"52120bb7e4583612225bdf08e7c12559548170f11e660d33a33623bae9bbdbba","affectsGlobalScope":true,"impliedFormat":1},{"version":"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e","impliedFormat":1},{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6dd3dba8e665ac43d279e0fdf5219edda0eed69b5e9a5061f46cd6a65c4f7a1","impliedFormat":1}],"root":[56,[62,74]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"importHelpers":true,"module":100,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUnusedLocals":false,"noUnusedParameters":false,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"target":9,"tsBuildInfoFile":"./tsconfig.lib.tsbuildinfo"},"referencedMap":[[75,1],[76,1],[78,2],[79,3],[80,4],[81,5],[82,6],[83,7],[84,8],[85,9],[86,10],[87,11],[88,11],[90,12],[89,13],[91,12],[92,14],[93,15],[77,16],[127,17],[94,18],[95,19],[96,20],[128,21],[97,22],[98,23],[99,24],[100,25],[101,26],[102,27],[103,28],[104,29],[105,30],[106,31],[107,31],[108,32],[109,33],[111,34],[110,35],[112,36],[113,37],[114,17],[115,38],[116,39],[117,40],[118,41],[119,42],[120,43],[121,44],[122,45],[123,46],[124,47],[125,48],[126,49],[52,17],[50,17],[51,17],[10,17],[9,17],[2,17],[11,17],[12,17],[13,17],[14,17],[15,17],[16,17],[17,17],[18,17],[3,17],[19,17],[20,17],[4,17],[21,17],[25,17],[22,17],[23,17],[24,17],[26,17],[27,17],[28,17],[5,17],[29,17],[30,17],[31,17],[32,17],[6,17],[36,17],[33,17],[34,17],[35,17],[37,17],[7,17],[38,17],[43,17],[44,17],[39,17],[40,17],[41,17],[42,17],[8,17],[48,17],[45,17],[46,17],[47,17],[1,17],[49,17],[53,17],[55,50],[54,17],[57,17],[59,51],[61,52],[60,53],[58,51],[56,54],[63,55],[64,56],[66,57],[67,58],[68,56],[69,59],[70,60],[74,61],[65,56],[73,60],[62,62],[71,60],[72,63]],"latestChangedDtsFile":"./index.d.ts","version":"5.9.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluixi/ts-plugin",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.26",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Ibrahima Touré",
|
|
6
6
|
"private": false,
|
|
@@ -16,9 +16,17 @@
|
|
|
16
16
|
"LICENSE"
|
|
17
17
|
],
|
|
18
18
|
"main": "./dist/index.js",
|
|
19
|
+
"exports": {
|
|
20
|
+
"./package.json": "./package.json",
|
|
21
|
+
".": "./dist/index.js",
|
|
22
|
+
"./rules": {
|
|
23
|
+
"types": "./dist/rules.d.ts",
|
|
24
|
+
"default": "./dist/rules.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
19
27
|
"dependencies": {
|
|
20
28
|
"@fluixi/template-parser": "0.1.0-alpha.4",
|
|
21
|
-
"@fluixi/compiler": "1.0.0-alpha.
|
|
29
|
+
"@fluixi/compiler": "1.0.0-alpha.92"
|
|
22
30
|
},
|
|
23
31
|
"devDependencies": {
|
|
24
32
|
"esbuild": "^0.24.0",
|
|
@@ -31,7 +39,7 @@
|
|
|
31
39
|
"directory": "packages/ts-plugin"
|
|
32
40
|
},
|
|
33
41
|
"scripts": {
|
|
34
|
-
"build": "esbuild src/index.ts --bundle --platform=node --format=cjs --external:typescript --
|
|
42
|
+
"build": "tsc -p tsconfig.lib.json --emitDeclarationOnly && esbuild src/index.ts src/rules.ts --bundle --platform=node --format=cjs --external:typescript --outdir=dist",
|
|
35
43
|
"test": "vitest run"
|
|
36
44
|
}
|
|
37
45
|
}
|