@smapiot/pilet-template-angular 0.15.0 → 0.15.1-beta.4883
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/lib/index.js
CHANGED
|
@@ -1177,8 +1177,12 @@ var require_utils2 = __commonJS({
|
|
|
1177
1177
|
(0, log_1.log)("verbose", `Reading file in "${typingsPath}"`);
|
|
1178
1178
|
const typing = (0, fs_1.readFileSync)(typingsPath, "utf8");
|
|
1179
1179
|
const match = /export interface PiletCustomApi extends (.*?) \{/g.exec(typing);
|
|
1180
|
+
if (!match) {
|
|
1181
|
+
(0, log_1.log)("verbose", `No Piral instance plugins have been found`);
|
|
1182
|
+
return [];
|
|
1183
|
+
}
|
|
1180
1184
|
const apis = match[1].split(", ");
|
|
1181
|
-
(0, log_1.log)("
|
|
1185
|
+
(0, log_1.log)("verbose", `Found Piral instance plugins "${match[1]}"`);
|
|
1182
1186
|
for (const api of apis) {
|
|
1183
1187
|
const pluginMatch = /^Pilet(.*)Api$/.exec(api);
|
|
1184
1188
|
if (pluginMatch) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smapiot/pilet-template-angular",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1-beta.4883",
|
|
4
4
|
"description": "Official scaffolding template for pilets: 'angular'.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral-cli",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@smapiot/template-utils": "
|
|
57
|
+
"@smapiot/template-utils": "0.15.1-beta.4883"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "ab58fd9b03b7882c837c5de853ea4cf3231f5928"
|
|
60
60
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
|
+
import { RouterModule } from '@angular/router';
|
|
2
3
|
import { BrowserModule } from '@angular/platform-browser';
|
|
3
4
|
import { SharedModule } from 'piral-ng/common';
|
|
4
5
|
|
|
5
6
|
import { PageComponent } from './page.component';
|
|
7
|
+
import { MenuComponent } from './menu.component';
|
|
6
8
|
|
|
7
9
|
@NgModule({
|
|
8
|
-
bootstrap: [
|
|
9
|
-
declarations: [PageComponent],
|
|
10
|
-
exports: [PageComponent],
|
|
11
|
-
imports: [BrowserModule, SharedModule]
|
|
10
|
+
bootstrap: [],
|
|
11
|
+
declarations: [PageComponent, MenuComponent],
|
|
12
|
+
exports: [PageComponent, MenuComponent],
|
|
13
|
+
imports: [BrowserModule, SharedModule, RouterModule.fromRoot([])],
|
|
12
14
|
})
|
|
13
15
|
export class AppModule {}
|
package/templates/index.tsx.ejs
CHANGED
|
@@ -5,6 +5,9 @@ import { defineNgModule, fromNg } from 'piral-ng/convert';
|
|
|
5
5
|
<% } -%>
|
|
6
6
|
import { AppModule } from './app/app.module';
|
|
7
7
|
import { PageComponent } from './app/page.component';
|
|
8
|
+
<% if (plugins.menu) { -%>
|
|
9
|
+
import { MenuComponent } from './app/menu.component';
|
|
10
|
+
<% } -%>
|
|
8
11
|
import type { PiletApi } from '<%- sourceName %>';
|
|
9
12
|
|
|
10
13
|
export function setup(app: PiletApi) {
|
|
@@ -14,6 +17,10 @@ export function setup(app: PiletApi) {
|
|
|
14
17
|
ngZone: 'noop',
|
|
15
18
|
});
|
|
16
19
|
|
|
20
|
+
<% if (plugins.menu) { -%>
|
|
21
|
+
app.registerMenu(fromNg(MenuComponent));
|
|
22
|
+
<% } -%>
|
|
23
|
+
|
|
17
24
|
app.registerPage('/sample', fromNg(PageComponent));
|
|
18
25
|
<% } else { -%>
|
|
19
26
|
app.defineNgModule(AppModule, {
|
|
@@ -21,6 +28,10 @@ export function setup(app: PiletApi) {
|
|
|
21
28
|
ngZone: 'noop',
|
|
22
29
|
});
|
|
23
30
|
|
|
31
|
+
<% if (plugins.menu) { -%>
|
|
32
|
+
app.registerMenu(app.fromNg(MenuComponent));
|
|
33
|
+
<% } -%>
|
|
34
|
+
|
|
24
35
|
app.registerPage('/sample', app.fromNg(PageComponent));
|
|
25
36
|
<% } -%>
|
|
26
37
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<a routerLink="/sample">Sample</a>
|