@neondatabase/auth 0.2.0-beta.1 → 0.4.0-beta
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/LICENSE +201 -0
- package/README.md +22 -7
- package/codemods/migrate-auth-ui-imports.mjs +439 -0
- package/dist/{adapter-core-CnrOXh1T.d.mts → adapter-core-BWM7cWOp.d.mts} +465 -401
- package/dist/{adapter-core-CtmnMMJ7.mjs → adapter-core-Bt4M5I2g.mjs} +21 -11
- package/dist/auth-interface-Clz-oWq1.d.mts +8 -0
- package/dist/better-auth-helpers-Bkezghej.mjs +541 -0
- package/dist/{better-auth-react-adapter-DNi5PC5D.d.mts → better-auth-react-adapter-BDxJ65mF.d.mts} +389 -302
- package/dist/{better-auth-react-adapter-Dv-o6A6O.mjs → better-auth-react-adapter-aMv8WeDb.mjs} +1 -1
- package/dist/{index-CzsGMS7C.d.mts → index-DHryUj7e.d.mts} +0 -1
- package/dist/index.d.mts +94 -5
- package/dist/index.mjs +4 -3
- package/dist/{neon-auth-Cs2cWh1B.mjs → neon-auth-CS4FpK2X.mjs} +1 -1
- package/dist/next/index.d.mts +161 -73
- package/dist/next/index.mjs +5 -4
- package/dist/next/server/index.d.mts +25 -5
- package/dist/next/server/index.mjs +369 -251
- package/dist/react/adapters/index.d.mts +3 -3
- package/dist/react/adapters/index.mjs +2 -2
- package/dist/react/index.d.mts +6 -5
- package/dist/react/index.mjs +5 -5
- package/dist/react/ui/index.d.mts +1 -2
- package/dist/react/ui/index.mjs +2 -4
- package/dist/react/ui/server.mjs +2 -2
- package/dist/{supabase-adapter-DUqw2fw8.d.mts → supabase-adapter-BGwV0Vu2.d.mts} +429 -373
- package/dist/{supabase-adapter-BlcGPyOf.mjs → supabase-adapter-DBt4LJJd.mjs} +3 -514
- package/dist/types/index.d.mts +2 -2
- package/dist/ui/.safelist.html +1 -1
- package/dist/ui/css.css +2 -2
- package/dist/ui/theme.css +1 -1
- package/dist/ui-CnVnqGns.mjs +3 -0
- package/dist/vanilla/adapters/index.d.mts +4 -3
- package/dist/vanilla/adapters/index.mjs +2 -2
- package/dist/vanilla/index.d.mts +4 -3
- package/dist/vanilla/index.mjs +2 -2
- package/llms.txt +2 -2
- package/package.json +27 -21
- package/dist/chunk-VCZJYX65-CLnrj1o7-D6ZQkcc_.mjs +0 -543
- package/dist/constants-Cupc_bln.mjs +0 -28
- package/dist/neon-auth-BEGCfAe6.d.mts +0 -107
- package/dist/ui-COLWzDsu.mjs +0 -12469
- /package/dist/{adapters-B7YKkjaL.mjs → adapters-CUvhsAvY.mjs} +0 -0
- /package/dist/{index-CPnFzULh.d.mts → index-B0Pd4HOH.d.mts} +0 -0
- /package/dist/{index-OEBbnNdr.d.mts → index-CzpoWrv9.d.mts} +0 -0
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-undef */
|
|
3
|
+
import { existsSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
4
|
+
// eslint-disable-next-line unicorn/import-style
|
|
5
|
+
import { dirname, extname, join, resolve } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
|
|
8
|
+
const replacements = [
|
|
9
|
+
['@neondatabase/auth/react/ui/server', '@neondatabase/auth-ui/server'],
|
|
10
|
+
['@neondatabase/auth/react/ui', '@neondatabase/auth-ui'],
|
|
11
|
+
['@neondatabase/auth/ui/css', '@neondatabase/auth-ui/css'],
|
|
12
|
+
['@neondatabase/auth/ui/tailwind', '@neondatabase/auth-ui/tailwind'],
|
|
13
|
+
['@neondatabase/neon-js/auth/react/ui/server', '@neondatabase/auth-ui/server'],
|
|
14
|
+
['@neondatabase/neon-js/auth/react/ui', '@neondatabase/auth-ui'],
|
|
15
|
+
['@neondatabase/neon-js/ui/css', '@neondatabase/auth-ui/css'],
|
|
16
|
+
['@neondatabase/neon-js/ui/tailwind', '@neondatabase/auth-ui/tailwind'],
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const compatibilityReactSources = new Set([
|
|
20
|
+
'@neondatabase/auth/react',
|
|
21
|
+
'@neondatabase/neon-js/auth/react',
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
const authUiExports = new Set([
|
|
25
|
+
'AcceptInvitationCard',
|
|
26
|
+
'AccountSettingsCards',
|
|
27
|
+
'AccountView',
|
|
28
|
+
'AccountsCard',
|
|
29
|
+
'AppleIcon',
|
|
30
|
+
'AuthCallback',
|
|
31
|
+
'AuthForm',
|
|
32
|
+
'AuthLoading',
|
|
33
|
+
'AuthUIContext',
|
|
34
|
+
'AuthUIProvider',
|
|
35
|
+
'AuthView',
|
|
36
|
+
'ChangeEmailCard',
|
|
37
|
+
'ChangePasswordCard',
|
|
38
|
+
'CreateOrganizationDialog',
|
|
39
|
+
'CreateTeamDialog',
|
|
40
|
+
'DeleteAccountCard',
|
|
41
|
+
'DeleteOrganizationCard',
|
|
42
|
+
'DiscordIcon',
|
|
43
|
+
'DropboxIcon',
|
|
44
|
+
'FacebookIcon',
|
|
45
|
+
'ForgotPasswordForm',
|
|
46
|
+
'GitHubIcon',
|
|
47
|
+
'GitLabIcon',
|
|
48
|
+
'GoogleIcon',
|
|
49
|
+
'HuggingFaceIcon',
|
|
50
|
+
'InputFieldSkeleton',
|
|
51
|
+
'KickIcon',
|
|
52
|
+
'LinearIcon',
|
|
53
|
+
'LinkedInIcon',
|
|
54
|
+
'MagicLinkForm',
|
|
55
|
+
'MicrosoftIcon',
|
|
56
|
+
'NeonAuthUIProvider',
|
|
57
|
+
'NotionIcon',
|
|
58
|
+
'OrganizationCellView',
|
|
59
|
+
'OrganizationInvitationsCard',
|
|
60
|
+
'OrganizationLogo',
|
|
61
|
+
'OrganizationLogoCard',
|
|
62
|
+
'OrganizationMembersCard',
|
|
63
|
+
'OrganizationNameCard',
|
|
64
|
+
'OrganizationSettingsCards',
|
|
65
|
+
'OrganizationSlugCard',
|
|
66
|
+
'OrganizationSwitcher',
|
|
67
|
+
'OrganizationView',
|
|
68
|
+
'OrganizationsCard',
|
|
69
|
+
'PasskeysCard',
|
|
70
|
+
'PasswordInput',
|
|
71
|
+
'ProvidersCard',
|
|
72
|
+
'RecoverAccountForm',
|
|
73
|
+
'RedditIcon',
|
|
74
|
+
'RedirectToSignIn',
|
|
75
|
+
'RedirectToSignUp',
|
|
76
|
+
'ResetPasswordForm',
|
|
77
|
+
'RobloxIcon',
|
|
78
|
+
'SecuritySettingsCards',
|
|
79
|
+
'SessionsCard',
|
|
80
|
+
'SettingsCard',
|
|
81
|
+
'SettingsCellSkeleton',
|
|
82
|
+
'SignInForm',
|
|
83
|
+
'SignOut',
|
|
84
|
+
'SignUpForm',
|
|
85
|
+
'SignedIn',
|
|
86
|
+
'SignedOut',
|
|
87
|
+
'SlackIcon',
|
|
88
|
+
'TeamCell',
|
|
89
|
+
'TeamsCard',
|
|
90
|
+
'SpotifyIcon',
|
|
91
|
+
'TikTokIcon',
|
|
92
|
+
'TwoFactorCard',
|
|
93
|
+
'TwoFactorForm',
|
|
94
|
+
'TwitchIcon',
|
|
95
|
+
'UpdateAvatarCard',
|
|
96
|
+
'UpdateFieldCard',
|
|
97
|
+
'UpdateNameCard',
|
|
98
|
+
'UpdateUsernameCard',
|
|
99
|
+
'UserAvatar',
|
|
100
|
+
'UserButton',
|
|
101
|
+
'UserInvitationsCard',
|
|
102
|
+
'UserView',
|
|
103
|
+
'VKIcon',
|
|
104
|
+
'XIcon',
|
|
105
|
+
'ZoomIcon',
|
|
106
|
+
'accountViewPaths',
|
|
107
|
+
'authLocalization',
|
|
108
|
+
'authViewPaths',
|
|
109
|
+
'getViewByPath',
|
|
110
|
+
'organizationViewPaths',
|
|
111
|
+
'socialProviders',
|
|
112
|
+
'useAuthData',
|
|
113
|
+
'useAuthenticate',
|
|
114
|
+
'useCurrentOrganization',
|
|
115
|
+
'useTheme',
|
|
116
|
+
]);
|
|
117
|
+
|
|
118
|
+
const supportedExtensions = new Set([
|
|
119
|
+
'.cjs',
|
|
120
|
+
'.css',
|
|
121
|
+
'.js',
|
|
122
|
+
'.jsx',
|
|
123
|
+
'.md',
|
|
124
|
+
'.mdx',
|
|
125
|
+
'.mjs',
|
|
126
|
+
'.scss',
|
|
127
|
+
'.ts',
|
|
128
|
+
'.tsx',
|
|
129
|
+
]);
|
|
130
|
+
|
|
131
|
+
const ignoredDirectories = new Set([
|
|
132
|
+
'.git',
|
|
133
|
+
'.next',
|
|
134
|
+
'build',
|
|
135
|
+
'coverage',
|
|
136
|
+
'dist',
|
|
137
|
+
'node_modules',
|
|
138
|
+
]);
|
|
139
|
+
|
|
140
|
+
function parseArgs(argv) {
|
|
141
|
+
const options = {
|
|
142
|
+
check: false,
|
|
143
|
+
write: false,
|
|
144
|
+
verifyExports: false,
|
|
145
|
+
dependencyVersion: undefined,
|
|
146
|
+
targets: [],
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
for (const arg of argv) {
|
|
150
|
+
switch (arg) {
|
|
151
|
+
case '--check': {
|
|
152
|
+
options.check = true;
|
|
153
|
+
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
case '--write': {
|
|
157
|
+
options.write = true;
|
|
158
|
+
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
case '--verify-exports': {
|
|
162
|
+
options.verifyExports = true;
|
|
163
|
+
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
default: { if (arg.startsWith('--dependency-version=')) {
|
|
167
|
+
options.dependencyVersion = arg.slice('--dependency-version='.length);
|
|
168
|
+
} else if (arg === '--help' || arg === '-h') {
|
|
169
|
+
printHelp();
|
|
170
|
+
process.exit(0);
|
|
171
|
+
} else {
|
|
172
|
+
options.targets.push(arg);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (options.verifyExports) {
|
|
179
|
+
return options;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (options.check === options.write) {
|
|
183
|
+
throw new Error('Choose exactly one mode: --check or --write.');
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (options.targets.length === 0) {
|
|
187
|
+
options.targets.push('.');
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
options.dependencyVersion ??= getDefaultAuthUiDependencyVersion();
|
|
191
|
+
|
|
192
|
+
return options;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function printHelp() {
|
|
196
|
+
console.log(`Usage: neon-auth-codemod (--check|--write|--verify-exports) [paths...]
|
|
197
|
+
|
|
198
|
+
Migrates deprecated Neon Auth UI compatibility imports to @neondatabase/auth-ui.
|
|
199
|
+
|
|
200
|
+
Options:
|
|
201
|
+
--check Report files that need migration and exit non-zero.
|
|
202
|
+
--write Rewrite files in place and update nearest package.json files.
|
|
203
|
+
--verify-exports Check codemod UI symbol list against packages/auth/src/react/ui/index.ts.
|
|
204
|
+
--dependency-version=<version> Version added to package.json dependencies. Defaults to this package's @neondatabase/auth-ui dependency.
|
|
205
|
+
`);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function getDefaultAuthUiDependencyVersion() {
|
|
209
|
+
const currentFile = fileURLToPath(import.meta.url);
|
|
210
|
+
const packageJsonPath = resolve(dirname(currentFile), '..', 'package.json');
|
|
211
|
+
|
|
212
|
+
try {
|
|
213
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
|
|
214
|
+
const version = packageJson.dependencies?.['@neondatabase/auth-ui'];
|
|
215
|
+
if (typeof version === 'string' && !version.startsWith('workspace:')) {
|
|
216
|
+
return version;
|
|
217
|
+
}
|
|
218
|
+
} catch {
|
|
219
|
+
// Fall through to the stable default below.
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return '^0.1.0';
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function* walk(path) {
|
|
226
|
+
if (!existsSync(path)) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const stat = statSync(path);
|
|
231
|
+
if (stat.isFile()) {
|
|
232
|
+
if (supportedExtensions.has(extname(path))) {
|
|
233
|
+
yield path;
|
|
234
|
+
}
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (!stat.isDirectory()) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
for (const entry of readdirSync(path)) {
|
|
243
|
+
if (ignoredDirectories.has(entry)) {
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
yield* walk(join(path, entry));
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function rewriteText(text) {
|
|
251
|
+
let next = rewriteCompatibilityReactImports(text);
|
|
252
|
+
for (const [from, to] of replacements) {
|
|
253
|
+
next = next.split(from).join(to);
|
|
254
|
+
}
|
|
255
|
+
return next;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function rewriteCompatibilityReactImports(text) {
|
|
259
|
+
return text.replaceAll(
|
|
260
|
+
/import\s+(type\s+)?\{([^}]*)\}\s+from\s+(['"])(@neondatabase\/(?:auth\/react|neon-js\/auth\/react))\3;?/g,
|
|
261
|
+
(match, typeKeyword = '', specifierBlock, quote, source) => {
|
|
262
|
+
if (!compatibilityReactSources.has(source)) {
|
|
263
|
+
return match;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const specifiers = specifierBlock
|
|
267
|
+
.split(',')
|
|
268
|
+
.map((specifier) => specifier.trim())
|
|
269
|
+
.filter(Boolean);
|
|
270
|
+
const uiSpecifiers = [];
|
|
271
|
+
const remainingSpecifiers = [];
|
|
272
|
+
|
|
273
|
+
for (const specifier of specifiers) {
|
|
274
|
+
const importedName = specifier.split(/\s+as\s+/i)[0]?.replace(/^type\s+/, '').trim();
|
|
275
|
+
if (authUiExports.has(importedName)) {
|
|
276
|
+
uiSpecifiers.push(specifier);
|
|
277
|
+
} else {
|
|
278
|
+
remainingSpecifiers.push(specifier);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if (uiSpecifiers.length === 0) {
|
|
283
|
+
return match;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const statements = [
|
|
287
|
+
`import ${typeKeyword}{ ${uiSpecifiers.join(', ')} } from '@neondatabase/auth-ui';`,
|
|
288
|
+
];
|
|
289
|
+
|
|
290
|
+
if (remainingSpecifiers.length > 0) {
|
|
291
|
+
statements.push(
|
|
292
|
+
`import ${typeKeyword}{ ${remainingSpecifiers.join(', ')} } from ${quote}${source}${quote};`
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
return statements.join('\n');
|
|
297
|
+
}
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export function extractAuthUiValueExports(sourcePath) {
|
|
302
|
+
const source = readFileSync(sourcePath, 'utf8');
|
|
303
|
+
const exports = new Set();
|
|
304
|
+
|
|
305
|
+
for (const match of source.matchAll(/export\s+\{([^}]*)\}\s+from\s+['"]@neondatabase\/auth-ui['"]/g)) {
|
|
306
|
+
for (const specifier of match[1].split(',')) {
|
|
307
|
+
const name = specifier.trim().split(/\s+as\s+/i)[0]?.trim();
|
|
308
|
+
if (name) {
|
|
309
|
+
exports.add(name);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return exports;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export function findMissingAuthUiExports(sourcePath = resolve('packages/auth/src/react/ui/index.ts')) {
|
|
318
|
+
const sourceExports = extractAuthUiValueExports(sourcePath);
|
|
319
|
+
return [...sourceExports].filter((name) => !authUiExports.has(name)).toSorted();
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export function verifyAuthUiExports() {
|
|
323
|
+
const sourcePath = resolve('packages/auth/src/react/ui/index.ts');
|
|
324
|
+
const sourceExports = extractAuthUiValueExports(sourcePath);
|
|
325
|
+
const missing = findMissingAuthUiExports(sourcePath);
|
|
326
|
+
|
|
327
|
+
if (missing.length > 0) {
|
|
328
|
+
console.error(
|
|
329
|
+
`authUiExports is missing ${missing.length} value export(s) from ${sourcePath}:`
|
|
330
|
+
);
|
|
331
|
+
for (const name of missing) {
|
|
332
|
+
console.error(`- ${name}`);
|
|
333
|
+
}
|
|
334
|
+
process.exitCode = 1;
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
console.log(`authUiExports covers ${sourceExports.size} value export(s) from ${sourcePath}.`);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function findPackageJson(start) {
|
|
342
|
+
let current = resolve(statSync(start).isDirectory() ? start : join(start, '..'));
|
|
343
|
+
const root = resolve('/');
|
|
344
|
+
|
|
345
|
+
while (current !== root) {
|
|
346
|
+
const candidate = join(current, 'package.json');
|
|
347
|
+
if (existsSync(candidate)) {
|
|
348
|
+
return candidate;
|
|
349
|
+
}
|
|
350
|
+
current = resolve(current, '..');
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
function updatePackageJson(packageJsonPath, dependencyVersion) {
|
|
357
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
|
|
358
|
+
packageJson.dependencies ??= {};
|
|
359
|
+
|
|
360
|
+
if (packageJson.dependencies['@neondatabase/auth-ui']) {
|
|
361
|
+
return false;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
packageJson.dependencies['@neondatabase/auth-ui'] = dependencyVersion;
|
|
365
|
+
writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`);
|
|
366
|
+
return true;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function main() {
|
|
370
|
+
const options = parseArgs(process.argv.slice(2));
|
|
371
|
+
if (options.verifyExports) {
|
|
372
|
+
verifyAuthUiExports();
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
const changedFiles = [];
|
|
377
|
+
const packageJsons = new Set();
|
|
378
|
+
|
|
379
|
+
for (const target of options.targets.map((target) => resolve(target))) {
|
|
380
|
+
for (const file of walk(target)) {
|
|
381
|
+
const original = readFileSync(file, 'utf8');
|
|
382
|
+
const next = rewriteText(original);
|
|
383
|
+
if (next === original) {
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
changedFiles.push(file);
|
|
388
|
+
const packageJsonPath = findPackageJson(file);
|
|
389
|
+
if (packageJsonPath) {
|
|
390
|
+
packageJsons.add(packageJsonPath);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (options.write) {
|
|
394
|
+
writeFileSync(file, next);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
const changedPackageJsons = [];
|
|
400
|
+
if (options.write) {
|
|
401
|
+
for (const packageJsonPath of packageJsons) {
|
|
402
|
+
if (updatePackageJson(packageJsonPath, options.dependencyVersion)) {
|
|
403
|
+
changedPackageJsons.push(packageJsonPath);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
if (changedFiles.length === 0) {
|
|
409
|
+
console.log('No deprecated Neon Auth UI imports found.');
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
const mode = options.write ? 'Updated' : 'Would update';
|
|
414
|
+
console.log(`${mode} ${changedFiles.length} file(s):`);
|
|
415
|
+
for (const file of changedFiles) {
|
|
416
|
+
console.log(`- ${file}`);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
if (changedPackageJsons.length > 0) {
|
|
420
|
+
console.log(`\nAdded @neondatabase/auth-ui to ${changedPackageJsons.length} package.json file(s):`);
|
|
421
|
+
for (const packageJsonPath of changedPackageJsons) {
|
|
422
|
+
console.log(`- ${packageJsonPath}`);
|
|
423
|
+
}
|
|
424
|
+
console.log('\nRun your package manager install command to update the lockfile.');
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
if (options.check) {
|
|
428
|
+
process.exitCode = 1;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
433
|
+
try {
|
|
434
|
+
main();
|
|
435
|
+
} catch (error) {
|
|
436
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
437
|
+
process.exitCode = 1;
|
|
438
|
+
}
|
|
439
|
+
}
|