@kithinji/pod 1.0.1 → 1.0.3
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/main.js +63 -2
- package/dist/main.js.map +2 -2
- package/dist/types/add/new/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/add/new/index.ts +63 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/add/new/index.ts"],"names":[],"mappings":"AAKA,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/add/new/index.ts"],"names":[],"mappings":"AAKA,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,QAwClC"}
|
package/package.json
CHANGED
package/src/add/new/index.ts
CHANGED
|
@@ -19,6 +19,15 @@ export function addNew(name: string) {
|
|
|
19
19
|
{
|
|
20
20
|
name: "src",
|
|
21
21
|
files: [{ name: "main.ts", content: genMainTs() }],
|
|
22
|
+
dirs: [
|
|
23
|
+
{
|
|
24
|
+
name: "client",
|
|
25
|
+
files: [
|
|
26
|
+
{ name: "index.html", content: genIndexHtml(name) },
|
|
27
|
+
{ name: "client.ts", content: genClientTs() },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
],
|
|
22
31
|
},
|
|
23
32
|
],
|
|
24
33
|
};
|
|
@@ -51,6 +60,7 @@ function genPackageJson(name: string) {
|
|
|
51
60
|
"reflect-metadata": "latest",
|
|
52
61
|
zod: "^4.2.1",
|
|
53
62
|
"@kithinji/orca": "latest",
|
|
63
|
+
"@kithinji/arcane": "latest",
|
|
54
64
|
},
|
|
55
65
|
devDependencies: {
|
|
56
66
|
"@types/node": "^20.19.27",
|
|
@@ -119,6 +129,59 @@ function genEnv() {
|
|
|
119
129
|
`;
|
|
120
130
|
}
|
|
121
131
|
|
|
132
|
+
function genIndexHtml(name: string) {
|
|
133
|
+
return `<!DOCTYPE html>
|
|
134
|
+
<html lang="en">
|
|
135
|
+
<head>
|
|
136
|
+
<meta charset="UTF-8" />
|
|
137
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
138
|
+
<title>${name} app</title>
|
|
139
|
+
<link rel="stylesheet" href="index.css" />
|
|
140
|
+
</head>
|
|
141
|
+
<body>
|
|
142
|
+
<div id="root"></div>
|
|
143
|
+
<script type="module" src="/src/client/client.js"></script>
|
|
144
|
+
</body>
|
|
145
|
+
</html>
|
|
146
|
+
`;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function genClientTs() {
|
|
150
|
+
return `"use interactive";
|
|
151
|
+
|
|
152
|
+
import {
|
|
153
|
+
Module,
|
|
154
|
+
BrowserFactory,
|
|
155
|
+
Component,
|
|
156
|
+
RouterModule,
|
|
157
|
+
RouterOutlet,
|
|
158
|
+
HttpClientModule,
|
|
159
|
+
} from "@kithinji/orca";
|
|
160
|
+
|
|
161
|
+
@Component({
|
|
162
|
+
deps: [RouterOutlet],
|
|
163
|
+
})
|
|
164
|
+
class AppComponent {
|
|
165
|
+
build() {
|
|
166
|
+
return <RouterOutlet />;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@Module({
|
|
171
|
+
imports: [RouterModule.forRoot(), HttpClientModule],
|
|
172
|
+
declarations: [AppComponent],
|
|
173
|
+
bootstrap: AppComponent,
|
|
174
|
+
})
|
|
175
|
+
class AppModule {}
|
|
176
|
+
|
|
177
|
+
export function bootstrap() {
|
|
178
|
+
BrowserFactory.create(AppModule, document.getElementById("root")!);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
bootstrap();
|
|
182
|
+
`;
|
|
183
|
+
}
|
|
184
|
+
|
|
122
185
|
function genMainTs() {
|
|
123
186
|
return `import { NodeFactory } from "@kithinji/orca";
|
|
124
187
|
import { AppModule } from "./app/app.module";
|