@batijs/cli 0.0.445 → 0.0.446
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/boilerplates/@batijs/auth0/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/auth0/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/authjs/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/aws/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/aws/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/aws/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/biome/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/cloudflare/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/cloudflare/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/compiled/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/compiled/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/d1/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/d1/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/d1/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/d1/files/$wrangler.toml.js +1 -1
- package/dist/boilerplates/@batijs/d1-sqlite/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/drizzle/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/drizzle/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/eslint/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/express/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/express/files/express-entry.ts +0 -11
- package/dist/boilerplates/@batijs/fastify/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/fastify/files/fastify-entry.ts +0 -11
- package/dist/boilerplates/@batijs/google-analytics/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/h3/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/h3/files/h3-entry.ts +0 -11
- package/dist/boilerplates/@batijs/hattip/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/hattip/files/hattip-entry.ts +0 -11
- package/dist/boilerplates/@batijs/hono/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/hono/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/hono/files/hono-entry.ts +0 -11
- package/dist/boilerplates/@batijs/mantine/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/mantine/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/panda-css/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/pnpm/files/$pnpm-workspace.yaml.js +1 -1
- package/dist/boilerplates/@batijs/prettier/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/prettier/files/.prettierignore +1 -4
- package/dist/boilerplates/@batijs/prisma/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/prisma/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/prisma/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/react/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/react/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/react/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/react/files/layouts/LayoutDefault.tsx +0 -1
- package/dist/boilerplates/@batijs/react/files/pages/+config.ts +1 -1
- package/dist/boilerplates/@batijs/react-sentry/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +1 -1
- package/dist/boilerplates/@batijs/shadcn-ui/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/shadcn-ui/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/shadcn-ui/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/shared/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/shared/files/gitignore +1 -4
- package/dist/boilerplates/@batijs/shared-server/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/solid/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/solid/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/solid/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/solid/files/layouts/LayoutDefault.tsx +0 -1
- package/dist/boilerplates/@batijs/solid/files/pages/+config.ts +1 -1
- package/dist/boilerplates/@batijs/solid-sentry/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/sqlite/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/sqlite/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/sqlite/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/trpc/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/trpc/types/trpc/client.d.ts +3 -3
- package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/vercel/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/vercel/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/vercel/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/vercel/files/pages/$+config.ts.js +1 -1
- package/dist/boilerplates/@batijs/vue/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/vue/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/vue/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/vue/files/layouts/LayoutDefault.vue +0 -2
- package/dist/boilerplates/@batijs/vue/files/pages/+config.ts +1 -1
- package/dist/boilerplates/@batijs/vue-sentry/files/$package.json.js +1 -1
- package/dist/boilerplates/boilerplates.json +0 -59
- package/dist/{chunk-YO6CY4MA.js → chunk-ZDDQD2BO.js} +9848 -9848
- package/dist/index.js +3 -21
- package/package.json +5 -5
- package/dist/boilerplates/@batijs/express/files/global.d.ts +0 -10
- package/dist/boilerplates/@batijs/fastify/files/global.d.ts +0 -10
- package/dist/boilerplates/@batijs/firebase-auth/files/$.env.js +0 -24
- package/dist/boilerplates/@batijs/firebase-auth/files/$README.md.js +0 -39
- package/dist/boilerplates/@batijs/firebase-auth/files/$package.json.js +0 -133
- package/dist/boilerplates/@batijs/firebase-auth/files/firebase/$service-account.json.js +0 -26
- package/dist/boilerplates/@batijs/firebase-auth/files/global.d.ts +0 -11
- package/dist/boilerplates/@batijs/firebase-auth/files/libs/firebaseAdmin.ts +0 -15
- package/dist/boilerplates/@batijs/firebase-auth/files/libs/firebaseUI.ts +0 -31
- package/dist/boilerplates/@batijs/firebase-auth/files/pages/+client.ts +0 -30
- package/dist/boilerplates/@batijs/firebase-auth/files/pages/login/+config.ts +0 -6
- package/dist/boilerplates/@batijs/firebase-auth/files/pages/login/+guard.ts +0 -11
- package/dist/boilerplates/@batijs/firebase-auth/files/server/firebase-auth-middleware.ts +0 -71
- package/dist/boilerplates/@batijs/firebase-auth/types/libs/firebaseAdmin.d.ts +0 -5
- package/dist/boilerplates/@batijs/firebase-auth/types/libs/firebaseUI.d.ts +0 -5
- package/dist/boilerplates/@batijs/firebase-auth/types/pages/+client.d.ts +0 -1
- package/dist/boilerplates/@batijs/firebase-auth/types/pages/login/+config.d.ts +0 -4
- package/dist/boilerplates/@batijs/firebase-auth/types/pages/login/+guard.d.ts +0 -3
- package/dist/boilerplates/@batijs/firebase-auth/types/server/firebase-auth-middleware.d.ts +0 -4
- package/dist/boilerplates/@batijs/h3/files/global.d.ts +0 -10
- package/dist/boilerplates/@batijs/hono/files/global.d.ts +0 -10
- package/dist/boilerplates/@batijs/react-firebase-auth/files/pages/login/+Page.tsx +0 -52
- package/dist/boilerplates/@batijs/react-firebase-auth/types/pages/login/+Page.d.ts +0 -3
- package/dist/boilerplates/@batijs/solid-firebase-auth/files/pages/login/+Page.tsx +0 -52
- package/dist/boilerplates/@batijs/solid-firebase-auth/types/pages/login/+Page.d.ts +0 -3
- package/dist/boilerplates/@batijs/vue-firebase-auth/files/pages/login/+Page.vue +0 -51
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
cst,
|
|
10
10
|
export_which,
|
|
11
11
|
wds
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZDDQD2BO.js";
|
|
13
13
|
import "./chunk-V7W2TXCE.js";
|
|
14
14
|
import {
|
|
15
15
|
__commonJS,
|
|
@@ -13808,7 +13808,7 @@ Please report this issue to https://github.com/vikejs/bati`
|
|
|
13808
13808
|
}
|
|
13809
13809
|
}
|
|
13810
13810
|
|
|
13811
|
-
// ../features/dist/chunk-
|
|
13811
|
+
// ../features/dist/chunk-KR6CA6DD.js
|
|
13812
13812
|
var features = [
|
|
13813
13813
|
// Vike
|
|
13814
13814
|
{
|
|
@@ -14037,24 +14037,6 @@ var features = [
|
|
|
14037
14037
|
}
|
|
14038
14038
|
]
|
|
14039
14039
|
},
|
|
14040
|
-
{
|
|
14041
|
-
category: "Auth",
|
|
14042
|
-
label: "Firebase",
|
|
14043
|
-
flag: "firebase-auth",
|
|
14044
|
-
image: "data:image/svg+xml;base64,PHN2ZyB4bW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MDE1bC0uOTMuOTgzbDExNS42MDcgNjQuNTQ4YTI0LjEyNiAyNC4xMjYgMCAwIDAgMjMuNTEzLjAwNWwxMTYuMjc1LTY0Ljg0N2wtLjI4NS0xLjc1MmwtMTE1Ljk5IDY0LjY4OVoiLz48L3N2Zz4=",
|
|
14045
|
-
url: "https://firebase.google.com",
|
|
14046
|
-
tagline: "Firebase Authentication aims to make building secure authentication systems easy, while improving the sign-in and onboarding experience for end users",
|
|
14047
|
-
links: [
|
|
14048
|
-
{
|
|
14049
|
-
label: "Getting started",
|
|
14050
|
-
href: "https://firebase.google.com/docs/web/setup"
|
|
14051
|
-
},
|
|
14052
|
-
{
|
|
14053
|
-
label: "API",
|
|
14054
|
-
href: "https://firebase.google.com/docs/reference"
|
|
14055
|
-
}
|
|
14056
|
-
]
|
|
14057
|
-
},
|
|
14058
14040
|
// RPC
|
|
14059
14041
|
{
|
|
14060
14042
|
category: "Data fetching",
|
|
@@ -16961,7 +16943,7 @@ var createDefaultQueryTester = function(query, options) {
|
|
|
16961
16943
|
// package.json
|
|
16962
16944
|
var package_default = {
|
|
16963
16945
|
name: "@batijs/cli",
|
|
16964
|
-
version: "0.0.
|
|
16946
|
+
version: "0.0.446",
|
|
16965
16947
|
type: "module",
|
|
16966
16948
|
scripts: {
|
|
16967
16949
|
"check-types": "tsc --noEmit",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@batijs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.446",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"description": "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"typescript": "^5.8.3",
|
|
21
21
|
"unplugin-purge-polyfills": "^0.1.0",
|
|
22
22
|
"vite": "^6.3.5",
|
|
23
|
-
"@batijs/
|
|
24
|
-
"@batijs/
|
|
23
|
+
"@batijs/compile": "0.0.446",
|
|
24
|
+
"@batijs/build": "0.0.446"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@batijs/
|
|
28
|
-
"@batijs/
|
|
27
|
+
"@batijs/core": "0.0.446",
|
|
28
|
+
"@batijs/features": "0.0.446"
|
|
29
29
|
},
|
|
30
30
|
"bin": "./dist/index.js",
|
|
31
31
|
"exports": {
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
3
|
-
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
bta
|
|
7
|
-
} from "../../../../chunk-YO6CY4MA.js";
|
|
8
|
-
import "../../../../chunk-V7W2TXCE.js";
|
|
9
|
-
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
|
-
|
|
11
|
-
// ../../boilerplates/firebase-auth/dist/files/$.env.js
|
|
12
|
-
async function getEnv(props) {
|
|
13
|
-
const envContent = await props.readfile?.();
|
|
14
|
-
return bta(
|
|
15
|
-
envContent,
|
|
16
|
-
"GOOGLE_APPLICATION_CREDENTIALS",
|
|
17
|
-
"firebase/service-account.json",
|
|
18
|
-
`Location of Your Firebase service account (use for firebase-admin).
|
|
19
|
-
Download the file from https://console.firebase.google.com/u/0/project/{firebase-project-id}/settings/serviceaccounts/adminsdk`
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
getEnv as default
|
|
24
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
3
|
-
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
ita
|
|
7
|
-
} from "../../../../chunk-YO6CY4MA.js";
|
|
8
|
-
import "../../../../chunk-V7W2TXCE.js";
|
|
9
|
-
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
|
-
|
|
11
|
-
// ../../boilerplates/firebase-auth/dist/files/$README.md.js
|
|
12
|
-
async function getReadme(props) {
|
|
13
|
-
const content = await ita(props);
|
|
14
|
-
const todo = `
|
|
15
|
-
## *Firebase*
|
|
16
|
-
- You first need to **[Create a Firebase project](https://firebase.google.com/docs/web/setup#create-project)**.
|
|
17
|
-
- Then register your app in the firebase console. **[Register your app](https://firebase.google.com/docs/web/setup#register-app)**
|
|
18
|
-
- Copy Your web app's Firebase configuration and paste in \`/pages/+client.ts\` Example :
|
|
19
|
-
\`\`\`ts
|
|
20
|
-
const firebaseConfig = {
|
|
21
|
-
apiKey: "",
|
|
22
|
-
authDomain: "",
|
|
23
|
-
projectId: "",
|
|
24
|
-
storageBucket: "",
|
|
25
|
-
messagingSenderId: "",
|
|
26
|
-
appId: "",
|
|
27
|
-
};
|
|
28
|
-
\`\`\`
|
|
29
|
-
- Download Your Firebase service account from [Your Firebase Project Settings > Service accounts](https://console.firebase.google.com/u/0/project/{firebase-project-id}/settings/serviceaccounts/adminsdk)
|
|
30
|
-
- Rename to service-account.json and move it to folder \`/firebase/\`.
|
|
31
|
-
- Read more about Firebase Auth at official [firebase auth docs](https://firebase.google.com/docs/auth)
|
|
32
|
-
- Read FirebaseUI at [firebaseui-web docs](https://github.com/firebase/firebaseui-web?tab=readme-ov-file#using-firebaseui-for-authentication)
|
|
33
|
-
`;
|
|
34
|
-
content.addMarkdownFeature(todo, "firebase-auth");
|
|
35
|
-
return content;
|
|
36
|
-
}
|
|
37
|
-
export {
|
|
38
|
-
getReadme as default
|
|
39
|
-
};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
3
|
-
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
ata
|
|
7
|
-
} from "../../../../chunk-YO6CY4MA.js";
|
|
8
|
-
import "../../../../chunk-V7W2TXCE.js";
|
|
9
|
-
import "../../../../chunk-DHZ7AZKP.js";
|
|
10
|
-
|
|
11
|
-
// ../../boilerplates/firebase-auth/dist/files/$package.json.js
|
|
12
|
-
var __create = Object.create;
|
|
13
|
-
var __defProp = Object.defineProperty;
|
|
14
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
16
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
17
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
19
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
20
|
-
};
|
|
21
|
-
var __copyProps = (to, from, except, desc) => {
|
|
22
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
-
for (let key of __getOwnPropNames(from))
|
|
24
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
25
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
26
|
-
}
|
|
27
|
-
return to;
|
|
28
|
-
};
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
-
mod
|
|
36
|
-
));
|
|
37
|
-
var require_package = __commonJS({
|
|
38
|
-
"package.json"(exports, module) {
|
|
39
|
-
module.exports = {
|
|
40
|
-
name: "@batijs/firebase-auth",
|
|
41
|
-
private: true,
|
|
42
|
-
version: "0.0.1",
|
|
43
|
-
description: "",
|
|
44
|
-
type: "module",
|
|
45
|
-
scripts: {
|
|
46
|
-
"check-types": "tsc --noEmit",
|
|
47
|
-
build: "bati-compile-boilerplate"
|
|
48
|
-
},
|
|
49
|
-
keywords: [],
|
|
50
|
-
author: "",
|
|
51
|
-
license: "MIT",
|
|
52
|
-
devDependencies: {
|
|
53
|
-
"@batijs/compile": "workspace:*",
|
|
54
|
-
"@types/node": "^18.19.111",
|
|
55
|
-
"@universal-middleware/core": "^0.4.8",
|
|
56
|
-
cookie: "^1.0.2",
|
|
57
|
-
dotenv: "^16.5.0",
|
|
58
|
-
firebase: "^11.9.1",
|
|
59
|
-
"firebase-admin": "^12.7.0",
|
|
60
|
-
firebaseui: "^6.1.0",
|
|
61
|
-
vike: "^0.4.231",
|
|
62
|
-
vite: "^6.3.5"
|
|
63
|
-
},
|
|
64
|
-
dependencies: {
|
|
65
|
-
"@batijs/core": "workspace:*"
|
|
66
|
-
},
|
|
67
|
-
files: [
|
|
68
|
-
"dist/"
|
|
69
|
-
],
|
|
70
|
-
bati: {
|
|
71
|
-
if: {
|
|
72
|
-
flag: "firebase-auth"
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
exports: {
|
|
76
|
-
"./libs/firebaseAdmin": {
|
|
77
|
-
types: "./dist/types/libs/firebaseAdmin.d.ts"
|
|
78
|
-
},
|
|
79
|
-
"./libs/firebaseUI": {
|
|
80
|
-
types: "./dist/types/libs/firebaseUI.d.ts"
|
|
81
|
-
},
|
|
82
|
-
"./pages/+client": {
|
|
83
|
-
types: "./dist/types/pages/+client.d.ts"
|
|
84
|
-
},
|
|
85
|
-
"./pages/login/+config": {
|
|
86
|
-
types: "./dist/types/pages/login/+config.d.ts"
|
|
87
|
-
},
|
|
88
|
-
"./pages/login/+guard": {
|
|
89
|
-
types: "./dist/types/pages/login/+guard.d.ts"
|
|
90
|
-
},
|
|
91
|
-
"./server/firebase-auth-middleware": {
|
|
92
|
-
types: "./dist/types/server/firebase-auth-middleware.d.ts"
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
typesVersions: {
|
|
96
|
-
"*": {
|
|
97
|
-
"libs/firebaseAdmin": [
|
|
98
|
-
"./dist/types/libs/firebaseAdmin.d.ts"
|
|
99
|
-
],
|
|
100
|
-
"libs/firebaseUI": [
|
|
101
|
-
"./dist/types/libs/firebaseUI.d.ts"
|
|
102
|
-
],
|
|
103
|
-
"pages/+client": [
|
|
104
|
-
"./dist/types/pages/+client.d.ts"
|
|
105
|
-
],
|
|
106
|
-
"pages/login/+config": [
|
|
107
|
-
"./dist/types/pages/login/+config.d.ts"
|
|
108
|
-
],
|
|
109
|
-
"pages/login/+guard": [
|
|
110
|
-
"./dist/types/pages/login/+guard.d.ts"
|
|
111
|
-
],
|
|
112
|
-
"server/firebase-auth-middleware": [
|
|
113
|
-
"./dist/types/server/firebase-auth-middleware.d.ts"
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
async function getPackageJson(props) {
|
|
121
|
-
const packageJson = await ata(props, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default));
|
|
122
|
-
return packageJson.addDependencies([
|
|
123
|
-
"firebase",
|
|
124
|
-
"firebase-admin",
|
|
125
|
-
"firebaseui",
|
|
126
|
-
"cookie",
|
|
127
|
-
"@universal-middleware/core",
|
|
128
|
-
"dotenv"
|
|
129
|
-
]);
|
|
130
|
-
}
|
|
131
|
-
export {
|
|
132
|
-
getPackageJson as default
|
|
133
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
3
|
-
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
|
-
|
|
5
|
-
import "../../../../../chunk-DHZ7AZKP.js";
|
|
6
|
-
|
|
7
|
-
// ../../boilerplates/firebase-auth/dist/files/firebase/$service-account.json.js
|
|
8
|
-
async function getPackageJson() {
|
|
9
|
-
const firebaseAccountStringified = process.env.TEST_FIREBASE_ACCOUNT;
|
|
10
|
-
return firebaseAccountStringified ? JSON.parse(firebaseAccountStringified) : {
|
|
11
|
-
type: "",
|
|
12
|
-
project_id: "",
|
|
13
|
-
private_key_id: "",
|
|
14
|
-
private_key: "",
|
|
15
|
-
client_email: "",
|
|
16
|
-
client_id: "",
|
|
17
|
-
auth_uri: "",
|
|
18
|
-
token_uri: "",
|
|
19
|
-
auth_provider_x509_cert_url: "",
|
|
20
|
-
client_x509_cert_url: "",
|
|
21
|
-
universe_domain: ""
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
getPackageJson as default
|
|
26
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import "dotenv/config";
|
|
2
|
-
import { applicationDefault, getApp, getApps, initializeApp, type App } from "firebase-admin/app";
|
|
3
|
-
import { getAuth } from "firebase-admin/auth";
|
|
4
|
-
|
|
5
|
-
let firebaseAdmin: App | undefined;
|
|
6
|
-
|
|
7
|
-
if (!getApps().length) {
|
|
8
|
-
firebaseAdmin = initializeApp({
|
|
9
|
-
credential: applicationDefault(),
|
|
10
|
-
});
|
|
11
|
-
} else {
|
|
12
|
-
firebaseAdmin = getApp();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { firebaseAdmin, getAuth };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { UserCredential } from "firebase/auth";
|
|
2
|
-
import firebase from "firebase/compat/app";
|
|
3
|
-
import * as firebaseui from "firebaseui";
|
|
4
|
-
|
|
5
|
-
type SessionLogin = (authResult: UserCredential) => Promise<void>;
|
|
6
|
-
|
|
7
|
-
function startFirebaseUI(ui: firebaseui.auth.AuthUI, sessionLogin?: SessionLogin) {
|
|
8
|
-
// Please read firebaseui docs at https://github.com/firebase/firebaseui-web
|
|
9
|
-
const uiCOnfig = {
|
|
10
|
-
callbacks: {
|
|
11
|
-
signInSuccessWithAuthResult(authResult: UserCredential) {
|
|
12
|
-
if (sessionLogin) {
|
|
13
|
-
sessionLogin(authResult);
|
|
14
|
-
// Don't redirect after firebase client successfully sign-in, let vike handle the rest.
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
return true;
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
signInFlow: "popup",
|
|
21
|
-
signInOptions: [
|
|
22
|
-
// Disable "Email enumeration protection" to be able to login with registered email address
|
|
23
|
-
// https://console.firebase.google.com/u/1/project/{project-id}/authentication/settings
|
|
24
|
-
firebase.auth.EmailAuthProvider.PROVIDER_ID,
|
|
25
|
-
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
|
|
26
|
-
],
|
|
27
|
-
};
|
|
28
|
-
return ui.start("#firebaseui-auth-container", uiCOnfig);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { startFirebaseUI };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Import the functions you need from the SDKs you need
|
|
2
|
-
import { deleteApp, getApp, getApps, initializeApp, type FirebaseApp } from "firebase/app";
|
|
3
|
-
import { getAuth, inMemoryPersistence } from "firebase/auth";
|
|
4
|
-
|
|
5
|
-
// TODO: Fill your web app's Firebase configuration
|
|
6
|
-
// See https://firebase.google.com/docs/web/learn-more?hl=fr#config-object
|
|
7
|
-
const firebaseConfig = {
|
|
8
|
-
apiKey: "",
|
|
9
|
-
authDomain: "",
|
|
10
|
-
projectId: "",
|
|
11
|
-
storageBucket: "",
|
|
12
|
-
messagingSenderId: "",
|
|
13
|
-
appId: "",
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
let firebaseApp: FirebaseApp | undefined;
|
|
17
|
-
// create a singleton client side firebaseApp
|
|
18
|
-
if (!getApps().length) {
|
|
19
|
-
firebaseApp = initializeApp(firebaseConfig);
|
|
20
|
-
} else {
|
|
21
|
-
firebaseApp = getApp();
|
|
22
|
-
deleteApp(firebaseApp);
|
|
23
|
-
firebaseApp = initializeApp(firebaseConfig);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const auth = getAuth(firebaseApp);
|
|
27
|
-
|
|
28
|
-
// As httpOnly cookies are to be used, do not persist any state client side.
|
|
29
|
-
// `inMemoryPersistence` is an implementation of Persistence of type 'NONE'.
|
|
30
|
-
auth.setPersistence(inMemoryPersistence);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// https://vike.dev/guard
|
|
2
|
-
import { redirect } from "vike/abort";
|
|
3
|
-
import type { GuardAsync } from "vike/types";
|
|
4
|
-
|
|
5
|
-
const guard: GuardAsync = async (pageContext): ReturnType<GuardAsync> => {
|
|
6
|
-
if (pageContext.user) {
|
|
7
|
-
throw redirect("/");
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export { guard };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { parse, serialize } from "cookie";
|
|
2
|
-
import { getAuth } from "firebase-admin/auth";
|
|
3
|
-
import { firebaseAdmin } from "../libs/firebaseAdmin";
|
|
4
|
-
// TODO: stop using universal-middleware and directly integrate server middlewares instead and/or use vike-server https://vike.dev/server. (Bati generates boilerplates that use universal-middleware https://github.com/magne4000/universal-middleware to make Bati's internal logic easier. This is temporary and will be removed soon.)
|
|
5
|
-
import type { Get, UniversalHandler, UniversalMiddleware } from "@universal-middleware/core";
|
|
6
|
-
|
|
7
|
-
export const firebaseAuthMiddleware: Get<[], UniversalMiddleware> = () => async (request, context) => {
|
|
8
|
-
if (!request.headers.has("cookie")) return;
|
|
9
|
-
|
|
10
|
-
const cookies = parse(request.headers.get("cookie")!);
|
|
11
|
-
const sessionCookie: string = cookies.__session || "";
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
const auth = getAuth(firebaseAdmin);
|
|
15
|
-
const decodedIdToken = await auth.verifySessionCookie(sessionCookie, true);
|
|
16
|
-
const user = await auth.getUser(decodedIdToken.sub);
|
|
17
|
-
return {
|
|
18
|
-
...context,
|
|
19
|
-
user,
|
|
20
|
-
};
|
|
21
|
-
} catch (error) {
|
|
22
|
-
console.debug("verifySessionCookie:", error);
|
|
23
|
-
return {
|
|
24
|
-
...context,
|
|
25
|
-
user: null,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const firebaseAuthLoginHandler: Get<[], UniversalHandler> = () => async (request) => {
|
|
31
|
-
const body = await request.json();
|
|
32
|
-
const idToken: string = (body as { idToken?: string }).idToken || "";
|
|
33
|
-
|
|
34
|
-
const expiresIn = 60 * 60 * 24 * 5 * 1000; // 5 days
|
|
35
|
-
|
|
36
|
-
try {
|
|
37
|
-
const sessionCookie = await getAuth(firebaseAdmin).createSessionCookie(idToken, { expiresIn });
|
|
38
|
-
|
|
39
|
-
const options = { maxAge: expiresIn / 1000, httpOnly: true, secure: true, path: "/" };
|
|
40
|
-
|
|
41
|
-
return new Response(JSON.stringify({ status: "success" }), {
|
|
42
|
-
status: 200,
|
|
43
|
-
headers: {
|
|
44
|
-
"content-type": "application/json",
|
|
45
|
-
"set-cookie": serialize("__session", sessionCookie, options),
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
} catch (error) {
|
|
49
|
-
console.error("createSessionCookie:", error);
|
|
50
|
-
|
|
51
|
-
return new Response("Unauthorized Request", {
|
|
52
|
-
status: 401,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const firebaseAuthLogoutHandler: Get<[], UniversalHandler> = () => async () => {
|
|
58
|
-
return new Response(JSON.stringify({ status: "success" }), {
|
|
59
|
-
status: 200,
|
|
60
|
-
headers: {
|
|
61
|
-
"content-type": "application/json",
|
|
62
|
-
"set-cookie": serialize("__session", "", {
|
|
63
|
-
maxAge: 0,
|
|
64
|
-
httpOnly: true,
|
|
65
|
-
secure: true,
|
|
66
|
-
expires: new Date(1),
|
|
67
|
-
path: "/",
|
|
68
|
-
}),
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { UserCredential } from "firebase/auth";
|
|
2
|
-
import * as firebaseui from "firebaseui";
|
|
3
|
-
type SessionLogin = (authResult: UserCredential) => Promise<void>;
|
|
4
|
-
declare function startFirebaseUI(ui: firebaseui.auth.AuthUI, sessionLogin?: SessionLogin): void;
|
|
5
|
-
export { startFirebaseUI };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Get, UniversalHandler, UniversalMiddleware } from "@universal-middleware/core";
|
|
2
|
-
export declare const firebaseAuthMiddleware: Get<[], UniversalMiddleware>;
|
|
3
|
-
export declare const firebaseAuthLoginHandler: Get<[], UniversalHandler>;
|
|
4
|
-
export declare const firebaseAuthLogoutHandler: Get<[], UniversalHandler>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import "firebaseui/dist/firebaseui.css";
|
|
2
|
-
import { startFirebaseUI } from "@batijs/firebase-auth/libs/firebaseUI";
|
|
3
|
-
import { getAuth, type UserCredential } from "firebase/auth";
|
|
4
|
-
import * as firebaseui from "firebaseui";
|
|
5
|
-
import { useEffect, useState } from "react";
|
|
6
|
-
import { reload } from "vike/client/router";
|
|
7
|
-
|
|
8
|
-
export default Page;
|
|
9
|
-
|
|
10
|
-
function Page() {
|
|
11
|
-
const [error, setError] = useState("");
|
|
12
|
-
|
|
13
|
-
async function sessionLogin(authResult: UserCredential) {
|
|
14
|
-
const idToken = (await authResult.user.getIdToken()) || "";
|
|
15
|
-
try {
|
|
16
|
-
const response = await fetch("/api/sessionLogin", {
|
|
17
|
-
method: "POST",
|
|
18
|
-
body: JSON.stringify({ idToken }),
|
|
19
|
-
headers: {
|
|
20
|
-
"Content-Type": "application/json",
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
if (response.ok) {
|
|
24
|
-
await reload();
|
|
25
|
-
} else {
|
|
26
|
-
setError(response.statusText);
|
|
27
|
-
}
|
|
28
|
-
await getAuth().signOut();
|
|
29
|
-
} catch (err) {
|
|
30
|
-
console.log("error :", err);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
const ui = firebaseui.auth.AuthUI.getInstance() || new firebaseui.auth.AuthUI(getAuth());
|
|
36
|
-
if (!error) {
|
|
37
|
-
startFirebaseUI(ui, sessionLogin);
|
|
38
|
-
}
|
|
39
|
-
}, [error]);
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<>
|
|
43
|
-
<div id="firebaseui-auth-container"></div>
|
|
44
|
-
{error && (
|
|
45
|
-
<>
|
|
46
|
-
<div style={{ color: "red" }}>There is an error occured : {error}</div>
|
|
47
|
-
<button onClick={() => setError("")}>Try Again</button>
|
|
48
|
-
</>
|
|
49
|
-
)}
|
|
50
|
-
</>
|
|
51
|
-
);
|
|
52
|
-
}
|