Updates build config and removes unused dependencies
Migrates from Brandi DI to @novadi/core dependency injection Simplifies project structure by removing deprecated modules Adds Novadi unplugin to esbuild configuration for enhanced build process
This commit is contained in:
parent
a80e4a7603
commit
10cb3792f4
17 changed files with 531 additions and 2016 deletions
18
build.js
18
build.js
|
|
@ -1,6 +1,7 @@
|
|||
import * as esbuild from 'esbuild';
|
||||
import { readdir, rename } from 'fs/promises';
|
||||
import { join, dirname, basename, extname } from 'path';
|
||||
import { NovadiUnplugin } from '@novadi/core/unplugin';
|
||||
|
||||
// Convert PascalCase to kebab-case
|
||||
function toKebabCase(str) {
|
||||
|
|
@ -10,16 +11,16 @@ function toKebabCase(str) {
|
|||
// Recursively rename files to kebab-case
|
||||
async function renameFiles(dir) {
|
||||
const entries = await readdir(dir, { withFileTypes: true });
|
||||
|
||||
|
||||
for (const entry of entries) {
|
||||
const fullPath = join(dir, entry.name);
|
||||
|
||||
|
||||
if (entry.isDirectory()) {
|
||||
await renameFiles(fullPath);
|
||||
} else if (entry.isFile() && extname(entry.name) === '.js') {
|
||||
const baseName = basename(entry.name, '.js');
|
||||
const kebabName = toKebabCase(baseName);
|
||||
|
||||
|
||||
if (baseName !== kebabName) {
|
||||
const newPath = join(dirname(fullPath), kebabName + '.js');
|
||||
await rename(fullPath, newPath);
|
||||
|
|
@ -31,7 +32,7 @@ async function renameFiles(dir) {
|
|||
// Build with esbuild
|
||||
async function build() {
|
||||
try {
|
||||
|
||||
|
||||
await esbuild.build({
|
||||
entryPoints: ['src/index.ts'],
|
||||
bundle: true,
|
||||
|
|
@ -41,14 +42,15 @@ async function build() {
|
|||
target: 'es2020',
|
||||
minify: false,
|
||||
keepNames: true,
|
||||
platform: 'browser'
|
||||
platform: 'browser',
|
||||
plugins: [NovadiUnplugin.esbuild({ debug: false, enableAutowiring: true, performanceLogging: true })]
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.error('Build failed:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
build();
|
||||
build();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue