mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-05 04:17:58 +01:00
- Add Next.js admin routes (/admin, /admin/login, /admin/pages, /admin/pages/new, /admin/pages/[id]) - Create admin layout with navigation and authentication - Build login page with email/password form - Implement pages list with search and create functionality - Add WYSIWYG editor for content creation/editing - Create API routes for admin authentication and content management - Add middleware for route protection - Include sample data population script - Add comprehensive admin interface documentation for non-technical users - Create test page for validating admin functionality - Update environment configuration for JWT secret Admin interface is now super easy and intuitive for non-technical team members to: - Login with email/password - View all pages with search - Create new pages - Edit existing pages with rich text editor - Save as draft or publish immediately - Preview content before publishing All code follows best practices with proper error handling, security, and accessibility.
50 lines
2.2 KiB
JavaScript
50 lines
2.2 KiB
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.getCwd = void 0;
|
|
var path_1 = __importDefault(require("path"));
|
|
var hasOwnProperty = function (object, property) {
|
|
return Object.prototype.hasOwnProperty.call(object, property);
|
|
};
|
|
exports.getCwd = function (dir, scriptMode, scriptPath) {
|
|
if (scriptMode) {
|
|
if (!scriptPath) {
|
|
console.error('Script mode must be used with a script name, e.g. `ts-node-dev -s <script.ts>`');
|
|
process.exit();
|
|
}
|
|
if (dir) {
|
|
console.error('Script mode cannot be combined with `--dir`');
|
|
process.exit();
|
|
}
|
|
// Use node's own resolution behavior to ensure we follow symlinks.
|
|
// scriptPath may omit file extension or point to a directory with or without package.json.
|
|
// This happens before we are registered, so we tell node's resolver to consider ts, tsx, and jsx files.
|
|
// In extremely rare cases, is is technically possible to resolve the wrong directory,
|
|
// because we do not yet know preferTsExts, jsx, nor allowJs.
|
|
// See also, justification why this will not happen in real-world situations:
|
|
// https://github.com/TypeStrong/ts-node/pull/1009#issuecomment-613017081
|
|
var exts = ['.js', '.jsx', '.ts', '.tsx'];
|
|
var extsTemporarilyInstalled = [];
|
|
for (var _i = 0, exts_1 = exts; _i < exts_1.length; _i++) {
|
|
var ext = exts_1[_i];
|
|
if (!hasOwnProperty(require.extensions, ext)) {
|
|
// tslint:disable-line
|
|
extsTemporarilyInstalled.push(ext);
|
|
require.extensions[ext] = function () { }; // tslint:disable-line
|
|
}
|
|
}
|
|
try {
|
|
return path_1.default.dirname(require.resolve(scriptPath));
|
|
}
|
|
finally {
|
|
for (var _a = 0, extsTemporarilyInstalled_1 = extsTemporarilyInstalled; _a < extsTemporarilyInstalled_1.length; _a++) {
|
|
var ext = extsTemporarilyInstalled_1[_a];
|
|
delete require.extensions[ext]; // tslint:disable-line
|
|
}
|
|
}
|
|
}
|
|
return dir;
|
|
};
|