@smapiot/pilet-template-angular 0.15.0 → 0.15.1-beta.4885

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)("info", `Found Piral instance plugins "${match[1]}"`);
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) {
@@ -1365,22 +1369,18 @@ function getStandalonePackageJson(cliVersion, ngVersion) {
1365
1369
  return {
1366
1370
  importmap: {
1367
1371
  imports: {
1368
- "@angular/animations": "@angular/animations",
1369
1372
  "@angular/common": "@angular/common",
1370
1373
  "@angular/compiler": "@angular/compiler",
1371
1374
  "@angular/core": "@angular/core",
1372
- "@angular/forms": "@angular/forms",
1373
1375
  "@angular/platform-browser": "@angular/platform-browser",
1374
1376
  "@angular/platform-browser-dynamic": "@angular/platform-browser-dynamic",
1375
1377
  "@angular/router": "@angular/router"
1376
1378
  }
1377
1379
  },
1378
1380
  dependencies: {
1379
- "@angular/animations": ngVersion,
1380
1381
  "@angular/common": ngVersion,
1381
1382
  "@angular/compiler": ngVersion,
1382
1383
  "@angular/core": ngVersion,
1383
- "@angular/forms": ngVersion,
1384
1384
  "@angular/platform-browser": ngVersion,
1385
1385
  "@angular/platform-browser-dynamic": ngVersion,
1386
1386
  "@angular/router": ngVersion,
@@ -1462,6 +1462,16 @@ var src_default = (0, import_template_utils.createPiletTemplateFactory)(root, (p
1462
1462
  name: "page.component.ts",
1463
1463
  target: "<src>/app/page.component.ts"
1464
1464
  },
1465
+ {
1466
+ languages: ["ts"],
1467
+ name: "menu.component.html",
1468
+ target: "<src>/app/menu.component.html"
1469
+ },
1470
+ {
1471
+ languages: ["ts"],
1472
+ name: "menu.component.ts",
1473
+ target: "<src>/app/menu.component.ts"
1474
+ },
1465
1475
  {
1466
1476
  languages: ["ts"],
1467
1477
  name: "index.tsx",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smapiot/pilet-template-angular",
3
- "version": "0.15.0",
3
+ "version": "0.15.1-beta.4885",
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": "^0.15.0"
57
+ "@smapiot/template-utils": "0.15.1-beta.4885"
58
58
  },
59
- "gitHead": "725c55b18475ff469dd47179146f2baa04508941"
59
+ "gitHead": "65633e62e4f7016c2ae7e3c1f2970d5adf35cb20"
60
60
  }
package/src/helpers.ts CHANGED
@@ -27,22 +27,18 @@ export function getStandalonePackageJson(cliVersion: string, ngVersion: string)
27
27
  return {
28
28
  importmap: {
29
29
  imports: {
30
- '@angular/animations': '@angular/animations',
31
30
  '@angular/common': '@angular/common',
32
31
  '@angular/compiler': '@angular/compiler',
33
32
  '@angular/core': '@angular/core',
34
- '@angular/forms': '@angular/forms',
35
33
  '@angular/platform-browser': '@angular/platform-browser',
36
34
  '@angular/platform-browser-dynamic': '@angular/platform-browser-dynamic',
37
35
  '@angular/router': '@angular/router',
38
36
  },
39
37
  },
40
38
  dependencies: {
41
- '@angular/animations': ngVersion,
42
39
  '@angular/common': ngVersion,
43
40
  '@angular/compiler': ngVersion,
44
41
  '@angular/core': ngVersion,
45
- '@angular/forms': ngVersion,
46
42
  '@angular/platform-browser': ngVersion,
47
43
  '@angular/platform-browser-dynamic': ngVersion,
48
44
  '@angular/router': ngVersion,
package/src/index.ts CHANGED
@@ -63,6 +63,16 @@ export default createPiletTemplateFactory<AngularPiletArgs>(root, (projectRoot,
63
63
  name: 'page.component.ts',
64
64
  target: '<src>/app/page.component.ts',
65
65
  },
66
+ {
67
+ languages: ['ts'],
68
+ name: 'menu.component.html',
69
+ target: '<src>/app/menu.component.html',
70
+ },
71
+ {
72
+ languages: ['ts'],
73
+ name: 'menu.component.ts',
74
+ target: '<src>/app/menu.component.ts',
75
+ },
66
76
  {
67
77
  languages: ['ts'],
68
78
  name: 'index.tsx',
@@ -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: [PageComponent],
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.forRoot([])],
12
14
  })
13
15
  export class AppModule {}
@@ -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>
@@ -0,0 +1,7 @@
1
+ import { Component } from '@angular/core';
2
+
3
+ @Component({
4
+ styleUrls: [],
5
+ templateUrl: './menu.component.html'
6
+ })
7
+ export class MenuComponent {}