@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.
package/dist/main.js CHANGED
@@ -3925,7 +3925,16 @@ function addNew(name) {
3925
3925
  dirs: [
3926
3926
  {
3927
3927
  name: "src",
3928
- files: [{ name: "main.ts", content: genMainTs() }]
3928
+ files: [{ name: "main.ts", content: genMainTs() }],
3929
+ dirs: [
3930
+ {
3931
+ name: "client",
3932
+ files: [
3933
+ { name: "index.html", content: genIndexHtml(name) },
3934
+ { name: "client.ts", content: genClientTs() }
3935
+ ]
3936
+ }
3937
+ ]
3929
3938
  }
3930
3939
  ]
3931
3940
  };
@@ -4012,6 +4021,57 @@ function genEnv() {
4012
4021
  return `NODE_ENV=development
4013
4022
  `;
4014
4023
  }
4024
+ function genIndexHtml(name) {
4025
+ return `<!DOCTYPE html>
4026
+ <html lang="en">
4027
+ <head>
4028
+ <meta charset="UTF-8" />
4029
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
4030
+ <title>${name} app</title>
4031
+ <link rel="stylesheet" href="index.css" />
4032
+ </head>
4033
+ <body>
4034
+ <div id="root"></div>
4035
+ <script type="module" src="/src/client/client.js"></script>
4036
+ </body>
4037
+ </html>
4038
+ `;
4039
+ }
4040
+ function genClientTs() {
4041
+ return `"use interactive";
4042
+
4043
+ import {
4044
+ Module,
4045
+ BrowserFactory,
4046
+ Component,
4047
+ RouterModule,
4048
+ RouterOutlet,
4049
+ HttpClientModule,
4050
+ } from "@kithinji/orca";
4051
+
4052
+ @Component({
4053
+ deps: [RouterOutlet],
4054
+ })
4055
+ class AppComponent {
4056
+ build() {
4057
+ return <RouterOutlet />;
4058
+ }
4059
+ }
4060
+
4061
+ @Module({
4062
+ imports: [RouterModule.forRoot(), HttpClientModule],
4063
+ declarations: [AppComponent],
4064
+ bootstrap: AppComponent,
4065
+ })
4066
+ class AppModule {}
4067
+
4068
+ export function bootstrap() {
4069
+ BrowserFactory.create(AppModule, document.getElementById("root")!);
4070
+ }
4071
+
4072
+ bootstrap();
4073
+ `;
4074
+ }
4015
4075
  function genMainTs() {
4016
4076
  return `import { NodeFactory } from "@kithinji/orca";
4017
4077
  import { AppModule } from "./app/app.module";