@stencil/angular-output-target 0.7.2-dev.11691590901.1db83f93 → 0.7.2-dev.11691592740.18e8ffbc
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/index.cjs.js +11 -19
- package/dist/index.js +11 -19
- package/dist/output-angular.js +3 -4
- package/dist/plugin.js +4 -5
- package/dist/types.d.ts +2 -6
- package/dist/types.js +0 -12
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +6 -2
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -9,19 +9,11 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
|
|
10
10
|
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
var OutputType;
|
|
19
|
-
(function (OutputType) {
|
|
20
|
-
OutputType["Component"] = "component";
|
|
21
|
-
OutputType["Scam"] = "scam";
|
|
22
|
-
OutputType["Standalone"] = "standalone";
|
|
23
|
-
})(OutputType || (OutputType = {}));
|
|
24
|
-
|
|
12
|
+
const OutputTypes = {
|
|
13
|
+
Component: 'component',
|
|
14
|
+
Scam: 'scam',
|
|
15
|
+
Standalone: 'standalone',
|
|
16
|
+
};
|
|
25
17
|
const toLowerCase = (str) => str.toLowerCase();
|
|
26
18
|
const dashToPascalCase = (str) => toLowerCase(str)
|
|
27
19
|
.split('-')
|
|
@@ -119,7 +111,7 @@ const createImportStatement = (imports, module) => {
|
|
|
119
111
|
* @returns `true` if the output type is for the custom elements build.
|
|
120
112
|
*/
|
|
121
113
|
const isOutputTypeCustomElementsBuild = (outputType) => {
|
|
122
|
-
return outputType ===
|
|
114
|
+
return outputType === OutputTypes.Standalone || outputType === OutputTypes.Scam;
|
|
123
115
|
};
|
|
124
116
|
/**
|
|
125
117
|
* Creates the collection of import statements for a component based on the component's events type dependencies.
|
|
@@ -418,9 +410,9 @@ function generateProxies(components, pkgData, outputTarget, rootDir) {
|
|
|
418
410
|
const dtsFilePath = path__default['default'].join(rootDir, distTypesDir, GENERATED_DTS);
|
|
419
411
|
const { outputType } = outputTarget;
|
|
420
412
|
const componentsTypeFile = relativeImport(outputTarget.directivesProxyFile, dtsFilePath, '.d.ts');
|
|
421
|
-
const includeSingleComponentAngularModules = outputType ===
|
|
413
|
+
const includeSingleComponentAngularModules = outputType === OutputTypes.Scam;
|
|
422
414
|
const isCustomElementsBuild = isOutputTypeCustomElementsBuild(outputType);
|
|
423
|
-
const isStandaloneBuild = outputType ===
|
|
415
|
+
const isStandaloneBuild = outputType === OutputTypes.Standalone;
|
|
424
416
|
const includeOutputImports = components.some((component) => component.events.some((event) => !event.internal));
|
|
425
417
|
/**
|
|
426
418
|
* The collection of named imports from @angular/core.
|
|
@@ -529,7 +521,7 @@ const angularOutputTarget = (outputTarget) => ({
|
|
|
529
521
|
},
|
|
530
522
|
});
|
|
531
523
|
function normalizeOutputTarget(config, outputTarget) {
|
|
532
|
-
const results = Object.assign(Object.assign({}, outputTarget), { excludeComponents: outputTarget.excludeComponents || [], valueAccessorConfigs: outputTarget.valueAccessorConfigs || [], customElementsDir: outputTarget.customElementsDir || 'components', outputType: outputTarget.outputType ||
|
|
524
|
+
const results = Object.assign(Object.assign({}, outputTarget), { excludeComponents: outputTarget.excludeComponents || [], valueAccessorConfigs: outputTarget.valueAccessorConfigs || [], customElementsDir: outputTarget.customElementsDir || 'components', outputType: outputTarget.outputType || OutputTypes.Component });
|
|
533
525
|
if (config.rootDir == null) {
|
|
534
526
|
throw new Error('rootDir is not set and it should be set by stencil itself');
|
|
535
527
|
}
|
|
@@ -545,8 +537,8 @@ function normalizeOutputTarget(config, outputTarget) {
|
|
|
545
537
|
if (outputTarget.includeSingleComponentAngularModules !== undefined) {
|
|
546
538
|
throw new Error("The 'includeSingleComponentAngularModules' option has been removed. Please use 'outputType' instead.");
|
|
547
539
|
}
|
|
548
|
-
if (outputTarget.outputType ===
|
|
549
|
-
console.warn(`**Experimental**: outputType: "${
|
|
540
|
+
if (outputTarget.outputType === OutputTypes.Scam) {
|
|
541
|
+
console.warn(`**Experimental**: outputType: "${OutputTypes.Scam}" is a developer preview feature and may change or be removed in the future.`);
|
|
550
542
|
}
|
|
551
543
|
return results;
|
|
552
544
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import { EOL } from 'os';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
var OutputType;
|
|
11
|
-
(function (OutputType) {
|
|
12
|
-
OutputType["Component"] = "component";
|
|
13
|
-
OutputType["Scam"] = "scam";
|
|
14
|
-
OutputType["Standalone"] = "standalone";
|
|
15
|
-
})(OutputType || (OutputType = {}));
|
|
16
|
-
|
|
4
|
+
const OutputTypes = {
|
|
5
|
+
Component: 'component',
|
|
6
|
+
Scam: 'scam',
|
|
7
|
+
Standalone: 'standalone',
|
|
8
|
+
};
|
|
17
9
|
const toLowerCase = (str) => str.toLowerCase();
|
|
18
10
|
const dashToPascalCase = (str) => toLowerCase(str)
|
|
19
11
|
.split('-')
|
|
@@ -111,7 +103,7 @@ const createImportStatement = (imports, module) => {
|
|
|
111
103
|
* @returns `true` if the output type is for the custom elements build.
|
|
112
104
|
*/
|
|
113
105
|
const isOutputTypeCustomElementsBuild = (outputType) => {
|
|
114
|
-
return outputType ===
|
|
106
|
+
return outputType === OutputTypes.Standalone || outputType === OutputTypes.Scam;
|
|
115
107
|
};
|
|
116
108
|
/**
|
|
117
109
|
* Creates the collection of import statements for a component based on the component's events type dependencies.
|
|
@@ -410,9 +402,9 @@ function generateProxies(components, pkgData, outputTarget, rootDir) {
|
|
|
410
402
|
const dtsFilePath = path.join(rootDir, distTypesDir, GENERATED_DTS);
|
|
411
403
|
const { outputType } = outputTarget;
|
|
412
404
|
const componentsTypeFile = relativeImport(outputTarget.directivesProxyFile, dtsFilePath, '.d.ts');
|
|
413
|
-
const includeSingleComponentAngularModules = outputType ===
|
|
405
|
+
const includeSingleComponentAngularModules = outputType === OutputTypes.Scam;
|
|
414
406
|
const isCustomElementsBuild = isOutputTypeCustomElementsBuild(outputType);
|
|
415
|
-
const isStandaloneBuild = outputType ===
|
|
407
|
+
const isStandaloneBuild = outputType === OutputTypes.Standalone;
|
|
416
408
|
const includeOutputImports = components.some((component) => component.events.some((event) => !event.internal));
|
|
417
409
|
/**
|
|
418
410
|
* The collection of named imports from @angular/core.
|
|
@@ -521,7 +513,7 @@ const angularOutputTarget = (outputTarget) => ({
|
|
|
521
513
|
},
|
|
522
514
|
});
|
|
523
515
|
function normalizeOutputTarget(config, outputTarget) {
|
|
524
|
-
const results = Object.assign(Object.assign({}, outputTarget), { excludeComponents: outputTarget.excludeComponents || [], valueAccessorConfigs: outputTarget.valueAccessorConfigs || [], customElementsDir: outputTarget.customElementsDir || 'components', outputType: outputTarget.outputType ||
|
|
516
|
+
const results = Object.assign(Object.assign({}, outputTarget), { excludeComponents: outputTarget.excludeComponents || [], valueAccessorConfigs: outputTarget.valueAccessorConfigs || [], customElementsDir: outputTarget.customElementsDir || 'components', outputType: outputTarget.outputType || OutputTypes.Component });
|
|
525
517
|
if (config.rootDir == null) {
|
|
526
518
|
throw new Error('rootDir is not set and it should be set by stencil itself');
|
|
527
519
|
}
|
|
@@ -537,8 +529,8 @@ function normalizeOutputTarget(config, outputTarget) {
|
|
|
537
529
|
if (outputTarget.includeSingleComponentAngularModules !== undefined) {
|
|
538
530
|
throw new Error("The 'includeSingleComponentAngularModules' option has been removed. Please use 'outputType' instead.");
|
|
539
531
|
}
|
|
540
|
-
if (outputTarget.outputType ===
|
|
541
|
-
console.warn(`**Experimental**: outputType: "${
|
|
532
|
+
if (outputTarget.outputType === OutputTypes.Scam) {
|
|
533
|
+
console.warn(`**Experimental**: outputType: "${OutputTypes.Scam}" is a developer preview feature and may change or be removed in the future.`);
|
|
542
534
|
}
|
|
543
535
|
return results;
|
|
544
536
|
}
|
package/dist/output-angular.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
-
import {
|
|
3
|
-
import { relativeImport, normalizePath, sortBy, readPackageJson, dashToPascalCase, createImportStatement, isOutputTypeCustomElementsBuild, } from './utils';
|
|
2
|
+
import { relativeImport, normalizePath, sortBy, readPackageJson, dashToPascalCase, createImportStatement, isOutputTypeCustomElementsBuild, OutputTypes, } from './utils';
|
|
4
3
|
import { createAngularComponentDefinition, createComponentTypeDefinition } from './generate-angular-component';
|
|
5
4
|
import { generateAngularDirectivesFile } from './generate-angular-directives-file';
|
|
6
5
|
import generateValueAccessors from './generate-value-accessors';
|
|
@@ -40,9 +39,9 @@ export function generateProxies(components, pkgData, outputTarget, rootDir) {
|
|
|
40
39
|
const dtsFilePath = path.join(rootDir, distTypesDir, GENERATED_DTS);
|
|
41
40
|
const { outputType } = outputTarget;
|
|
42
41
|
const componentsTypeFile = relativeImport(outputTarget.directivesProxyFile, dtsFilePath, '.d.ts');
|
|
43
|
-
const includeSingleComponentAngularModules = outputType ===
|
|
42
|
+
const includeSingleComponentAngularModules = outputType === OutputTypes.Scam;
|
|
44
43
|
const isCustomElementsBuild = isOutputTypeCustomElementsBuild(outputType);
|
|
45
|
-
const isStandaloneBuild = outputType ===
|
|
44
|
+
const isStandaloneBuild = outputType === OutputTypes.Standalone;
|
|
46
45
|
const includeOutputImports = components.some((component) => component.events.some((event) => !event.internal));
|
|
47
46
|
/**
|
|
48
47
|
* The collection of named imports from @angular/core.
|
package/dist/plugin.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { normalizePath } from './utils';
|
|
1
|
+
import { OutputTypes, normalizePath } from './utils';
|
|
2
2
|
import { angularDirectiveProxyOutput } from './output-angular';
|
|
3
|
-
import { OutputType } from './types';
|
|
4
3
|
import path from 'path';
|
|
5
4
|
export const angularOutputTarget = (outputTarget) => ({
|
|
6
5
|
type: 'custom',
|
|
@@ -15,7 +14,7 @@ export const angularOutputTarget = (outputTarget) => ({
|
|
|
15
14
|
},
|
|
16
15
|
});
|
|
17
16
|
export function normalizeOutputTarget(config, outputTarget) {
|
|
18
|
-
const results = Object.assign(Object.assign({}, outputTarget), { excludeComponents: outputTarget.excludeComponents || [], valueAccessorConfigs: outputTarget.valueAccessorConfigs || [], customElementsDir: outputTarget.customElementsDir || 'components', outputType: outputTarget.outputType ||
|
|
17
|
+
const results = Object.assign(Object.assign({}, outputTarget), { excludeComponents: outputTarget.excludeComponents || [], valueAccessorConfigs: outputTarget.valueAccessorConfigs || [], customElementsDir: outputTarget.customElementsDir || 'components', outputType: outputTarget.outputType || OutputTypes.Component });
|
|
19
18
|
if (config.rootDir == null) {
|
|
20
19
|
throw new Error('rootDir is not set and it should be set by stencil itself');
|
|
21
20
|
}
|
|
@@ -31,8 +30,8 @@ export function normalizeOutputTarget(config, outputTarget) {
|
|
|
31
30
|
if (outputTarget.includeSingleComponentAngularModules !== undefined) {
|
|
32
31
|
throw new Error("The 'includeSingleComponentAngularModules' option has been removed. Please use 'outputType' instead.");
|
|
33
32
|
}
|
|
34
|
-
if (outputTarget.outputType ===
|
|
35
|
-
console.warn(`**Experimental**: outputType: "${
|
|
33
|
+
if (outputTarget.outputType === OutputTypes.Scam) {
|
|
34
|
+
console.warn(`**Experimental**: outputType: "${OutputTypes.Scam}" is a developer preview feature and may change or be removed in the future.`);
|
|
36
35
|
}
|
|
37
36
|
return results;
|
|
38
37
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -4,11 +4,7 @@
|
|
|
4
4
|
* - `scam` - Generate a Single Component Angular Module for each component.
|
|
5
5
|
* - `standalone` - Generate a component with the `standalone` flag set to `true`.
|
|
6
6
|
*/
|
|
7
|
-
export declare
|
|
8
|
-
Component = "component",
|
|
9
|
-
Scam = "scam",
|
|
10
|
-
Standalone = "standalone"
|
|
11
|
-
}
|
|
7
|
+
export declare type OutputType = 'component' | 'scam' | 'standalone';
|
|
12
8
|
export interface OutputTargetAngular {
|
|
13
9
|
/**
|
|
14
10
|
* The package name of the component library.
|
|
@@ -30,7 +26,7 @@ export interface OutputTargetAngular {
|
|
|
30
26
|
* - `scam` - @experimental Generate a Single Component Angular Module for each component.
|
|
31
27
|
* - `standalone` - Generate a component with the `standalone` flag set to `true`.
|
|
32
28
|
*/
|
|
33
|
-
outputType
|
|
29
|
+
outputType?: OutputType;
|
|
34
30
|
}
|
|
35
31
|
export declare type ValueAccessorTypes = 'text' | 'radio' | 'select' | 'number' | 'boolean';
|
|
36
32
|
export interface ValueAccessorConfig {
|
package/dist/types.js
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The type of output that can be generated with the Angular output target.
|
|
3
|
-
* - `component` - Generate many component wrappers tied to a single Angular module (lazy/hydrated approach).
|
|
4
|
-
* - `scam` - Generate a Single Component Angular Module for each component.
|
|
5
|
-
* - `standalone` - Generate a component with the `standalone` flag set to `true`.
|
|
6
|
-
*/
|
|
7
|
-
export var OutputType;
|
|
8
|
-
(function (OutputType) {
|
|
9
|
-
OutputType["Component"] = "component";
|
|
10
|
-
OutputType["Scam"] = "scam";
|
|
11
|
-
OutputType["Standalone"] = "standalone";
|
|
12
|
-
})(OutputType || (OutputType = {}));
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ComponentCompilerEvent, Config } from '@stencil/core/internal';
|
|
2
2
|
import { OutputType, PackageJSON } from './types';
|
|
3
|
+
export declare const OutputTypes: {
|
|
4
|
+
[key: string]: OutputType;
|
|
5
|
+
};
|
|
3
6
|
export declare const toLowerCase: (str: string) => string;
|
|
4
7
|
export declare const dashToPascalCase: (str: string) => string;
|
|
5
8
|
export declare function sortBy<T>(array: T[], prop: (item: T) => string): T[];
|
package/dist/utils.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
-
|
|
2
|
+
export const OutputTypes = {
|
|
3
|
+
Component: 'component',
|
|
4
|
+
Scam: 'scam',
|
|
5
|
+
Standalone: 'standalone',
|
|
6
|
+
};
|
|
3
7
|
export const toLowerCase = (str) => str.toLowerCase();
|
|
4
8
|
export const dashToPascalCase = (str) => toLowerCase(str)
|
|
5
9
|
.split('-')
|
|
@@ -100,7 +104,7 @@ export const createImportStatement = (imports, module) => {
|
|
|
100
104
|
* @returns `true` if the output type is for the custom elements build.
|
|
101
105
|
*/
|
|
102
106
|
export const isOutputTypeCustomElementsBuild = (outputType) => {
|
|
103
|
-
return outputType ===
|
|
107
|
+
return outputType === OutputTypes.Standalone || outputType === OutputTypes.Scam;
|
|
104
108
|
};
|
|
105
109
|
/**
|
|
106
110
|
* Creates the collection of import statements for a component based on the component's events type dependencies.
|
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.11691592740.18e8ffbc",
|
|
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": "8e8ffbccb48cd9a2584e09710677d47e1ffce5b9",
|
|
62
62
|
"volta": {
|
|
63
63
|
"extends": "../../package.json"
|
|
64
64
|
}
|