@baloise/angular-output-target 1.1.1 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.2.1](https://github.com/baloise/stencil-ds-output-targets/compare/@baloise/angular-output-target@1.2.0...@baloise/angular-output-target@1.2.1) (2022-03-01)
7
+
8
+ **Note:** Version bump only for package @baloise/angular-output-target
9
+
10
+
11
+
12
+
13
+
14
+ # [1.2.0](https://github.com/baloise/stencil-ds-output-targets/compare/@baloise/angular-output-target@1.1.2...@baloise/angular-output-target@1.2.0) (2022-03-01)
15
+
16
+
17
+ ### Features
18
+
19
+ * **react:** add custom react output ([11eabd3](https://github.com/baloise/stencil-ds-output-targets/commit/11eabd33271a12c9a5d15d64c114f30c017cc1d5))
20
+
21
+
22
+
23
+
24
+
25
+ ## [1.1.2](https://github.com/baloise/stencil-ds-output-targets/compare/@baloise/angular-output-target@1.1.1...@baloise/angular-output-target@1.1.2) (2022-02-10)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **angular:** remove all component module ([dcf567d](https://github.com/baloise/stencil-ds-output-targets/commit/dcf567d597313a5b5bf1ec003ef9f7f25dd4bcad))
31
+
32
+
33
+
34
+
35
+
6
36
  ## [1.1.1](https://github.com/baloise/stencil-ds-output-targets/compare/@baloise/angular-output-target@1.1.0...@baloise/angular-output-target@1.1.1) (2022-01-31)
7
37
 
8
38
 
@@ -40,7 +40,7 @@ ${getProxyCmp(inputs, methods)}
40
40
  @Component({
41
41
  ${directiveOpts.join(',\n ')}
42
42
  })
43
- export class ${tagNameAsPascal} {`,
43
+ class ${tagNameAsPascal} {`,
44
44
  ];
45
45
  // Generate outputs
46
46
  outputs.forEach(output => {
package/dist/index.cjs.js CHANGED
@@ -128,7 +128,7 @@ ${getProxyCmp(inputs, methods)}
128
128
  @Component({
129
129
  ${directiveOpts.join(',\n ')}
130
130
  })
131
- export class ${tagNameAsPascal} {`,
131
+ class ${tagNameAsPascal} {`,
132
132
  ];
133
133
  // Generate outputs
134
134
  outputs.forEach(output => {
@@ -296,10 +296,8 @@ async function angularDirectiveProxyOutput(compilerCtx, outputTarget, components
296
296
  const rootDir = config.rootDir;
297
297
  const pkgData = await readPackageJson(rootDir);
298
298
  const finalText = generateProxies(filteredComponents, pkgData, outputTarget, config.rootDir);
299
- const allComponentModule = generateAllComponentModule(filteredComponents, outputTarget);
300
299
  await Promise.all([
301
300
  compilerCtx.fs.writeFile(outputTarget.directivesProxyFile, finalText),
302
- compilerCtx.fs.writeFile(outputTarget.directivesProxyFile.replace('.ts', '.module.ts'), allComponentModule),
303
301
  copyResources(config, outputTarget),
304
302
  generateAngularDirectivesFile(compilerCtx, filteredComponents, outputTarget),
305
303
  generateValueAccessors(compilerCtx, filteredComponents, outputTarget, config),
@@ -323,35 +321,6 @@ async function copyResources(config, outputTarget) {
323
321
  },
324
322
  ], srcDirectory);
325
323
  }
326
- function generateAllComponentModule(components, outputTarget) {
327
- const childComponent = Object.values(outputTarget.componentGroups || {})
328
- .flat()
329
- .map(o => o.components)
330
- .flat();
331
- const moduleImports = components
332
- .map(c => c.tagName)
333
- .filter(c => !childComponent.includes(c))
334
- .map(c => ` ${dashToPascalCase(c)}Module,`);
335
- return `/* tslint:disable */
336
- /* auto-generated angular directive proxies */
337
- import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'
338
- import { CommonModule } from '@angular/common';
339
- import {
340
- ${moduleImports.join('\n')}
341
- } from './proxies'
342
-
343
- const modules = [
344
- ${moduleImports.join('\n')}
345
- ]
346
-
347
- @NgModule({
348
- imports: [CommonModule, ...modules],
349
- exports: [...modules],
350
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
351
- })
352
- export class BalAllComponentModule {}
353
- `;
354
- }
355
324
  function generateProxies(components, pkgData, outputTarget, rootDir) {
356
325
  const distTypesDir = path__default['default'].dirname(pkgData.types);
357
326
  const dtsFilePath = path__default['default'].join(rootDir, distTypesDir, GENERATED_DTS);
package/dist/index.js CHANGED
@@ -119,7 +119,7 @@ ${getProxyCmp(inputs, methods)}
119
119
  @Component({
120
120
  ${directiveOpts.join(',\n ')}
121
121
  })
122
- export class ${tagNameAsPascal} {`,
122
+ class ${tagNameAsPascal} {`,
123
123
  ];
124
124
  // Generate outputs
125
125
  outputs.forEach(output => {
@@ -287,10 +287,8 @@ async function angularDirectiveProxyOutput(compilerCtx, outputTarget, components
287
287
  const rootDir = config.rootDir;
288
288
  const pkgData = await readPackageJson(rootDir);
289
289
  const finalText = generateProxies(filteredComponents, pkgData, outputTarget, config.rootDir);
290
- const allComponentModule = generateAllComponentModule(filteredComponents, outputTarget);
291
290
  await Promise.all([
292
291
  compilerCtx.fs.writeFile(outputTarget.directivesProxyFile, finalText),
293
- compilerCtx.fs.writeFile(outputTarget.directivesProxyFile.replace('.ts', '.module.ts'), allComponentModule),
294
292
  copyResources(config, outputTarget),
295
293
  generateAngularDirectivesFile(compilerCtx, filteredComponents, outputTarget),
296
294
  generateValueAccessors(compilerCtx, filteredComponents, outputTarget, config),
@@ -314,35 +312,6 @@ async function copyResources(config, outputTarget) {
314
312
  },
315
313
  ], srcDirectory);
316
314
  }
317
- function generateAllComponentModule(components, outputTarget) {
318
- const childComponent = Object.values(outputTarget.componentGroups || {})
319
- .flat()
320
- .map(o => o.components)
321
- .flat();
322
- const moduleImports = components
323
- .map(c => c.tagName)
324
- .filter(c => !childComponent.includes(c))
325
- .map(c => ` ${dashToPascalCase(c)}Module,`);
326
- return `/* tslint:disable */
327
- /* auto-generated angular directive proxies */
328
- import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'
329
- import { CommonModule } from '@angular/common';
330
- import {
331
- ${moduleImports.join('\n')}
332
- } from './proxies'
333
-
334
- const modules = [
335
- ${moduleImports.join('\n')}
336
- ]
337
-
338
- @NgModule({
339
- imports: [CommonModule, ...modules],
340
- exports: [...modules],
341
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
342
- })
343
- export class BalAllComponentModule {}
344
- `;
345
- }
346
315
  function generateProxies(components, pkgData, outputTarget, rootDir) {
347
316
  const distTypesDir = path.dirname(pkgData.types);
348
317
  const dtsFilePath = path.join(rootDir, distTypesDir, GENERATED_DTS);
@@ -1,5 +1,4 @@
1
1
  import type { CompilerCtx, ComponentCompilerMeta, Config } from '@stencil/core/internal';
2
2
  import type { OutputTargetAngular, PackageJSON } from './types';
3
3
  export declare function angularDirectiveProxyOutput(compilerCtx: CompilerCtx, outputTarget: OutputTargetAngular, components: ComponentCompilerMeta[], config: Config): Promise<void>;
4
- export declare function generateAllComponentModule(components: ComponentCompilerMeta[], outputTarget: OutputTargetAngular): string;
5
4
  export declare function generateProxies(components: ComponentCompilerMeta[], pkgData: PackageJSON, outputTarget: OutputTargetAngular, rootDir: string): string;
@@ -9,10 +9,8 @@ export async function angularDirectiveProxyOutput(compilerCtx, outputTarget, com
9
9
  const rootDir = config.rootDir;
10
10
  const pkgData = await readPackageJson(rootDir);
11
11
  const finalText = generateProxies(filteredComponents, pkgData, outputTarget, config.rootDir);
12
- const allComponentModule = generateAllComponentModule(filteredComponents, outputTarget);
13
12
  await Promise.all([
14
13
  compilerCtx.fs.writeFile(outputTarget.directivesProxyFile, finalText),
15
- compilerCtx.fs.writeFile(outputTarget.directivesProxyFile.replace('.ts', '.module.ts'), allComponentModule),
16
14
  copyResources(config, outputTarget),
17
15
  generateAngularDirectivesFile(compilerCtx, filteredComponents, outputTarget),
18
16
  generateValueAccessors(compilerCtx, filteredComponents, outputTarget, config),
@@ -36,35 +34,6 @@ async function copyResources(config, outputTarget) {
36
34
  },
37
35
  ], srcDirectory);
38
36
  }
39
- export function generateAllComponentModule(components, outputTarget) {
40
- const childComponent = Object.values(outputTarget.componentGroups || {})
41
- .flat()
42
- .map(o => o.components)
43
- .flat();
44
- const moduleImports = components
45
- .map(c => c.tagName)
46
- .filter(c => !childComponent.includes(c))
47
- .map(c => ` ${dashToPascalCase(c)}Module,`);
48
- return `/* tslint:disable */
49
- /* auto-generated angular directive proxies */
50
- import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'
51
- import { CommonModule } from '@angular/common';
52
- import {
53
- ${moduleImports.join('\n')}
54
- } from './proxies'
55
-
56
- const modules = [
57
- ${moduleImports.join('\n')}
58
- ]
59
-
60
- @NgModule({
61
- imports: [CommonModule, ...modules],
62
- exports: [...modules],
63
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
64
- })
65
- export class BalAllComponentModule {}
66
- `;
67
- }
68
37
  export function generateProxies(components, pkgData, outputTarget, rootDir) {
69
38
  const distTypesDir = path.dirname(pkgData.types);
70
39
  const dtsFilePath = path.join(rootDir, distTypesDir, GENERATED_DTS);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baloise/angular-output-target",
3
- "version": "1.1.1",
3
+ "version": "1.2.1",
4
4
  "description": "Angular output target for @stencil/core components.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -61,5 +61,5 @@
61
61
  ],
62
62
  "testURL": "http://localhost"
63
63
  },
64
- "gitHead": "e8aa34e51d9d5669d6e036c16b17cbcf9d32a617"
64
+ "gitHead": "f846fced90a990d1557f642e4c1090b196e75694"
65
65
  }