zudoku 0.0.2-dev.0 → 0.1.1-dev.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.
@@ -1,3 +0,0 @@
1
- import { PluginOption } from "vite";
2
- import { AuthenticationConfig } from "../config/config.js";
3
- export declare const authPlugin: (authConfig: AuthenticationConfig | undefined, distDir: string) => PluginOption;
@@ -1,28 +0,0 @@
1
- import path from "node:path";
2
- export const authPlugin = (authConfig, distDir) => {
3
- const virtualModuleId = "virtual:auth-plugin";
4
- const resolvedVirtualModuleId = "\0" + virtualModuleId;
5
- return {
6
- name: "zudoku-auth-plugin", // required, will show up in warnings and errors
7
- resolveId(id) {
8
- if (id === virtualModuleId) {
9
- return resolvedVirtualModuleId;
10
- }
11
- },
12
- load(id) {
13
- if (id === resolvedVirtualModuleId) {
14
- if (!authConfig) {
15
- return `export default null;`;
16
- }
17
- // TODO: Validate that the authConfig.type is a valid authentication provider
18
- return [
19
- `import config from "${path.join(distDir, "vite", "config.js")};`,
20
- `import authProvider from "${path.join(distDir, "authentication", `${authConfig.type}.js`)}";`,
21
- `const plugin = authProvider(config.authentication);`,
22
- `export default plugin;`,
23
- ].join("\n");
24
- }
25
- },
26
- };
27
- };
28
- //# sourceMappingURL=import-auth-plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"import-auth-plugin.js","sourceRoot":"","sources":["../../src/vite/import-auth-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,UAA4C,EAC5C,OAAe,EACD,EAAE;IAChB,MAAM,eAAe,GAAG,qBAAqB,CAAC;IAC9C,MAAM,uBAAuB,GAAG,IAAI,GAAG,eAAe,CAAC;IAEvD,OAAO;QACL,IAAI,EAAE,oBAAoB,EAAE,gDAAgD;QAC5E,SAAS,CAAC,EAAE;YACV,IAAI,EAAE,KAAK,eAAe,EAAE,CAAC;gBAC3B,OAAO,uBAAuB,CAAC;YACjC,CAAC;QACH,CAAC;QACD,IAAI,CAAC,EAAE;YACL,IAAI,EAAE,KAAK,uBAAuB,EAAE,CAAC;gBACnC,IAAI,CAAC,UAAU,EAAE,CAAC;oBAChB,OAAO,sBAAsB,CAAC;gBAChC,CAAC;gBACD,6EAA6E;gBAC7E,OAAO;oBACL,uBAAuB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG;oBACjE,6BAA6B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,IAAI,KAAK,CAAC,IAAI;oBAC9F,qDAAqD;oBACrD,wBAAwB;iBACzB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACf,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}