@stencil/angular-output-target 0.8.2 → 0.8.4
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/angular-component-lib/utils.ts +8 -0
- package/dist/generate-angular-component.js +16 -1
- package/dist/index.cjs.js +16 -4
- package/dist/index.js +16 -4
- package/dist/plugin.js +0 -3
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -12,6 +12,14 @@ export const proxyInputs = (Cmp: any, inputs: string[]) => {
|
|
|
12
12
|
set(val: any) {
|
|
13
13
|
this.z.runOutsideAngular(() => (this.el[item] = val));
|
|
14
14
|
},
|
|
15
|
+
/**
|
|
16
|
+
* In the event that proxyInputs is called
|
|
17
|
+
* multiple times re-defining these inputs
|
|
18
|
+
* will cause an error to be thrown. As a result
|
|
19
|
+
* we set configurable: true to indicate these
|
|
20
|
+
* properties can be changed.
|
|
21
|
+
*/
|
|
22
|
+
configurable: true,
|
|
15
23
|
});
|
|
16
24
|
});
|
|
17
25
|
};
|
|
@@ -81,7 +81,22 @@ const formatOutputType = (componentClassName, event) => {
|
|
|
81
81
|
.reduce((type, [src, dst]) => {
|
|
82
82
|
let renamedType = type;
|
|
83
83
|
if (!type.startsWith(prefix)) {
|
|
84
|
-
|
|
84
|
+
if (type.startsWith('{') && type.endsWith('}')) {
|
|
85
|
+
/**
|
|
86
|
+
* If the type starts with { and ends with }, it is an inline type.
|
|
87
|
+
* For example, `{ a: string }`.
|
|
88
|
+
* We don't need to rename these types, so we return the original type.
|
|
89
|
+
*/
|
|
90
|
+
renamedType = type;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
/**
|
|
94
|
+
* If the type does not start with { and end with }, it is a reference type.
|
|
95
|
+
* For example, `MyType`.
|
|
96
|
+
* We need to rename these types, so we prepend the prefix.
|
|
97
|
+
*/
|
|
98
|
+
renamedType = `I${componentClassName}${type}`;
|
|
99
|
+
}
|
|
85
100
|
}
|
|
86
101
|
return (renamedType
|
|
87
102
|
.replace(new RegExp(`^${src}$`, 'g'), `${dst}`)
|
package/dist/index.cjs.js
CHANGED
|
@@ -226,7 +226,22 @@ const formatOutputType = (componentClassName, event) => {
|
|
|
226
226
|
.reduce((type, [src, dst]) => {
|
|
227
227
|
let renamedType = type;
|
|
228
228
|
if (!type.startsWith(prefix)) {
|
|
229
|
-
|
|
229
|
+
if (type.startsWith('{') && type.endsWith('}')) {
|
|
230
|
+
/**
|
|
231
|
+
* If the type starts with { and ends with }, it is an inline type.
|
|
232
|
+
* For example, `{ a: string }`.
|
|
233
|
+
* We don't need to rename these types, so we return the original type.
|
|
234
|
+
*/
|
|
235
|
+
renamedType = type;
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
/**
|
|
239
|
+
* If the type does not start with { and end with }, it is a reference type.
|
|
240
|
+
* For example, `MyType`.
|
|
241
|
+
* We need to rename these types, so we prepend the prefix.
|
|
242
|
+
*/
|
|
243
|
+
renamedType = `I${componentClassName}${type}`;
|
|
244
|
+
}
|
|
230
245
|
}
|
|
231
246
|
return (renamedType
|
|
232
247
|
.replace(new RegExp(`^${src}$`, 'g'), `${dst}`)
|
|
@@ -554,9 +569,6 @@ function normalizeOutputTarget(config, outputTarget) {
|
|
|
554
569
|
if (outputTarget.includeSingleComponentAngularModules !== undefined) {
|
|
555
570
|
throw new Error("The 'includeSingleComponentAngularModules' option has been removed. Please use 'outputType' instead.");
|
|
556
571
|
}
|
|
557
|
-
if (outputTarget.outputType === OutputTypes.Scam) {
|
|
558
|
-
console.warn(`**Experimental**: outputType: "${OutputTypes.Scam}" is a developer preview feature and may change or be removed in the future.`);
|
|
559
|
-
}
|
|
560
572
|
return results;
|
|
561
573
|
}
|
|
562
574
|
|
package/dist/index.js
CHANGED
|
@@ -218,7 +218,22 @@ const formatOutputType = (componentClassName, event) => {
|
|
|
218
218
|
.reduce((type, [src, dst]) => {
|
|
219
219
|
let renamedType = type;
|
|
220
220
|
if (!type.startsWith(prefix)) {
|
|
221
|
-
|
|
221
|
+
if (type.startsWith('{') && type.endsWith('}')) {
|
|
222
|
+
/**
|
|
223
|
+
* If the type starts with { and ends with }, it is an inline type.
|
|
224
|
+
* For example, `{ a: string }`.
|
|
225
|
+
* We don't need to rename these types, so we return the original type.
|
|
226
|
+
*/
|
|
227
|
+
renamedType = type;
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
/**
|
|
231
|
+
* If the type does not start with { and end with }, it is a reference type.
|
|
232
|
+
* For example, `MyType`.
|
|
233
|
+
* We need to rename these types, so we prepend the prefix.
|
|
234
|
+
*/
|
|
235
|
+
renamedType = `I${componentClassName}${type}`;
|
|
236
|
+
}
|
|
222
237
|
}
|
|
223
238
|
return (renamedType
|
|
224
239
|
.replace(new RegExp(`^${src}$`, 'g'), `${dst}`)
|
|
@@ -546,9 +561,6 @@ function normalizeOutputTarget(config, outputTarget) {
|
|
|
546
561
|
if (outputTarget.includeSingleComponentAngularModules !== undefined) {
|
|
547
562
|
throw new Error("The 'includeSingleComponentAngularModules' option has been removed. Please use 'outputType' instead.");
|
|
548
563
|
}
|
|
549
|
-
if (outputTarget.outputType === OutputTypes.Scam) {
|
|
550
|
-
console.warn(`**Experimental**: outputType: "${OutputTypes.Scam}" is a developer preview feature and may change or be removed in the future.`);
|
|
551
|
-
}
|
|
552
564
|
return results;
|
|
553
565
|
}
|
|
554
566
|
|
package/dist/plugin.js
CHANGED
|
@@ -33,8 +33,5 @@ export function normalizeOutputTarget(config, outputTarget) {
|
|
|
33
33
|
if (outputTarget.includeSingleComponentAngularModules !== undefined) {
|
|
34
34
|
throw new Error("The 'includeSingleComponentAngularModules' option has been removed. Please use 'outputType' instead.");
|
|
35
35
|
}
|
|
36
|
-
if (outputTarget.outputType === OutputTypes.Scam) {
|
|
37
|
-
console.warn(`**Experimental**: outputType: "${OutputTypes.Scam}" is a developer preview feature and may change or be removed in the future.`);
|
|
38
|
-
}
|
|
39
36
|
return results;
|
|
40
37
|
}
|
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` - 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;
|