@kithinji/pod 1.0.2 → 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.
@@ -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,QA+BlC"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kithinji/pod",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "pod": "./dist/main.js"
@@ -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
  };
@@ -120,6 +129,59 @@ function genEnv() {
120
129
  `;
121
130
  }
122
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
+
123
185
  function genMainTs() {
124
186
  return `import { NodeFactory } from "@kithinji/orca";
125
187
  import { AppModule } from "./app/app.module";