create-absolutejs 0.12.0 → 0.13.1
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/generators/project/generateAbsoluteAuthConfig.js +7 -1
- package/dist/generators/project/generateImportsBlock.js +1 -1
- package/dist/generators/project/generateRoutesBlock.js +2 -2
- package/dist/generators/project/generateServer.js +2 -1
- package/dist/types.d.ts +1 -70
- package/dist/utils/getPackageVersion.js +3 -1
- package/dist/versions.d.ts +3 -3
- package/dist/versions.js +3 -3
- package/package.json +2 -2
|
@@ -44,9 +44,13 @@ ${credentialsLines}
|
|
|
44
44
|
.join(',\n');
|
|
45
45
|
if (!hasDatabase) {
|
|
46
46
|
return `import { getEnv } from '@absolutejs/absolute';
|
|
47
|
-
import {
|
|
47
|
+
import {
|
|
48
|
+
AbsoluteAuthProps,
|
|
49
|
+
createInMemoryAuthSessionStore
|
|
50
|
+
} from '@absolutejs/auth';
|
|
48
51
|
|
|
49
52
|
export const absoluteAuthConfig = (): AbsoluteAuthProps => ({
|
|
53
|
+
authSessionStore: createInMemoryAuthSessionStore(),
|
|
50
54
|
providersConfiguration: {
|
|
51
55
|
${providerConfigs}
|
|
52
56
|
}
|
|
@@ -56,6 +60,7 @@ ${providerConfigs}
|
|
|
56
60
|
return `import { getEnv } from '@absolutejs/absolute';
|
|
57
61
|
import {
|
|
58
62
|
AbsoluteAuthProps,
|
|
63
|
+
createInMemoryAuthSessionStore,
|
|
59
64
|
extractPropFromIdentity,
|
|
60
65
|
instantiateUserSession,
|
|
61
66
|
providers
|
|
@@ -66,6 +71,7 @@ import { createUser, getUser } from '../handlers/userHandlers';
|
|
|
66
71
|
export const absoluteAuthConfig = (
|
|
67
72
|
db: DatabaseType
|
|
68
73
|
): AbsoluteAuthProps<User> => ({
|
|
74
|
+
authSessionStore: createInMemoryAuthSessionStore(),
|
|
69
75
|
providersConfiguration: {
|
|
70
76
|
${providerConfigs}
|
|
71
77
|
},
|
|
@@ -177,7 +177,7 @@ export const generateImportsBlock = ({ deps, flags, orm, authOption, databaseEng
|
|
|
177
177
|
rawImports.push(...noOrmImports[databaseEngine]);
|
|
178
178
|
}
|
|
179
179
|
if (authOption === 'abs')
|
|
180
|
-
rawImports.push(`import { absoluteAuthConfig } from './utils/absoluteAuthConfig'`, `import { t } from 'elysia'`, `import {
|
|
180
|
+
rawImports.push(`import { absoluteAuthConfig } from './utils/absoluteAuthConfig'`, `import { t } from 'elysia'`, `import { authClientOption, authIntentOption, getStatus, providers, ProviderOption, userSessionIdTypebox } from '@absolutejs/auth'`);
|
|
181
181
|
if (hasDatabase && (authOption === undefined || authOption === 'none'))
|
|
182
182
|
rawImports.push(`import { getCountHistory, createCountHistory } from './handlers/countHistoryHandlers'`, `import { t } from 'elysia'`);
|
|
183
183
|
const importMap = new Map();
|
|
@@ -3,7 +3,7 @@ export const generateRoutesBlock = ({ databaseEngine, frontendDirectories, authO
|
|
|
3
3
|
const hasDatabase = databaseEngine !== undefined && databaseEngine !== 'none';
|
|
4
4
|
const routes = [];
|
|
5
5
|
const wrap = (handlerCall, isAsync = false) => authOption === 'abs'
|
|
6
|
-
? `async ({ cookie: {
|
|
6
|
+
? `async ({ cookie: { auth_client, user_session_id }, store: { session }, status }) => {
|
|
7
7
|
const { user, error } = await getStatus(session, user_session_id);
|
|
8
8
|
|
|
9
9
|
if (error) {
|
|
@@ -11,7 +11,7 @@ export const generateRoutesBlock = ({ databaseEngine, frontendDirectories, authO
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const providerConfiguration =
|
|
14
|
-
|
|
14
|
+
auth_client.value && providers[auth_client.value as ProviderOption];
|
|
15
15
|
|
|
16
16
|
return ${handlerCall};
|
|
17
17
|
}`
|
|
@@ -53,7 +53,8 @@ export const generateServerFile = ({ tailwind, authOption, plugins, buildDirecto
|
|
|
53
53
|
.join('\n');
|
|
54
54
|
const guardBlock = `.guard({
|
|
55
55
|
cookie: t.Cookie({
|
|
56
|
-
|
|
56
|
+
auth_client: authClientOption,
|
|
57
|
+
auth_intent: authIntentOption,
|
|
57
58
|
user_session_id: userSessionIdTypebox
|
|
58
59
|
})
|
|
59
60
|
})`;
|
package/dist/types.d.ts
CHANGED
|
@@ -67,73 +67,4 @@ type DeepUndefined<T> = T extends object ? {
|
|
|
67
67
|
export type ArgumentConfiguration = {
|
|
68
68
|
[K in keyof CreateConfiguration]: DeepUndefined<CreateConfiguration[K]> | undefined;
|
|
69
69
|
};
|
|
70
|
-
export type PackageJson
|
|
71
|
-
name: string;
|
|
72
|
-
version: string;
|
|
73
|
-
description?: string;
|
|
74
|
-
keywords?: string[];
|
|
75
|
-
main?: string;
|
|
76
|
-
module?: string;
|
|
77
|
-
browser?: string | Record<string, string>;
|
|
78
|
-
types?: string;
|
|
79
|
-
typings?: string;
|
|
80
|
-
exports?: string | Record<string, string | Record<string, string>>;
|
|
81
|
-
imports?: Record<string, string>;
|
|
82
|
-
bin?: string | Record<string, string>;
|
|
83
|
-
files?: string[];
|
|
84
|
-
scripts?: Record<string, string>;
|
|
85
|
-
private?: boolean;
|
|
86
|
-
publishConfig?: {
|
|
87
|
-
registry?: string;
|
|
88
|
-
[key: string]: unknown;
|
|
89
|
-
};
|
|
90
|
-
dependencies?: Record<string, string>;
|
|
91
|
-
devDependencies?: Record<string, string>;
|
|
92
|
-
peerDependencies?: Record<string, string>;
|
|
93
|
-
optionalDependencies?: Record<string, string>;
|
|
94
|
-
bundledDependencies?: string[];
|
|
95
|
-
bundleDependencies?: string[];
|
|
96
|
-
engines?: {
|
|
97
|
-
node?: string;
|
|
98
|
-
npm?: string;
|
|
99
|
-
[key: string]: string | undefined;
|
|
100
|
-
};
|
|
101
|
-
os?: string[];
|
|
102
|
-
cpu?: string[];
|
|
103
|
-
workspaces?: string[] | {
|
|
104
|
-
packages: string[];
|
|
105
|
-
nohoist?: string[];
|
|
106
|
-
};
|
|
107
|
-
repository?: string | {
|
|
108
|
-
type?: 'git' | string;
|
|
109
|
-
url: string;
|
|
110
|
-
directory?: string;
|
|
111
|
-
};
|
|
112
|
-
bugs?: string | {
|
|
113
|
-
url?: string;
|
|
114
|
-
email?: string;
|
|
115
|
-
};
|
|
116
|
-
homepage?: string;
|
|
117
|
-
author?: string | {
|
|
118
|
-
name: string;
|
|
119
|
-
email?: string;
|
|
120
|
-
url?: string;
|
|
121
|
-
};
|
|
122
|
-
contributors?: Array<string | {
|
|
123
|
-
name: string;
|
|
124
|
-
email?: string;
|
|
125
|
-
url?: string;
|
|
126
|
-
}>;
|
|
127
|
-
license?: string;
|
|
128
|
-
funding?: string | Array<{
|
|
129
|
-
type?: string;
|
|
130
|
-
url: string;
|
|
131
|
-
}>;
|
|
132
|
-
preferGlobal?: boolean;
|
|
133
|
-
sideEffects?: boolean | string[];
|
|
134
|
-
config?: Record<string, unknown>;
|
|
135
|
-
resolution?: Record<string, string>;
|
|
136
|
-
resolutions?: Record<string, string>;
|
|
137
|
-
[customField: string]: unknown;
|
|
138
|
-
};
|
|
139
|
-
export {};
|
|
70
|
+
export type { PackageJson } from '@absolutejs/absolute';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
const h2IfHttps = (url) => url.startsWith('https://') ? { protocol: 'http2' } : {};
|
|
1
2
|
export const getPackageVersions = async (packageNames) => {
|
|
2
3
|
const results = await Promise.all(packageNames.map(async (name) => {
|
|
3
4
|
try {
|
|
4
|
-
const
|
|
5
|
+
const target = `https://registry.npmjs.org/${name}/latest`;
|
|
6
|
+
const res = await fetch(target, h2IfHttps(target));
|
|
5
7
|
const data = (await res.json());
|
|
6
8
|
return [name, data.version];
|
|
7
9
|
}
|
package/dist/versions.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Run `bun run check-versions` to compare against latest npm versions.
|
|
5
5
|
*/
|
|
6
6
|
export declare const versions: {
|
|
7
|
-
readonly '@absolutejs/absolute': "0.19.0-beta.
|
|
8
|
-
readonly '@absolutejs/auth': "0.22.
|
|
7
|
+
readonly '@absolutejs/absolute': "0.19.0-beta.1014";
|
|
8
|
+
readonly '@absolutejs/auth': "0.22.7";
|
|
9
9
|
readonly '@angular/common': "21.2.0";
|
|
10
10
|
readonly '@angular/compiler': "21.2.0";
|
|
11
11
|
readonly '@angular/compiler-cli': "21.2.0";
|
|
@@ -30,7 +30,7 @@ export declare const versions: {
|
|
|
30
30
|
readonly '@typescript-eslint/parser': "8.56.0";
|
|
31
31
|
readonly autoprefixer: "10.4.24";
|
|
32
32
|
readonly 'drizzle-orm': "0.45.1";
|
|
33
|
-
readonly elysia: "1.4.
|
|
33
|
+
readonly elysia: "1.4.28";
|
|
34
34
|
readonly 'elysia-rate-limit': "4.5.0";
|
|
35
35
|
readonly 'elysia-scoped-state': "0.1.1";
|
|
36
36
|
readonly eslint: "10.0.0";
|
package/dist/versions.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export const versions = {
|
|
7
7
|
/* ── Core ─────────────────────────────────────────────── */
|
|
8
|
-
'@absolutejs/absolute': '0.19.0-beta.
|
|
9
|
-
'@absolutejs/auth': '0.22.
|
|
8
|
+
'@absolutejs/absolute': '0.19.0-beta.1014',
|
|
9
|
+
'@absolutejs/auth': '0.22.7',
|
|
10
10
|
/* ── Angular ─────────────────────────────────────────── */
|
|
11
11
|
'@angular/common': '21.2.0',
|
|
12
12
|
'@angular/compiler': '21.2.0',
|
|
@@ -39,7 +39,7 @@ export const versions = {
|
|
|
39
39
|
autoprefixer: '10.4.24',
|
|
40
40
|
/* ── ORM ──────────────────────────────────────────────── */
|
|
41
41
|
'drizzle-orm': '0.45.1',
|
|
42
|
-
elysia: '1.4.
|
|
42
|
+
elysia: '1.4.28',
|
|
43
43
|
'elysia-rate-limit': '4.5.0',
|
|
44
44
|
'elysia-scoped-state': '0.1.1',
|
|
45
45
|
eslint: '10.0.0',
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"description": "A CLI tool to create a new AbsoluteJS project",
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@absolutejs/absolute": "0.19.0-beta.
|
|
13
|
+
"@absolutejs/absolute": "0.19.0-beta.1014",
|
|
14
14
|
"@eslint/compat": "2.0.2",
|
|
15
15
|
"@stylistic/eslint-plugin": "5.9.0",
|
|
16
16
|
"@types/bun": "1.3.8",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"typecheck": "bun run tsc --noEmit"
|
|
52
52
|
},
|
|
53
53
|
"type": "module",
|
|
54
|
-
"version": "0.
|
|
54
|
+
"version": "0.13.1"
|
|
55
55
|
}
|