@ezetgalaxy/titan 26.9.1 → 26.9.2
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/README.md +17 -5
- package/index.js +177 -112
- package/package.json +17 -4
- package/templates/{js → common}/app/titan.d.ts +1 -1
- package/templates/rust-ts/app/actions/hello.ts +1 -1
- package/templates/rust-ts/titan/runtime.d.ts +1 -0
- package/templates/rust-ts/titan/runtime.js +1 -0
- package/templates/rust-ts/titan/titan.d.ts +117 -117
- package/templates/rust-ts/titan/titan.js +1 -1
- package/templates/ts/app/actions/hello.ts +1 -1
- package/templates/ts/titan/builder.js +121 -121
- package/templates/ts/titan/runtime.d.ts +1 -0
- package/templates/ts/titan/runtime.js +1 -1
- package/templates/ts/titan/titan.d.ts +117 -117
- package/templates/ts/titan/titan.js +1 -1
- package/templates/rust-js/Dockerfile +0 -66
- package/templates/rust-js/_dockerignore +0 -3
- package/templates/rust-js/_gitignore +0 -38
- package/templates/rust-js/app/titan.d.ts +0 -101
- package/templates/rust-ts/Dockerfile +0 -66
- package/templates/rust-ts/_dockerignore +0 -3
- package/templates/rust-ts/_gitignore +0 -38
- package/templates/ts/Dockerfile +0 -40
- package/templates/ts/_dockerignore +0 -3
- package/templates/ts/_gitignore +0 -38
- /package/templates/{js → common}/Dockerfile +0 -0
- /package/templates/{js → common}/_dockerignore +0 -0
- /package/templates/{js → common}/_gitignore +0 -0
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
// -- Module Definitions (for imports from "titan") --
|
|
3
|
-
|
|
4
|
-
export interface RouteHandler {
|
|
5
|
-
reply(value: any): void;
|
|
6
|
-
action(name: string): void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface TitanBuilder {
|
|
10
|
-
get(route: string): RouteHandler;
|
|
11
|
-
post(route: string): RouteHandler;
|
|
12
|
-
log(module: string, msg: string): void;
|
|
13
|
-
start(port?: number, msg?: string): Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// The default export from titan.js is the Builder
|
|
17
|
-
declare const builder: TitanBuilder;
|
|
18
|
-
export default builder;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Define a Titan Action with type inference.
|
|
22
|
-
*/
|
|
23
|
-
export declare function defineAction<T>(actionFn: (req: TitanRequest) => T): (req: TitanRequest) => T;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// -- Global Definitions (Runtime Environment) --
|
|
27
|
-
|
|
28
|
-
declare global {
|
|
29
|
-
/**
|
|
30
|
-
* The Titan Request Object passed to actions.
|
|
31
|
-
*/
|
|
32
|
-
interface TitanRequest {
|
|
33
|
-
body: any;
|
|
34
|
-
method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
35
|
-
path: string;
|
|
36
|
-
headers: {
|
|
37
|
-
host?: string;
|
|
38
|
-
"content-type"?: string;
|
|
39
|
-
"user-agent"?: string;
|
|
40
|
-
authorization?: string;
|
|
41
|
-
[key: string]: string | undefined;
|
|
42
|
-
};
|
|
43
|
-
params: Record<string, string>;
|
|
44
|
-
query: Record<string, string>;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
interface DbConnection {
|
|
48
|
-
/**
|
|
49
|
-
* Execute a SQL query.
|
|
50
|
-
* @param sql The SQL query string.
|
|
51
|
-
* @param params (Optional) Parameters for the query ($1, $2, etc).
|
|
52
|
-
*/
|
|
53
|
-
query(sql: string, params?: any[]): any[];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Global defineAction (available without import in runtime, though imports are preferred in TS)
|
|
58
|
-
*/
|
|
59
|
-
function defineAction<T>(actionFn: (req: TitanRequest) => T): (req: TitanRequest) => T;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Global Request Object
|
|
63
|
-
* Available automatically in actions.
|
|
64
|
-
*/
|
|
65
|
-
var req: TitanRequest;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Titan Runtime Utilities
|
|
69
|
-
* (Available globally in the runtime, e.g. inside actions)
|
|
70
|
-
*/
|
|
71
|
-
const t: {
|
|
72
|
-
/**
|
|
73
|
-
* Log messages to the server console with Titan formatting.
|
|
74
|
-
*/
|
|
75
|
-
log(...args: any[]): void;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Read a file contents as string.
|
|
79
|
-
* @param path Relative path to the file from project root.
|
|
80
|
-
*/
|
|
81
|
-
read(path: string): string;
|
|
82
|
-
|
|
83
|
-
fetch(url: string, options?: {
|
|
84
|
-
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
85
|
-
headers?: Record<string, string>;
|
|
86
|
-
body?: string | object;
|
|
87
|
-
}): {
|
|
88
|
-
ok: boolean;
|
|
89
|
-
status?: number;
|
|
90
|
-
body?: string;
|
|
91
|
-
error?: string;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
jwt: {
|
|
95
|
-
sign(
|
|
96
|
-
payload: object,
|
|
97
|
-
secret: string,
|
|
98
|
-
options?: { expiresIn?: string | number }
|
|
99
|
-
): string;
|
|
100
|
-
verify(token: string, secret: string): any;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
password: {
|
|
104
|
-
hash(password: string): string;
|
|
105
|
-
verify(password: string, hash: string): boolean;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
db: {
|
|
109
|
-
connect(url: string): DbConnection;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Titan Validator (Zod-compatible)
|
|
114
|
-
*/
|
|
115
|
-
valid: any;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
1
|
+
|
|
2
|
+
// -- Module Definitions (for imports from "titan") --
|
|
3
|
+
|
|
4
|
+
export interface RouteHandler {
|
|
5
|
+
reply(value: any): void;
|
|
6
|
+
action(name: string): void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface TitanBuilder {
|
|
10
|
+
get(route: string): RouteHandler;
|
|
11
|
+
post(route: string): RouteHandler;
|
|
12
|
+
log(module: string, msg: string): void;
|
|
13
|
+
start(port?: number, msg?: string): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// The default export from titan.js is the Builder
|
|
17
|
+
declare const builder: TitanBuilder;
|
|
18
|
+
export default builder;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Define a Titan Action with type inference.
|
|
22
|
+
*/
|
|
23
|
+
export declare function defineAction<T>(actionFn: (req: TitanRequest) => T): (req: TitanRequest) => T;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
// -- Global Definitions (Runtime Environment) --
|
|
27
|
+
|
|
28
|
+
declare global {
|
|
29
|
+
/**
|
|
30
|
+
* The Titan Request Object passed to actions.
|
|
31
|
+
*/
|
|
32
|
+
interface TitanRequest {
|
|
33
|
+
body: any;
|
|
34
|
+
method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
35
|
+
path: string;
|
|
36
|
+
headers: {
|
|
37
|
+
host?: string;
|
|
38
|
+
"content-type"?: string;
|
|
39
|
+
"user-agent"?: string;
|
|
40
|
+
authorization?: string;
|
|
41
|
+
[key: string]: string | undefined;
|
|
42
|
+
};
|
|
43
|
+
params: Record<string, string>;
|
|
44
|
+
query: Record<string, string>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface DbConnection {
|
|
48
|
+
/**
|
|
49
|
+
* Execute a SQL query.
|
|
50
|
+
* @param sql The SQL query string.
|
|
51
|
+
* @param params (Optional) Parameters for the query ($1, $2, etc).
|
|
52
|
+
*/
|
|
53
|
+
query(sql: string, params?: any[]): any[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Global defineAction (available without import in runtime, though imports are preferred in TS)
|
|
58
|
+
*/
|
|
59
|
+
function defineAction<T>(actionFn: (req: TitanRequest) => T): (req: TitanRequest) => T;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Global Request Object
|
|
63
|
+
* Available automatically in actions.
|
|
64
|
+
*/
|
|
65
|
+
var req: TitanRequest;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Titan Runtime Utilities
|
|
69
|
+
* (Available globally in the runtime, e.g. inside actions)
|
|
70
|
+
*/
|
|
71
|
+
const t: {
|
|
72
|
+
/**
|
|
73
|
+
* Log messages to the server console with Titan formatting.
|
|
74
|
+
*/
|
|
75
|
+
log(...args: any[]): void;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Read a file contents as string.
|
|
79
|
+
* @param path Relative path to the file from project root.
|
|
80
|
+
*/
|
|
81
|
+
read(path: string): string;
|
|
82
|
+
|
|
83
|
+
fetch(url: string, options?: {
|
|
84
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
85
|
+
headers?: Record<string, string>;
|
|
86
|
+
body?: string | object;
|
|
87
|
+
}): {
|
|
88
|
+
ok: boolean;
|
|
89
|
+
status?: number;
|
|
90
|
+
body?: string;
|
|
91
|
+
error?: string;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
jwt: {
|
|
95
|
+
sign(
|
|
96
|
+
payload: object,
|
|
97
|
+
secret: string,
|
|
98
|
+
options?: { expiresIn?: string | number }
|
|
99
|
+
): string;
|
|
100
|
+
verify(token: string, secret: string): any;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
password: {
|
|
104
|
+
hash(password: string): string;
|
|
105
|
+
verify(password: string, hash: string): boolean;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
db: {
|
|
109
|
+
connect(url: string): DbConnection;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Titan Validator (Zod-compatible)
|
|
114
|
+
*/
|
|
115
|
+
valid: any;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# ================================================================
|
|
2
|
-
# STAGE 1 — Build Titan (JS → Rust)
|
|
3
|
-
# ================================================================
|
|
4
|
-
FROM rust:1.91.1 AS builder
|
|
5
|
-
|
|
6
|
-
# Install Node for Titan CLI + bundler
|
|
7
|
-
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
|
8
|
-
&& apt-get install -y nodejs
|
|
9
|
-
|
|
10
|
-
# Install Titan CLI (latest)
|
|
11
|
-
RUN npm install -g @ezetgalaxy/titan@latest
|
|
12
|
-
|
|
13
|
-
WORKDIR /app
|
|
14
|
-
|
|
15
|
-
# Copy project files
|
|
16
|
-
COPY . .
|
|
17
|
-
|
|
18
|
-
# Install JS dependencies (needed for Titan DSL + bundler)
|
|
19
|
-
RUN npm install
|
|
20
|
-
|
|
21
|
-
SHELL ["/bin/bash", "-c"]
|
|
22
|
-
|
|
23
|
-
# Extract Titan extensions into .ext
|
|
24
|
-
RUN mkdir -p /app/.ext && \
|
|
25
|
-
find /app/node_modules -maxdepth 5 -type f -name "titan.json" -print0 | \
|
|
26
|
-
while IFS= read -r -d '' file; do \
|
|
27
|
-
pkg_dir="$(dirname "$file")"; \
|
|
28
|
-
pkg_name="$(basename "$pkg_dir")"; \
|
|
29
|
-
echo "Copying Titan extension: $pkg_name from $pkg_dir"; \
|
|
30
|
-
cp -r "$pkg_dir" "/app/.ext/$pkg_name"; \
|
|
31
|
-
done && \
|
|
32
|
-
echo "Extensions in .ext:" && \
|
|
33
|
-
ls -R /app/.ext
|
|
34
|
-
|
|
35
|
-
# Build Titan metadata + bundle JS actions
|
|
36
|
-
RUN titan build
|
|
37
|
-
|
|
38
|
-
# Build Rust binary
|
|
39
|
-
RUN cd server && cargo build --release
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
# ================================================================
|
|
44
|
-
# STAGE 2 — Runtime Image (Lightweight)
|
|
45
|
-
# ================================================================
|
|
46
|
-
FROM debian:stable-slim
|
|
47
|
-
|
|
48
|
-
WORKDIR /app
|
|
49
|
-
|
|
50
|
-
# Copy Rust binary from builder stage
|
|
51
|
-
COPY --from=builder /app/server/target/release/titan-server ./titan-server
|
|
52
|
-
|
|
53
|
-
# Copy Titan routing metadata
|
|
54
|
-
COPY --from=builder /app/server/routes.json ./routes.json
|
|
55
|
-
COPY --from=builder /app/server/action_map.json ./action_map.json
|
|
56
|
-
|
|
57
|
-
# Copy Titan JS bundles
|
|
58
|
-
RUN mkdir -p /app/actions
|
|
59
|
-
COPY --from=builder /app/server/actions /app/actions
|
|
60
|
-
|
|
61
|
-
# Copy only Titan extensions
|
|
62
|
-
COPY --from=builder /app/.ext ./.ext
|
|
63
|
-
|
|
64
|
-
EXPOSE 3000
|
|
65
|
-
|
|
66
|
-
CMD ["./titan-server"]
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Node & Packages
|
|
2
|
-
node_modules/
|
|
3
|
-
npm-debug.log*
|
|
4
|
-
yarn-debug.log*
|
|
5
|
-
yarn-error.log*
|
|
6
|
-
package-lock.json
|
|
7
|
-
yarn.lock
|
|
8
|
-
|
|
9
|
-
# Titan Runtime (Auto-generated - DO NOT COMMIT)
|
|
10
|
-
titan/server-bin*
|
|
11
|
-
.titan/
|
|
12
|
-
.ext/
|
|
13
|
-
server/routes.json
|
|
14
|
-
server/action_map.json
|
|
15
|
-
server/actions/
|
|
16
|
-
server/titan/
|
|
17
|
-
server/src/actions_rust/
|
|
18
|
-
|
|
19
|
-
# Rust Build Artifacts
|
|
20
|
-
server/target/
|
|
21
|
-
Cargo.lock
|
|
22
|
-
|
|
23
|
-
# OS Files
|
|
24
|
-
.DS_Store
|
|
25
|
-
Thumbs.db
|
|
26
|
-
*.tmp
|
|
27
|
-
*.bak
|
|
28
|
-
|
|
29
|
-
# Environment & Secrets
|
|
30
|
-
.env
|
|
31
|
-
.env.local
|
|
32
|
-
.env.*.local
|
|
33
|
-
|
|
34
|
-
# IDEs
|
|
35
|
-
.vscode/
|
|
36
|
-
.idea/
|
|
37
|
-
*.swp
|
|
38
|
-
*.swo
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
export { };
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
/**
|
|
5
|
-
* TITAN TYPE DEFINITIONS
|
|
6
|
-
* ----------------------
|
|
7
|
-
* These types are globally available in your Titan project.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The Titan Request Object passed to actions.
|
|
12
|
-
*/
|
|
13
|
-
interface TitanRequest {
|
|
14
|
-
body: any;
|
|
15
|
-
method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
16
|
-
path: string;
|
|
17
|
-
headers: {
|
|
18
|
-
host?: string;
|
|
19
|
-
"content-type"?: string;
|
|
20
|
-
"user-agent"?: string;
|
|
21
|
-
authorization?: string;
|
|
22
|
-
[key: string]: string | undefined;
|
|
23
|
-
};
|
|
24
|
-
params: Record<string, string>;
|
|
25
|
-
query: Record<string, string>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface DbConnection {
|
|
29
|
-
/**
|
|
30
|
-
* Execute a SQL query.
|
|
31
|
-
* @param sql The SQL query string.
|
|
32
|
-
* @param params (Optional) Parameters for the query ($1, $2, etc).
|
|
33
|
-
*/
|
|
34
|
-
query(sql: string, params?: any[]): any[];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Define a Titan Action with type inference.
|
|
39
|
-
* @example
|
|
40
|
-
* export const hello = defineAction((req) => {
|
|
41
|
-
* return req.headers;
|
|
42
|
-
* });
|
|
43
|
-
*/
|
|
44
|
-
function defineAction<T>(actionFn: (req: TitanRequest) => T): (req: TitanRequest) => T;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Titan Runtime Utilities
|
|
48
|
-
*/
|
|
49
|
-
const t: {
|
|
50
|
-
/**
|
|
51
|
-
* Log messages to the server console with Titan formatting.
|
|
52
|
-
*/
|
|
53
|
-
log(...args: any[]): void;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Read a file contents as string.
|
|
57
|
-
* @param path Relative path to the file from project root.
|
|
58
|
-
*/
|
|
59
|
-
read(path: string): string;
|
|
60
|
-
|
|
61
|
-
fetch(url: string, options?: {
|
|
62
|
-
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
63
|
-
headers?: Record<string, string>;
|
|
64
|
-
body?: string | object;
|
|
65
|
-
}): {
|
|
66
|
-
ok: boolean;
|
|
67
|
-
status?: number;
|
|
68
|
-
body?: string;
|
|
69
|
-
error?: string;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
jwt: {
|
|
73
|
-
sign(
|
|
74
|
-
payload: object,
|
|
75
|
-
secret: string,
|
|
76
|
-
options?: { expiresIn?: string | number }
|
|
77
|
-
): string;
|
|
78
|
-
verify(token: string, secret: string): any;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
password: {
|
|
82
|
-
hash(password: string): string;
|
|
83
|
-
verify(password: string, hash: string): boolean;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
db: {
|
|
87
|
-
connect(url: string): DbConnection;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Titan Validator (Zod-compatible)
|
|
92
|
-
*/
|
|
93
|
-
valid: typeof import("@titanpl/valid");
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Global Request Object
|
|
98
|
-
* Available automatically in actions.
|
|
99
|
-
*/
|
|
100
|
-
var req: TitanRequest;
|
|
101
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# ================================================================
|
|
2
|
-
# STAGE 1 — Build Titan (JS → Rust)
|
|
3
|
-
# ================================================================
|
|
4
|
-
FROM rust:1.91.1 AS builder
|
|
5
|
-
|
|
6
|
-
# Install Node for Titan CLI + bundler
|
|
7
|
-
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
|
8
|
-
&& apt-get install -y nodejs
|
|
9
|
-
|
|
10
|
-
# Install Titan CLI (latest)
|
|
11
|
-
RUN npm install -g @ezetgalaxy/titan@latest
|
|
12
|
-
|
|
13
|
-
WORKDIR /app
|
|
14
|
-
|
|
15
|
-
# Copy project files
|
|
16
|
-
COPY . .
|
|
17
|
-
|
|
18
|
-
# Install JS dependencies (needed for Titan DSL + bundler)
|
|
19
|
-
RUN npm install
|
|
20
|
-
|
|
21
|
-
SHELL ["/bin/bash", "-c"]
|
|
22
|
-
|
|
23
|
-
# Extract Titan extensions into .ext
|
|
24
|
-
RUN mkdir -p /app/.ext && \
|
|
25
|
-
find /app/node_modules -maxdepth 5 -type f -name "titan.json" -print0 | \
|
|
26
|
-
while IFS= read -r -d '' file; do \
|
|
27
|
-
pkg_dir="$(dirname "$file")"; \
|
|
28
|
-
pkg_name="$(basename "$pkg_dir")"; \
|
|
29
|
-
echo "Copying Titan extension: $pkg_name from $pkg_dir"; \
|
|
30
|
-
cp -r "$pkg_dir" "/app/.ext/$pkg_name"; \
|
|
31
|
-
done && \
|
|
32
|
-
echo "Extensions in .ext:" && \
|
|
33
|
-
ls -R /app/.ext
|
|
34
|
-
|
|
35
|
-
# Build Titan metadata + bundle JS actions
|
|
36
|
-
RUN titan build
|
|
37
|
-
|
|
38
|
-
# Build Rust binary
|
|
39
|
-
RUN cd server && cargo build --release
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
# ================================================================
|
|
44
|
-
# STAGE 2 — Runtime Image (Lightweight)
|
|
45
|
-
# ================================================================
|
|
46
|
-
FROM debian:stable-slim
|
|
47
|
-
|
|
48
|
-
WORKDIR /app
|
|
49
|
-
|
|
50
|
-
# Copy Rust binary from builder stage
|
|
51
|
-
COPY --from=builder /app/server/target/release/titan-server ./titan-server
|
|
52
|
-
|
|
53
|
-
# Copy Titan routing metadata
|
|
54
|
-
COPY --from=builder /app/server/routes.json ./routes.json
|
|
55
|
-
COPY --from=builder /app/server/action_map.json ./action_map.json
|
|
56
|
-
|
|
57
|
-
# Copy Titan JS bundles
|
|
58
|
-
RUN mkdir -p /app/actions
|
|
59
|
-
COPY --from=builder /app/server/actions /app/actions
|
|
60
|
-
|
|
61
|
-
# Copy only Titan extensions
|
|
62
|
-
COPY --from=builder /app/.ext ./.ext
|
|
63
|
-
|
|
64
|
-
EXPOSE 3000
|
|
65
|
-
|
|
66
|
-
CMD ["./titan-server"]
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Node & Packages
|
|
2
|
-
node_modules/
|
|
3
|
-
npm-debug.log*
|
|
4
|
-
yarn-debug.log*
|
|
5
|
-
yarn-error.log*
|
|
6
|
-
package-lock.json
|
|
7
|
-
yarn.lock
|
|
8
|
-
|
|
9
|
-
# Titan Runtime (Auto-generated - DO NOT COMMIT)
|
|
10
|
-
titan/server-bin*
|
|
11
|
-
.titan/
|
|
12
|
-
.ext/
|
|
13
|
-
server/routes.json
|
|
14
|
-
server/action_map.json
|
|
15
|
-
server/actions/
|
|
16
|
-
server/titan/
|
|
17
|
-
server/src/actions_rust/
|
|
18
|
-
|
|
19
|
-
# Rust Build Artifacts
|
|
20
|
-
server/target/
|
|
21
|
-
Cargo.lock
|
|
22
|
-
|
|
23
|
-
# OS Files
|
|
24
|
-
.DS_Store
|
|
25
|
-
Thumbs.db
|
|
26
|
-
*.tmp
|
|
27
|
-
*.bak
|
|
28
|
-
|
|
29
|
-
# Environment & Secrets
|
|
30
|
-
.env
|
|
31
|
-
.env.local
|
|
32
|
-
.env.*.local
|
|
33
|
-
|
|
34
|
-
# IDEs
|
|
35
|
-
.vscode/
|
|
36
|
-
.idea/
|
|
37
|
-
*.swp
|
|
38
|
-
*.swo
|
package/templates/ts/Dockerfile
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# ================================================================
|
|
2
|
-
# STAGE 1 — Build
|
|
3
|
-
# ================================================================
|
|
4
|
-
FROM node:20-slim AS builder
|
|
5
|
-
|
|
6
|
-
# Install Titan CLI (latest)
|
|
7
|
-
RUN npm install -g @ezetgalaxy/titan@latest
|
|
8
|
-
|
|
9
|
-
WORKDIR /app
|
|
10
|
-
|
|
11
|
-
# Copy project files
|
|
12
|
-
COPY . .
|
|
13
|
-
|
|
14
|
-
# Install JS dependencies
|
|
15
|
-
RUN npm install
|
|
16
|
-
|
|
17
|
-
# Build Titan App
|
|
18
|
-
RUN titan build
|
|
19
|
-
|
|
20
|
-
# ================================================================
|
|
21
|
-
# STAGE 2 — Runtime
|
|
22
|
-
# ================================================================
|
|
23
|
-
FROM node:20-slim
|
|
24
|
-
|
|
25
|
-
WORKDIR /app
|
|
26
|
-
|
|
27
|
-
# Copy Titan Build Artifacts
|
|
28
|
-
COPY --from=builder /app/.titan ./.titan
|
|
29
|
-
COPY --from=builder /app/server ./server
|
|
30
|
-
COPY --from=builder /app/package.json ./package.json
|
|
31
|
-
|
|
32
|
-
# Install dependencies (production only, but for now we might need all if not careful)
|
|
33
|
-
# Actually, the runtime depends on `express`-like behavior?
|
|
34
|
-
# No, Titan pure TS runs via `node .titan/app.js` which might need deps?
|
|
35
|
-
# The user's package.json has dependencies.
|
|
36
|
-
RUN npm install --omit=dev
|
|
37
|
-
|
|
38
|
-
EXPOSE 3000
|
|
39
|
-
|
|
40
|
-
CMD ["node", ".titan/app.js"]
|
package/templates/ts/_gitignore
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Node & Packages
|
|
2
|
-
node_modules/
|
|
3
|
-
npm-debug.log*
|
|
4
|
-
yarn-debug.log*
|
|
5
|
-
yarn-error.log*
|
|
6
|
-
package-lock.json
|
|
7
|
-
yarn.lock
|
|
8
|
-
|
|
9
|
-
# Titan Runtime (Auto-generated - DO NOT COMMIT)
|
|
10
|
-
titan/server-bin*
|
|
11
|
-
.titan/
|
|
12
|
-
.ext/
|
|
13
|
-
server/routes.json
|
|
14
|
-
server/action_map.json
|
|
15
|
-
server/actions/
|
|
16
|
-
server/titan/
|
|
17
|
-
server/src/actions_rust/
|
|
18
|
-
|
|
19
|
-
# Rust Build Artifacts
|
|
20
|
-
server/target/
|
|
21
|
-
Cargo.lock
|
|
22
|
-
|
|
23
|
-
# OS Files
|
|
24
|
-
.DS_Store
|
|
25
|
-
Thumbs.db
|
|
26
|
-
*.tmp
|
|
27
|
-
*.bak
|
|
28
|
-
|
|
29
|
-
# Environment & Secrets
|
|
30
|
-
.env
|
|
31
|
-
.env.local
|
|
32
|
-
.env.*.local
|
|
33
|
-
|
|
34
|
-
# IDEs
|
|
35
|
-
.vscode/
|
|
36
|
-
.idea/
|
|
37
|
-
*.swp
|
|
38
|
-
*.swo
|
|
File without changes
|
|
File without changes
|
|
File without changes
|