@stencil/angular-output-target 0.7.2-dev.11691592740.18e8ffbc → 0.7.2-dev.11691686383.1d6a2c07
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/generate-angular-component.js +11 -1
- package/dist/index.cjs.js +14 -3
- package/dist/index.js +14 -3
- package/dist/plugin.js +3 -2
- package/dist/types.d.ts +1 -1
- package/package.json +2 -2
|
@@ -82,7 +82,17 @@ const formatOutputType = (componentClassName, event) => {
|
|
|
82
82
|
return (renamedType
|
|
83
83
|
.replace(new RegExp(`^${src}$`, 'g'), `${dst}`)
|
|
84
84
|
// Capture all instances of the `src` field surrounded by non-word characters on each side and join them.
|
|
85
|
-
.replace(new RegExp(`([^\\w])${src}([^\\w])`, 'g'), (v, p1, p2) =>
|
|
85
|
+
.replace(new RegExp(`([^\\w])${src}([^\\w])`, 'g'), (v, p1, p2) => {
|
|
86
|
+
if ((dst === null || dst === void 0 ? void 0 : dst.location) === 'import') {
|
|
87
|
+
/**
|
|
88
|
+
* Replaces a complex type reference within a generic type.
|
|
89
|
+
* For example, remapping a type like `EventEmitter<CustomEvent<MyEvent<T>>>` to
|
|
90
|
+
* `EventEmitter<CustomEvent<IMyComponentMyEvent<IMyComponentT>>`.
|
|
91
|
+
*/
|
|
92
|
+
return [p1, `I${componentClassName}${v.substring(1, v.length - 1)}`, p2].join('');
|
|
93
|
+
}
|
|
94
|
+
return [p1, dst, p2].join('');
|
|
95
|
+
}));
|
|
86
96
|
}, event.complexType.original
|
|
87
97
|
.replace(/\n/g, ' ')
|
|
88
98
|
.replace(/\s{2,}/g, ' ')
|
package/dist/index.cjs.js
CHANGED
|
@@ -227,7 +227,17 @@ const formatOutputType = (componentClassName, event) => {
|
|
|
227
227
|
return (renamedType
|
|
228
228
|
.replace(new RegExp(`^${src}$`, 'g'), `${dst}`)
|
|
229
229
|
// Capture all instances of the `src` field surrounded by non-word characters on each side and join them.
|
|
230
|
-
.replace(new RegExp(`([^\\w])${src}([^\\w])`, 'g'), (v, p1, p2) =>
|
|
230
|
+
.replace(new RegExp(`([^\\w])${src}([^\\w])`, 'g'), (v, p1, p2) => {
|
|
231
|
+
if ((dst === null || dst === void 0 ? void 0 : dst.location) === 'import') {
|
|
232
|
+
/**
|
|
233
|
+
* Replaces a complex type reference within a generic type.
|
|
234
|
+
* For example, remapping a type like `EventEmitter<CustomEvent<MyEvent<T>>>` to
|
|
235
|
+
* `EventEmitter<CustomEvent<IMyComponentMyEvent<IMyComponentT>>`.
|
|
236
|
+
*/
|
|
237
|
+
return [p1, `I${componentClassName}${v.substring(1, v.length - 1)}`, p2].join('');
|
|
238
|
+
}
|
|
239
|
+
return [p1, dst, p2].join('');
|
|
240
|
+
}));
|
|
231
241
|
}, event.complexType.original
|
|
232
242
|
.replace(/\n/g, ' ')
|
|
233
243
|
.replace(/\s{2,}/g, ' ')
|
|
@@ -508,15 +518,16 @@ ${createImportStatement(componentLibImports, './angular-component-lib/utils')}\n
|
|
|
508
518
|
const GENERATED_DTS = 'components.d.ts';
|
|
509
519
|
const IMPORT_TYPES = 'Components';
|
|
510
520
|
|
|
521
|
+
let validatedOutputTarget;
|
|
511
522
|
const angularOutputTarget = (outputTarget) => ({
|
|
512
523
|
type: 'custom',
|
|
513
524
|
name: 'angular-library',
|
|
514
525
|
validate(config) {
|
|
515
|
-
|
|
526
|
+
validatedOutputTarget = normalizeOutputTarget(config, outputTarget);
|
|
516
527
|
},
|
|
517
528
|
async generator(config, compilerCtx, buildCtx) {
|
|
518
529
|
const timespan = buildCtx.createTimeSpan(`generate angular proxies started`, true);
|
|
519
|
-
await angularDirectiveProxyOutput(compilerCtx,
|
|
530
|
+
await angularDirectiveProxyOutput(compilerCtx, validatedOutputTarget, buildCtx.components, config);
|
|
520
531
|
timespan.finish(`generate angular proxies finished`);
|
|
521
532
|
},
|
|
522
533
|
});
|
package/dist/index.js
CHANGED
|
@@ -219,7 +219,17 @@ const formatOutputType = (componentClassName, event) => {
|
|
|
219
219
|
return (renamedType
|
|
220
220
|
.replace(new RegExp(`^${src}$`, 'g'), `${dst}`)
|
|
221
221
|
// Capture all instances of the `src` field surrounded by non-word characters on each side and join them.
|
|
222
|
-
.replace(new RegExp(`([^\\w])${src}([^\\w])`, 'g'), (v, p1, p2) =>
|
|
222
|
+
.replace(new RegExp(`([^\\w])${src}([^\\w])`, 'g'), (v, p1, p2) => {
|
|
223
|
+
if ((dst === null || dst === void 0 ? void 0 : dst.location) === 'import') {
|
|
224
|
+
/**
|
|
225
|
+
* Replaces a complex type reference within a generic type.
|
|
226
|
+
* For example, remapping a type like `EventEmitter<CustomEvent<MyEvent<T>>>` to
|
|
227
|
+
* `EventEmitter<CustomEvent<IMyComponentMyEvent<IMyComponentT>>`.
|
|
228
|
+
*/
|
|
229
|
+
return [p1, `I${componentClassName}${v.substring(1, v.length - 1)}`, p2].join('');
|
|
230
|
+
}
|
|
231
|
+
return [p1, dst, p2].join('');
|
|
232
|
+
}));
|
|
223
233
|
}, event.complexType.original
|
|
224
234
|
.replace(/\n/g, ' ')
|
|
225
235
|
.replace(/\s{2,}/g, ' ')
|
|
@@ -500,15 +510,16 @@ ${createImportStatement(componentLibImports, './angular-component-lib/utils')}\n
|
|
|
500
510
|
const GENERATED_DTS = 'components.d.ts';
|
|
501
511
|
const IMPORT_TYPES = 'Components';
|
|
502
512
|
|
|
513
|
+
let validatedOutputTarget;
|
|
503
514
|
const angularOutputTarget = (outputTarget) => ({
|
|
504
515
|
type: 'custom',
|
|
505
516
|
name: 'angular-library',
|
|
506
517
|
validate(config) {
|
|
507
|
-
|
|
518
|
+
validatedOutputTarget = normalizeOutputTarget(config, outputTarget);
|
|
508
519
|
},
|
|
509
520
|
async generator(config, compilerCtx, buildCtx) {
|
|
510
521
|
const timespan = buildCtx.createTimeSpan(`generate angular proxies started`, true);
|
|
511
|
-
await angularDirectiveProxyOutput(compilerCtx,
|
|
522
|
+
await angularDirectiveProxyOutput(compilerCtx, validatedOutputTarget, buildCtx.components, config);
|
|
512
523
|
timespan.finish(`generate angular proxies finished`);
|
|
513
524
|
},
|
|
514
525
|
});
|
package/dist/plugin.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { OutputTypes, normalizePath } from './utils';
|
|
2
2
|
import { angularDirectiveProxyOutput } from './output-angular';
|
|
3
3
|
import path from 'path';
|
|
4
|
+
let validatedOutputTarget;
|
|
4
5
|
export const angularOutputTarget = (outputTarget) => ({
|
|
5
6
|
type: 'custom',
|
|
6
7
|
name: 'angular-library',
|
|
7
8
|
validate(config) {
|
|
8
|
-
|
|
9
|
+
validatedOutputTarget = normalizeOutputTarget(config, outputTarget);
|
|
9
10
|
},
|
|
10
11
|
async generator(config, compilerCtx, buildCtx) {
|
|
11
12
|
const timespan = buildCtx.createTimeSpan(`generate angular proxies started`, true);
|
|
12
|
-
await angularDirectiveProxyOutput(compilerCtx,
|
|
13
|
+
await angularDirectiveProxyOutput(compilerCtx, validatedOutputTarget, buildCtx.components, config);
|
|
13
14
|
timespan.finish(`generate angular proxies finished`);
|
|
14
15
|
},
|
|
15
16
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface OutputTargetAngular {
|
|
|
23
23
|
/**
|
|
24
24
|
* The type of output that should be generated.
|
|
25
25
|
* - `component` - Generate many component wrappers tied to a single Angular module (lazy/hydrated approach).
|
|
26
|
-
* - `scam` -
|
|
26
|
+
* - `scam` - **Experimental** - Generate a Single Component Angular Module for each component.
|
|
27
27
|
* - `standalone` - Generate a component with the `standalone` flag set to `true`.
|
|
28
28
|
*/
|
|
29
29
|
outputType?: OutputType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/angular-output-target",
|
|
3
|
-
"version": "0.7.2-dev.
|
|
3
|
+
"version": "0.7.2-dev.11691686383.1d6a2c07",
|
|
4
4
|
"description": "Angular output target for @stencil/core components.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
],
|
|
59
59
|
"testURL": "http://localhost"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "d6a2c0758150ee7856d2e86d7ce563f9b0b434a7",
|
|
62
62
|
"volta": {
|
|
63
63
|
"extends": "../../package.json"
|
|
64
64
|
}
|