@raketa-cloud/admin 0.0.8 → 0.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-cloud/admin",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "main": "src/index.js",
5
5
  "scripts": {
6
6
  "dev": "npx tailwindcss -i ./src/styles/application.css -o ../../apps/admin/static/application.css --watch",
package/src/Adapter.js CHANGED
@@ -1,5 +1,5 @@
1
+ import currentPath from "./currentPath.cjs";
1
2
  import { existsSync } from "node:fs";
2
- import nodePath from "node:path";
3
3
  import ejs from "ejs";
4
4
  import FormBuilder from "./helpers/FormBuilder";
5
5
  import HTMLBuilder from "./helpers/HTMLBuilder";
@@ -110,7 +110,7 @@ export default class Adapter {
110
110
  }
111
111
 
112
112
  getActionPath(resource, action) {
113
- const packagePath = `${nodePath.dirname(__filename)}/views/${resource}/${action}.ejs`;
113
+ const packagePath = `${currentPath}/views/${resource}/${action}.ejs`;
114
114
  const appPath = `${process.cwd()}/src/views/${resource}/${action}.ejs`;
115
115
 
116
116
  return existsSync(appPath) ? appPath : packagePath;
@@ -124,7 +124,7 @@ export default class Adapter {
124
124
  }
125
125
 
126
126
  async renderLayout(assigns, body) {
127
- const layoutTemplate = `${nodePath.dirname(__filename)}/views/layouts/application.ejs`;
127
+ const layoutTemplate = `${currentPath}/views/layouts/application.ejs`;
128
128
  return await ejs.renderFile(layoutTemplate, {
129
129
  ...assigns,
130
130
  body,
@@ -0,0 +1 @@
1
+ module.exports = __dirname;
@@ -1,7 +1,4 @@
1
- import { fileURLToPath } from "url";
2
- // const __filename = fileURLToPath(import.meta.url);
3
-
4
- import nodePath from "node:path";
1
+ import currentPath from "./currentPath.cjs";
5
2
  import ejs from "ejs";
6
3
  import { deleteCookie, getCookie, setCookie } from "hono/cookie";
7
4
  import AuthHelper from "./helpers/AuthHelper";
@@ -32,7 +29,7 @@ const setupAuthentication = (app, opts) => {
32
29
 
33
30
  app.get("/login", async (c) => {
34
31
  const googleURL = AuthHelper.getGoogleURL();
35
- const templatePath = `${nodePath.dirname(__filename)}/views/_auth/login.ejs`;
32
+ const templatePath = `${currentPath}/views/_auth/login.ejs`;
36
33
 
37
34
  const rendered = await ejs.renderFile(templatePath, {
38
35
  googleURL,