arcanajs 5.1.0 → 6.0.0
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/cli/ArcanaJSBuild.d.ts +88 -0
- package/dist/cli/webpack-utils/entries.d.ts +24 -0
- package/dist/cli/webpack-utils/index.d.ts +4 -0
- package/dist/cli/webpack-utils/loaders.d.ts +103 -0
- package/dist/cli/webpack-utils/optimization.d.ts +45 -0
- package/dist/cli/webpack-utils/plugins.d.ts +36 -0
- package/dist/cli/webpack.config.d.ts +15 -2
- package/dist/development/arcanajs.auth.js +2768 -234
- package/dist/development/arcanajs.auth.js.map +1 -1
- package/dist/development/arcanajs.di.js.map +1 -1
- package/dist/development/arcanajs.js +937 -545
- package/dist/development/arcanajs.js.map +1 -1
- package/dist/development/arcanajs.mail.js +2142 -170
- package/dist/development/arcanajs.mail.js.map +1 -1
- package/dist/development/arcanajs.validator.js +2102 -370
- package/dist/development/arcanajs.validator.js.map +1 -1
- package/dist/development/arcanox.js +12186 -2033
- package/dist/development/arcanox.js.map +1 -1
- package/dist/development/cli/index.js +9382 -1720
- package/dist/development/cli/index.js.map +1 -1
- package/dist/development/lib/client/hmr-client.js +107 -25
- package/dist/development/lib/client/hmr-client.js.map +1 -1
- package/dist/development/src_lib_arcanox_adapters_MongoAdapter_ts.js +695 -127
- package/dist/development/src_lib_arcanox_adapters_MongoAdapter_ts.js.map +1 -1
- package/dist/development/src_lib_arcanox_adapters_MySQLAdapter_ts.js +507 -17
- package/dist/development/src_lib_arcanox_adapters_MySQLAdapter_ts.js.map +1 -1
- package/dist/development/src_lib_arcanox_adapters_PostgresAdapter_ts.js +625 -37
- package/dist/development/src_lib_arcanox_adapters_PostgresAdapter_ts.js.map +1 -1
- package/dist/lib/arcanox/Model.d.ts +520 -10
- package/dist/lib/arcanox/QueryBuilder.d.ts +252 -19
- package/dist/lib/arcanox/adapters/MongoAdapter.d.ts +61 -2
- package/dist/lib/arcanox/adapters/MySQLAdapter.d.ts +41 -3
- package/dist/lib/arcanox/adapters/PostgresAdapter.d.ts +41 -2
- package/dist/lib/arcanox/adapters/index.d.ts +6 -0
- package/dist/lib/arcanox/extensions/MongoExtensions.d.ts +108 -15
- package/dist/lib/arcanox/extensions/MySQLExtensions.d.ts +107 -0
- package/dist/lib/arcanox/extensions/PostgresExtensions.d.ts +126 -0
- package/dist/lib/arcanox/extensions/index.d.ts +46 -0
- package/dist/lib/arcanox/factory/Factory.d.ts +217 -6
- package/dist/lib/arcanox/factory/index.d.ts +1 -0
- package/dist/lib/arcanox/index.d.ts +22 -0
- package/dist/lib/arcanox/relations/BelongsTo.d.ts +82 -0
- package/dist/lib/arcanox/relations/BelongsToMany.d.ts +156 -0
- package/dist/lib/arcanox/relations/HasMany.d.ts +97 -0
- package/dist/lib/arcanox/relations/HasOne.d.ts +57 -0
- package/dist/lib/arcanox/relations/MorphMany.d.ts +118 -0
- package/dist/lib/arcanox/relations/MorphOne.d.ts +86 -0
- package/dist/lib/arcanox/relations/MorphTo.d.ts +87 -0
- package/dist/lib/arcanox/relations/Relation.d.ts +202 -0
- package/dist/lib/arcanox/relations/index.d.ts +11 -0
- package/dist/lib/arcanox/schema/Blueprint.d.ts +662 -30
- package/dist/lib/arcanox/schema/Migration.d.ts +487 -22
- package/dist/lib/arcanox/schema/Schema.d.ts +132 -8
- package/dist/lib/arcanox/schema/index.d.ts +2 -1
- package/dist/lib/arcanox/seeder/Seeder.d.ts +271 -1
- package/dist/lib/arcanox/seeder/index.d.ts +1 -1
- package/dist/lib/arcanox/support/ConnectionManager.d.ts +283 -0
- package/dist/lib/arcanox/support/QueryLogger.d.ts +291 -0
- package/dist/lib/arcanox/support/index.d.ts +8 -0
- package/dist/lib/arcanox/types.d.ts +377 -9
- package/dist/lib/auth/AuthProvider.d.ts +17 -1
- package/dist/lib/auth/JWTService.d.ts +102 -6
- package/dist/lib/auth/SessionManager.d.ts +78 -0
- package/dist/lib/auth/middleware/AuthMiddleware.d.ts +23 -0
- package/dist/lib/auth/middleware/AuthenticatedMiddleware.d.ts +36 -0
- package/dist/lib/auth/middleware/GuestMiddleware.d.ts +28 -0
- package/dist/lib/auth/middleware/RoleMiddleware.d.ts +60 -1
- package/dist/lib/auth/types/AuthConfig.d.ts +90 -1
- package/dist/lib/auth/types/JWTPayload.d.ts +54 -0
- package/dist/lib/auth/types/index.d.ts +40 -0
- package/dist/lib/auth/utils/PasswordHasher.d.ts +73 -8
- package/dist/lib/auth/utils/RateLimiter.d.ts +96 -0
- package/dist/lib/auth/utils/SecurityUtils.d.ts +190 -0
- package/dist/lib/auth/utils/TokenBlacklist.d.ts +68 -1
- package/dist/lib/client/hmr-client.d.ts +14 -1
- package/dist/lib/index.auth.d.ts +10 -7
- package/dist/lib/index.mail.d.ts +6 -4
- package/dist/lib/index.validator.d.ts +6 -3
- package/dist/lib/mail/MailService.d.ts +111 -6
- package/dist/lib/mail/Mailable.d.ts +164 -7
- package/dist/lib/mail/queue/MailQueue.d.ts +98 -6
- package/dist/lib/mail/types/MailConfig.d.ts +353 -5
- package/dist/lib/mail/utils/TemplateRenderer.d.ts +112 -1
- package/dist/lib/server/ArcanaJSServer.d.ts +45 -43
- package/dist/lib/server/ServiceProvider.d.ts +3 -3
- package/dist/lib/server/config/ConfigurationManager.d.ts +22 -0
- package/dist/lib/server/config/index.d.ts +2 -0
- package/dist/lib/server/config/types.d.ts +36 -0
- package/dist/lib/server/lifecycle/ServerLifecycle.d.ts +46 -0
- package/dist/lib/server/lifecycle/index.d.ts +1 -0
- package/dist/lib/server/middleware/MiddlewareManager.d.ts +58 -0
- package/dist/lib/server/middleware/index.d.ts +1 -0
- package/dist/lib/server/providers/ProviderManager.d.ts +35 -0
- package/dist/lib/server/providers/index.d.ts +1 -0
- package/dist/lib/server/types/IApplication.d.ts +10 -0
- package/dist/lib/server/types/index.d.ts +1 -0
- package/dist/lib/server/views/ViewsResolver.d.ts +32 -0
- package/dist/lib/server/views/index.d.ts +1 -0
- package/dist/lib/validation/ValidationException.d.ts +180 -3
- package/dist/lib/validation/Validator.d.ts +50 -42
- package/dist/lib/validation/http/FormRequest.d.ts +36 -8
- package/dist/lib/validation/http/JsonResource.d.ts +27 -8
- package/dist/lib/validation/http/Middleware.d.ts +14 -2
- package/dist/lib/validation/types.d.ts +452 -0
- package/dist/production/590.min.js +1 -1
- package/dist/production/590.min.js.map +1 -1
- package/dist/production/697.min.js +1 -1
- package/dist/production/697.min.js.map +1 -1
- package/dist/production/707.min.js +1 -1
- package/dist/production/707.min.js.map +1 -1
- package/dist/production/arcanajs.auth.min.js +1 -1
- package/dist/production/arcanajs.auth.min.js.map +1 -1
- package/dist/production/arcanajs.di.min.js.map +1 -1
- package/dist/production/arcanajs.mail.min.js +1 -1
- package/dist/production/arcanajs.mail.min.js.map +1 -1
- package/dist/production/arcanajs.min.js +1 -1
- package/dist/production/arcanajs.min.js.map +1 -1
- package/dist/production/arcanajs.validator.min.js +1 -1
- package/dist/production/arcanajs.validator.min.js.map +1 -1
- package/dist/production/arcanox.min.js +1 -1
- package/dist/production/arcanox.min.js.map +1 -1
- package/dist/production/cli/index.min.js +1 -1
- package/dist/production/cli/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export interface BuildOptions {
|
|
2
|
+
/** Enable verbose output */
|
|
3
|
+
verbose?: boolean;
|
|
4
|
+
/** Clean output before build */
|
|
5
|
+
clean?: boolean;
|
|
6
|
+
/** Analyze bundle (production only) */
|
|
7
|
+
analyze?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* ArcanaJS Build System
|
|
11
|
+
* Professional build system inspired by Next.js
|
|
12
|
+
*/
|
|
13
|
+
export declare class ArcanaJSBuild {
|
|
14
|
+
private cwd;
|
|
15
|
+
private serverProcess;
|
|
16
|
+
private wss;
|
|
17
|
+
private hmrPort;
|
|
18
|
+
private isServerBuilding;
|
|
19
|
+
private isClientBuilding;
|
|
20
|
+
private pendingReload;
|
|
21
|
+
private pendingCSSUpdate;
|
|
22
|
+
private buildStartTime;
|
|
23
|
+
private lastReloadTime;
|
|
24
|
+
private reloadDebounceMs;
|
|
25
|
+
private heartbeatInterval;
|
|
26
|
+
constructor(cwd?: string);
|
|
27
|
+
/**
|
|
28
|
+
* Production build - optimized and minified
|
|
29
|
+
*/
|
|
30
|
+
build(options?: BuildOptions): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Development mode with HMR and watch
|
|
33
|
+
*/
|
|
34
|
+
dev(options?: BuildOptions): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Start production server
|
|
37
|
+
*/
|
|
38
|
+
start(): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Clean build directory
|
|
41
|
+
*/
|
|
42
|
+
private cleanBuildDir;
|
|
43
|
+
/**
|
|
44
|
+
* Watch compiler with callbacks
|
|
45
|
+
*/
|
|
46
|
+
private watchCompiler;
|
|
47
|
+
/**
|
|
48
|
+
* Check if build only has CSS changes (no JS/TS changes)
|
|
49
|
+
*/
|
|
50
|
+
private isCSSOnlyChange;
|
|
51
|
+
/**
|
|
52
|
+
* Setup HMR WebSocket server
|
|
53
|
+
*/
|
|
54
|
+
private setupHMR;
|
|
55
|
+
/**
|
|
56
|
+
* Create WebSocket server with heartbeat
|
|
57
|
+
*/
|
|
58
|
+
private createWSS;
|
|
59
|
+
/**
|
|
60
|
+
* Start heartbeat interval to detect dead connections
|
|
61
|
+
*/
|
|
62
|
+
private startHeartbeat;
|
|
63
|
+
/**
|
|
64
|
+
* Broadcast build status to all connected clients
|
|
65
|
+
*/
|
|
66
|
+
private broadcastBuildStatus;
|
|
67
|
+
/**
|
|
68
|
+
* Broadcast reload to all connected clients (debounced)
|
|
69
|
+
*/
|
|
70
|
+
private broadcastReload;
|
|
71
|
+
/**
|
|
72
|
+
* Broadcast CSS update to all connected clients (no full reload)
|
|
73
|
+
*/
|
|
74
|
+
private broadcastCSSUpdate;
|
|
75
|
+
/**
|
|
76
|
+
* Start development server
|
|
77
|
+
*/
|
|
78
|
+
private startDevServer;
|
|
79
|
+
/**
|
|
80
|
+
* Start a new dev server process
|
|
81
|
+
*/
|
|
82
|
+
private startNewDevServer;
|
|
83
|
+
/**
|
|
84
|
+
* Setup graceful shutdown handlers
|
|
85
|
+
*/
|
|
86
|
+
private setupShutdownHandlers;
|
|
87
|
+
}
|
|
88
|
+
export default ArcanaJSBuild;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find entry file with supported extensions
|
|
3
|
+
*/
|
|
4
|
+
export declare function findEntry(searchPaths: string[]): string;
|
|
5
|
+
/**
|
|
6
|
+
* Generate views loader for webpack context
|
|
7
|
+
*/
|
|
8
|
+
export declare function generateViewsLoader(): string;
|
|
9
|
+
/**
|
|
10
|
+
* Get HMR client path if available
|
|
11
|
+
*/
|
|
12
|
+
export declare function getHmrClientPath(): string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Get client entry points
|
|
15
|
+
*/
|
|
16
|
+
export declare function getClientEntries(isProduction: boolean): Record<string, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Get server entry point
|
|
19
|
+
*/
|
|
20
|
+
export declare function getServerEntry(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Get common aliases for webpack resolve
|
|
23
|
+
*/
|
|
24
|
+
export declare function getCommonAliases(viewsLoaderPath: string): Record<string, string>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper to resolve loaders from the framework's node_modules
|
|
3
|
+
*/
|
|
4
|
+
export declare const resolveLoader: (loader: string) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Creates babel loader options optimized for performance
|
|
7
|
+
*/
|
|
8
|
+
export declare function createBabelLoaderOptions(isProduction: boolean): {
|
|
9
|
+
presets: (string | (string | {
|
|
10
|
+
useBuiltIns: boolean;
|
|
11
|
+
modules: boolean;
|
|
12
|
+
})[] | (string | {
|
|
13
|
+
runtime: string;
|
|
14
|
+
})[])[];
|
|
15
|
+
plugins: (string | (string | {
|
|
16
|
+
legacy: boolean;
|
|
17
|
+
})[] | (string | {
|
|
18
|
+
loose: boolean;
|
|
19
|
+
})[])[];
|
|
20
|
+
cacheDirectory: boolean;
|
|
21
|
+
cacheCompression: boolean;
|
|
22
|
+
compact: boolean;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Creates the TypeScript/JavaScript rule
|
|
26
|
+
*/
|
|
27
|
+
export declare function createTsRule(isProduction: boolean): {
|
|
28
|
+
test: RegExp;
|
|
29
|
+
include: string[];
|
|
30
|
+
exclude: RegExp[];
|
|
31
|
+
use: {
|
|
32
|
+
loader: string;
|
|
33
|
+
options: {
|
|
34
|
+
presets: (string | (string | {
|
|
35
|
+
useBuiltIns: boolean;
|
|
36
|
+
modules: boolean;
|
|
37
|
+
})[] | (string | {
|
|
38
|
+
runtime: string;
|
|
39
|
+
})[])[];
|
|
40
|
+
plugins: (string | (string | {
|
|
41
|
+
legacy: boolean;
|
|
42
|
+
})[] | (string | {
|
|
43
|
+
loose: boolean;
|
|
44
|
+
})[])[];
|
|
45
|
+
cacheDirectory: boolean;
|
|
46
|
+
cacheCompression: boolean;
|
|
47
|
+
compact: boolean;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Creates CSS module rule for client with HMR support
|
|
53
|
+
*/
|
|
54
|
+
export declare function createCssModuleRule(isProduction: boolean): {
|
|
55
|
+
test: RegExp;
|
|
56
|
+
use: any[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Creates global CSS rule for client with HMR support
|
|
60
|
+
*/
|
|
61
|
+
export declare function createGlobalCssRule(isProduction: boolean): {
|
|
62
|
+
test: RegExp;
|
|
63
|
+
exclude: RegExp;
|
|
64
|
+
use: any[];
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Creates CSS rules for server-side rendering
|
|
68
|
+
*/
|
|
69
|
+
export declare function createServerCssRules(isProduction: boolean): ({
|
|
70
|
+
test: RegExp;
|
|
71
|
+
use: {
|
|
72
|
+
loader: string;
|
|
73
|
+
options: {
|
|
74
|
+
modules: {
|
|
75
|
+
localIdentName: string;
|
|
76
|
+
exportLocalsConvention: string;
|
|
77
|
+
exportOnlyLocals: boolean;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
exclude?: undefined;
|
|
82
|
+
} | {
|
|
83
|
+
test: RegExp;
|
|
84
|
+
exclude: RegExp;
|
|
85
|
+
use: string;
|
|
86
|
+
})[];
|
|
87
|
+
/**
|
|
88
|
+
* Creates asset rules
|
|
89
|
+
*/
|
|
90
|
+
export declare function createAssetRule(emitFiles?: boolean): {
|
|
91
|
+
test: RegExp;
|
|
92
|
+
type: "asset/resource";
|
|
93
|
+
generator: {
|
|
94
|
+
emit: boolean;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Creates rule to ignore source map files
|
|
99
|
+
*/
|
|
100
|
+
export declare function createMapIgnoreRule(): {
|
|
101
|
+
test: RegExp;
|
|
102
|
+
use: string;
|
|
103
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import webpack from "webpack";
|
|
2
|
+
export interface CacheConfig {
|
|
3
|
+
type: "filesystem" | "memory";
|
|
4
|
+
name: string;
|
|
5
|
+
cacheDirectory: string;
|
|
6
|
+
buildDependencies: {
|
|
7
|
+
config: string[];
|
|
8
|
+
};
|
|
9
|
+
compression?: false | "gzip" | "brotli";
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Creates optimized cache configuration for webpack
|
|
13
|
+
* Inspired by Next.js build performance
|
|
14
|
+
*/
|
|
15
|
+
export declare function createCacheConfig(target: "client" | "server", isProduction: boolean): CacheConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Creates optimized resolve configuration
|
|
18
|
+
*/
|
|
19
|
+
export declare function createResolveConfig(aliases: Record<string, string>): {
|
|
20
|
+
extensions: string[];
|
|
21
|
+
alias: Record<string, string>;
|
|
22
|
+
symlinks: boolean;
|
|
23
|
+
cacheWithContext: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Creates optimized optimization configuration for development
|
|
27
|
+
*/
|
|
28
|
+
export declare function createDevOptimization(target?: "client" | "server"): webpack.Configuration["optimization"];
|
|
29
|
+
/**
|
|
30
|
+
* Creates optimized optimization configuration for production
|
|
31
|
+
*/
|
|
32
|
+
export declare function createProdOptimization(target: "client" | "server"): webpack.Configuration["optimization"];
|
|
33
|
+
/**
|
|
34
|
+
* Creates output configuration optimized for path info
|
|
35
|
+
*/
|
|
36
|
+
export declare function createOutputConfig(outputPath: string, isProduction: boolean, target: "client" | "server"): webpack.Configuration["output"];
|
|
37
|
+
/**
|
|
38
|
+
* Creates watch options optimized for performance
|
|
39
|
+
*/
|
|
40
|
+
export declare function createWatchOptions(): webpack.Configuration["watchOptions"];
|
|
41
|
+
/**
|
|
42
|
+
* Get devtool configuration based on environment
|
|
43
|
+
* eval-cheap-module-source-map is fastest for dev with good quality
|
|
44
|
+
*/
|
|
45
|
+
export declare function getDevtool(isProduction: boolean, target: "client" | "server"): webpack.Configuration["devtool"];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CleanWebpackPlugin } from "clean-webpack-plugin";
|
|
2
|
+
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
3
|
+
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
4
|
+
import webpack from "webpack";
|
|
5
|
+
/**
|
|
6
|
+
* Creates HTML plugin for client build
|
|
7
|
+
*/
|
|
8
|
+
export declare function createHtmlPlugin(isProduction: boolean): HtmlWebpackPlugin;
|
|
9
|
+
/**
|
|
10
|
+
* Creates CSS extraction plugin
|
|
11
|
+
*/
|
|
12
|
+
export declare function createCssPlugin(isProduction: boolean): MiniCssExtractPlugin;
|
|
13
|
+
/**
|
|
14
|
+
* Creates clean plugin (only for production)
|
|
15
|
+
*/
|
|
16
|
+
export declare function createCleanPlugin(): CleanWebpackPlugin;
|
|
17
|
+
/**
|
|
18
|
+
* Creates define plugin for environment variables
|
|
19
|
+
*/
|
|
20
|
+
export declare function createDefinePlugin(isProduction: boolean, target: "client" | "server"): webpack.DefinePlugin;
|
|
21
|
+
/**
|
|
22
|
+
* Creates progress plugin (dev only, minimal output)
|
|
23
|
+
*/
|
|
24
|
+
export declare function createProgressPlugin(): webpack.ProgressPlugin;
|
|
25
|
+
/**
|
|
26
|
+
* Creates ignore plugin for optional dependencies
|
|
27
|
+
*/
|
|
28
|
+
export declare function createIgnorePlugin(): webpack.IgnorePlugin;
|
|
29
|
+
/**
|
|
30
|
+
* Get all client plugins
|
|
31
|
+
*/
|
|
32
|
+
export declare function getClientPlugins(isProduction: boolean): webpack.WebpackPluginInstance[];
|
|
33
|
+
/**
|
|
34
|
+
* Get all server plugins
|
|
35
|
+
*/
|
|
36
|
+
export declare function getServerPlugins(isProduction: boolean): webpack.WebpackPluginInstance[];
|
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
import webpack from "webpack";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Creates optimized client webpack configuration
|
|
4
|
+
* Inspired by Next.js build performance
|
|
5
|
+
*/
|
|
6
|
+
export declare function createClientConfig(): webpack.Configuration;
|
|
7
|
+
/**
|
|
8
|
+
* Creates optimized server webpack configuration
|
|
9
|
+
*/
|
|
10
|
+
export declare function createServerConfig(): webpack.Configuration;
|
|
11
|
+
/**
|
|
12
|
+
* Creates multi-compiler configuration for parallel builds
|
|
13
|
+
* This builds both client and server simultaneously
|
|
14
|
+
*/
|
|
15
|
+
export declare function createMultiConfig(): webpack.Configuration[];
|
|
16
|
+
export { createClientConfig as getClientConfig, createServerConfig as getServerConfig, };
|