@breadstone-tools/cem-core 0.0.12-beta.0
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/Ast/Ast.d.ts +224 -0
- package/Ast/Ast.d.ts.map +1 -0
- package/Ast/Ast.js +557 -0
- package/Ast/Ast.js.map +1 -0
- package/Ast/Builder/BuildArrowFunction.d.ts +14 -0
- package/Ast/Builder/BuildArrowFunction.d.ts.map +1 -0
- package/Ast/Builder/BuildArrowFunction.js +29 -0
- package/Ast/Builder/BuildArrowFunction.js.map +1 -0
- package/Ast/Builder/BuildAttribute.d.ts +16 -0
- package/Ast/Builder/BuildAttribute.d.ts.map +1 -0
- package/Ast/Builder/BuildAttribute.js +36 -0
- package/Ast/Builder/BuildAttribute.js.map +1 -0
- package/Ast/Builder/BuildClass.d.ts +24 -0
- package/Ast/Builder/BuildClass.d.ts.map +1 -0
- package/Ast/Builder/BuildClass.js +251 -0
- package/Ast/Builder/BuildClass.js.map +1 -0
- package/Ast/Builder/BuildClassField.d.ts +14 -0
- package/Ast/Builder/BuildClassField.d.ts.map +1 -0
- package/Ast/Builder/BuildClassField.js +34 -0
- package/Ast/Builder/BuildClassField.js.map +1 -0
- package/Ast/Builder/BuildFunctionLike.d.ts +41 -0
- package/Ast/Builder/BuildFunctionLike.d.ts.map +1 -0
- package/Ast/Builder/BuildFunctionLike.js +80 -0
- package/Ast/Builder/BuildFunctionLike.js.map +1 -0
- package/Ast/Builder/BuildMixin.d.ts +19 -0
- package/Ast/Builder/BuildMixin.d.ts.map +1 -0
- package/Ast/Builder/BuildMixin.js +50 -0
- package/Ast/Builder/BuildMixin.js.map +1 -0
- package/Ast/Builder/BuildVariable.d.ts +15 -0
- package/Ast/Builder/BuildVariable.d.ts.map +1 -0
- package/Ast/Builder/BuildVariable.js +29 -0
- package/Ast/Builder/BuildVariable.js.map +1 -0
- package/Ast/Handler/HandleAttrJsDoc.d.ts +10 -0
- package/Ast/Handler/HandleAttrJsDoc.d.ts.map +1 -0
- package/Ast/Handler/HandleAttrJsDoc.js +43 -0
- package/Ast/Handler/HandleAttrJsDoc.js.map +1 -0
- package/Ast/Handler/HandleCollectMixins.d.ts +10 -0
- package/Ast/Handler/HandleCollectMixins.d.ts.map +1 -0
- package/Ast/Handler/HandleCollectMixins.js +27 -0
- package/Ast/Handler/HandleCollectMixins.js.map +1 -0
- package/Ast/Handler/HandleCreateClassDeclarationMixin.d.ts +9 -0
- package/Ast/Handler/HandleCreateClassDeclarationMixin.d.ts.map +1 -0
- package/Ast/Handler/HandleCreateClassDeclarationMixin.js +38 -0
- package/Ast/Handler/HandleCreateClassDeclarationMixin.js.map +1 -0
- package/Ast/Handler/HandleCustomJsDocTags.d.ts +8 -0
- package/Ast/Handler/HandleCustomJsDocTags.d.ts.map +1 -0
- package/Ast/Handler/HandleCustomJsDocTags.js +31 -0
- package/Ast/Handler/HandleCustomJsDocTags.js.map +1 -0
- package/Ast/Handler/HandleDefaultValue.d.ts +10 -0
- package/Ast/Handler/HandleDefaultValue.d.ts.map +1 -0
- package/Ast/Handler/HandleDefaultValue.js +48 -0
- package/Ast/Handler/HandleDefaultValue.js.map +1 -0
- package/Ast/Handler/HandleExplicitType.d.ts +10 -0
- package/Ast/Handler/HandleExplicitType.d.ts.map +1 -0
- package/Ast/Handler/HandleExplicitType.js +28 -0
- package/Ast/Handler/HandleExplicitType.js.map +1 -0
- package/Ast/Handler/HandleHeritage.d.ts +11 -0
- package/Ast/Handler/HandleHeritage.d.ts.map +1 -0
- package/Ast/Handler/HandleHeritage.js +67 -0
- package/Ast/Handler/HandleHeritage.js.map +1 -0
- package/Ast/Handler/HandleJsDoc.d.ts +9 -0
- package/Ast/Handler/HandleJsDoc.d.ts.map +1 -0
- package/Ast/Handler/HandleJsDoc.js +90 -0
- package/Ast/Handler/HandleJsDoc.js.map +1 -0
- package/Ast/Handler/HandleJsDocParameterTag.d.ts +8 -0
- package/Ast/Handler/HandleJsDocParameterTag.d.ts.map +1 -0
- package/Ast/Handler/HandleJsDocParameterTag.js +59 -0
- package/Ast/Handler/HandleJsDocParameterTag.js.map +1 -0
- package/Ast/Handler/HandleModifiers.d.ts +13 -0
- package/Ast/Handler/HandleModifiers.d.ts.map +1 -0
- package/Ast/Handler/HandleModifiers.js +49 -0
- package/Ast/Handler/HandleModifiers.js.map +1 -0
- package/Ast/Handler/HandlePrivateMember.d.ts +10 -0
- package/Ast/Handler/HandlePrivateMember.d.ts.map +1 -0
- package/Ast/Handler/HandlePrivateMember.js +25 -0
- package/Ast/Handler/HandlePrivateMember.js.map +1 -0
- package/Ast/Handler/HandleTypeInference.d.ts +9 -0
- package/Ast/Handler/HandleTypeInference.d.ts.map +1 -0
- package/Ast/Handler/HandleTypeInference.js +46 -0
- package/Ast/Handler/HandleTypeInference.js.map +1 -0
- package/Ast/Handler/HandleWellKnownTypes.d.ts +11 -0
- package/Ast/Handler/HandleWellKnownTypes.d.ts.map +1 -0
- package/Ast/Handler/HandleWellKnownTypes.js +28 -0
- package/Ast/Handler/HandleWellKnownTypes.js.map +1 -0
- package/Ast/Manifest.d.ts +47 -0
- package/Ast/Manifest.d.ts.map +1 -0
- package/Ast/Manifest.js +209 -0
- package/Ast/Manifest.js.map +1 -0
- package/Index.d.ts +9 -0
- package/Index.d.ts.map +1 -0
- package/Index.js +8 -0
- package/Index.js.map +1 -0
- package/LICENSE +21 -0
- package/Plugins/Analyse/ArrowFunctionPlugin.d.ts +13 -0
- package/Plugins/Analyse/ArrowFunctionPlugin.d.ts.map +1 -0
- package/Plugins/Analyse/ArrowFunctionPlugin.js +37 -0
- package/Plugins/Analyse/ArrowFunctionPlugin.js.map +1 -0
- package/Plugins/Analyse/ClassJsDocPlugin.d.ts +25 -0
- package/Plugins/Analyse/ClassJsDocPlugin.d.ts.map +1 -0
- package/Plugins/Analyse/ClassJsDocPlugin.js +200 -0
- package/Plugins/Analyse/ClassJsDocPlugin.js.map +1 -0
- package/Plugins/Analyse/ClassPlugin.d.ts +13 -0
- package/Plugins/Analyse/ClassPlugin.d.ts.map +1 -0
- package/Plugins/Analyse/ClassPlugin.js +32 -0
- package/Plugins/Analyse/ClassPlugin.js.map +1 -0
- package/Plugins/Analyse/CustomElementsDefineCallsPlugin.d.ts +15 -0
- package/Plugins/Analyse/CustomElementsDefineCallsPlugin.d.ts.map +1 -0
- package/Plugins/Analyse/CustomElementsDefineCallsPlugin.js +112 -0
- package/Plugins/Analyse/CustomElementsDefineCallsPlugin.js.map +1 -0
- package/Plugins/Analyse/ExportsPlugin.d.ts +18 -0
- package/Plugins/Analyse/ExportsPlugin.d.ts.map +1 -0
- package/Plugins/Analyse/ExportsPlugin.js +154 -0
- package/Plugins/Analyse/ExportsPlugin.js.map +1 -0
- package/Plugins/Analyse/FunctionLikePlugin.d.ts +14 -0
- package/Plugins/Analyse/FunctionLikePlugin.d.ts.map +1 -0
- package/Plugins/Analyse/FunctionLikePlugin.js +36 -0
- package/Plugins/Analyse/FunctionLikePlugin.js.map +1 -0
- package/Plugins/Analyse/MixinPlugin.d.ts +13 -0
- package/Plugins/Analyse/MixinPlugin.d.ts.map +1 -0
- package/Plugins/Analyse/MixinPlugin.js +36 -0
- package/Plugins/Analyse/MixinPlugin.js.map +1 -0
- package/Plugins/Analyse/ReexportedWrappedMixinExportsPlugin.d.ts +15 -0
- package/Plugins/Analyse/ReexportedWrappedMixinExportsPlugin.d.ts.map +1 -0
- package/Plugins/Analyse/ReexportedWrappedMixinExportsPlugin.js +56 -0
- package/Plugins/Analyse/ReexportedWrappedMixinExportsPlugin.js.map +1 -0
- package/Plugins/Analyse/VariablePlugin.d.ts +13 -0
- package/Plugins/Analyse/VariablePlugin.d.ts.map +1 -0
- package/Plugins/Analyse/VariablePlugin.js +40 -0
- package/Plugins/Analyse/VariablePlugin.js.map +1 -0
- package/Plugins/Collect/CollectImportsPlugin.d.ts +6 -0
- package/Plugins/Collect/CollectImportsPlugin.d.ts.map +1 -0
- package/Plugins/Collect/CollectImportsPlugin.js +100 -0
- package/Plugins/Collect/CollectImportsPlugin.js.map +1 -0
- package/Plugins/Framework/Catalyst/Catalyst.d.ts +3 -0
- package/Plugins/Framework/Catalyst/Catalyst.d.ts.map +1 -0
- package/Plugins/Framework/Catalyst/Catalyst.js +9 -0
- package/Plugins/Framework/Catalyst/Catalyst.js.map +1 -0
- package/Plugins/Framework/Fast/Fast.d.ts +3 -0
- package/Plugins/Framework/Fast/Fast.d.ts.map +1 -0
- package/Plugins/Framework/Fast/Fast.js +9 -0
- package/Plugins/Framework/Fast/Fast.js.map +1 -0
- package/Plugins/Framework/Lit/Lit.d.ts +8 -0
- package/Plugins/Framework/Lit/Lit.d.ts.map +1 -0
- package/Plugins/Framework/Lit/Lit.js +25 -0
- package/Plugins/Framework/Lit/Lit.js.map +1 -0
- package/Plugins/Framework/Lit/MemberDenyListPlugin.d.ts +16 -0
- package/Plugins/Framework/Lit/MemberDenyListPlugin.d.ts.map +1 -0
- package/Plugins/Framework/Lit/MemberDenyListPlugin.js +37 -0
- package/Plugins/Framework/Lit/MemberDenyListPlugin.js.map +1 -0
- package/Plugins/Framework/Lit/MethodDenyListPlugin.d.ts +24 -0
- package/Plugins/Framework/Lit/MethodDenyListPlugin.d.ts.map +1 -0
- package/Plugins/Framework/Lit/MethodDenyListPlugin.js +51 -0
- package/Plugins/Framework/Lit/MethodDenyListPlugin.js.map +1 -0
- package/Plugins/Framework/Lit/PropertyDecoratorPlugin.d.ts +16 -0
- package/Plugins/Framework/Lit/PropertyDecoratorPlugin.d.ts.map +1 -0
- package/Plugins/Framework/Lit/PropertyDecoratorPlugin.js +100 -0
- package/Plugins/Framework/Lit/PropertyDecoratorPlugin.js.map +1 -0
- package/Plugins/Framework/Lit/StaticPropertiesPlugin.d.ts +17 -0
- package/Plugins/Framework/Lit/StaticPropertiesPlugin.d.ts.map +1 -0
- package/Plugins/Framework/Lit/StaticPropertiesPlugin.js +126 -0
- package/Plugins/Framework/Lit/StaticPropertiesPlugin.js.map +1 -0
- package/Plugins/Framework/Lwc/Lwc.d.ts +3 -0
- package/Plugins/Framework/Lwc/Lwc.d.ts.map +1 -0
- package/Plugins/Framework/Lwc/Lwc.js +9 -0
- package/Plugins/Framework/Lwc/Lwc.js.map +1 -0
- package/Plugins/Framework/Shared/AttrDecoratorPlugin.d.ts +18 -0
- package/Plugins/Framework/Shared/AttrDecoratorPlugin.d.ts.map +1 -0
- package/Plugins/Framework/Shared/AttrDecoratorPlugin.js +80 -0
- package/Plugins/Framework/Shared/AttrDecoratorPlugin.js.map +1 -0
- package/Plugins/Framework/Shared/CustomElementDecoratorPlugin.d.ts +14 -0
- package/Plugins/Framework/Shared/CustomElementDecoratorPlugin.d.ts.map +1 -0
- package/Plugins/Framework/Shared/CustomElementDecoratorPlugin.js +67 -0
- package/Plugins/Framework/Shared/CustomElementDecoratorPlugin.js.map +1 -0
- package/Plugins/Framework/Stencil/Stencil.d.ts +3 -0
- package/Plugins/Framework/Stencil/Stencil.d.ts.map +1 -0
- package/Plugins/Framework/Stencil/Stencil.js +9 -0
- package/Plugins/Framework/Stencil/Stencil.js.map +1 -0
- package/Plugins/Link/CleanupClassesPlugin.d.ts +6 -0
- package/Plugins/Link/CleanupClassesPlugin.d.ts.map +1 -0
- package/Plugins/Link/CleanupClassesPlugin.js +24 -0
- package/Plugins/Link/CleanupClassesPlugin.js.map +1 -0
- package/Plugins/Link/FieldDenyListPlugin.d.ts +6 -0
- package/Plugins/Link/FieldDenyListPlugin.d.ts.map +1 -0
- package/Plugins/Link/FieldDenyListPlugin.js +23 -0
- package/Plugins/Link/FieldDenyListPlugin.js.map +1 -0
- package/Plugins/Link/MethodDenyListPlugin.d.ts +6 -0
- package/Plugins/Link/MethodDenyListPlugin.d.ts.map +1 -0
- package/Plugins/Link/MethodDenyListPlugin.js +26 -0
- package/Plugins/Link/MethodDenyListPlugin.js.map +1 -0
- package/Plugins/PostProcessing/ApplyInheritancePlugin.d.ts +6 -0
- package/Plugins/PostProcessing/ApplyInheritancePlugin.d.ts.map +1 -0
- package/Plugins/PostProcessing/ApplyInheritancePlugin.js +87 -0
- package/Plugins/PostProcessing/ApplyInheritancePlugin.js.map +1 -0
- package/Plugins/PostProcessing/IsCustomElementPlugin.d.ts +6 -0
- package/Plugins/PostProcessing/IsCustomElementPlugin.d.ts.map +1 -0
- package/Plugins/PostProcessing/IsCustomElementPlugin.js +35 -0
- package/Plugins/PostProcessing/IsCustomElementPlugin.js.map +1 -0
- package/Plugins/PostProcessing/LinkClassToTagnamePlugin.d.ts +6 -0
- package/Plugins/PostProcessing/LinkClassToTagnamePlugin.d.ts.map +1 -0
- package/Plugins/PostProcessing/LinkClassToTagnamePlugin.js +28 -0
- package/Plugins/PostProcessing/LinkClassToTagnamePlugin.js.map +1 -0
- package/Plugins/PostProcessing/RemoveUnexportedDeclarationsPlugin.d.ts +6 -0
- package/Plugins/PostProcessing/RemoveUnexportedDeclarationsPlugin.d.ts.map +1 -0
- package/Plugins/PostProcessing/RemoveUnexportedDeclarationsPlugin.js +21 -0
- package/Plugins/PostProcessing/RemoveUnexportedDeclarationsPlugin.js.map +1 -0
- package/Plugins/PostProcessing/ResolveInitializersPlugin.d.ts +6 -0
- package/Plugins/PostProcessing/ResolveInitializersPlugin.d.ts.map +1 -0
- package/Plugins/PostProcessing/ResolveInitializersPlugin.js +59 -0
- package/Plugins/PostProcessing/ResolveInitializersPlugin.js.map +1 -0
- package/Services/DependencyService.d.ts +1 -0
- package/Services/DependencyService.d.ts.map +1 -0
- package/Services/DependencyService.js +112 -0
- package/Services/DependencyService.js.map +1 -0
- package/Services/Interfaces/IDependencyService.d.ts +12 -0
- package/Services/Interfaces/IDependencyService.d.ts.map +1 -0
- package/Services/Interfaces/IDependencyService.js +4 -0
- package/Services/Interfaces/IDependencyService.js.map +1 -0
- package/Services/Interfaces/IManifestBuilder.d.ts +16 -0
- package/Services/Interfaces/IManifestBuilder.d.ts.map +1 -0
- package/Services/Interfaces/IManifestBuilder.js +4 -0
- package/Services/Interfaces/IManifestBuilder.js.map +1 -0
- package/Services/Interfaces/IManifestEngine.d.ts +16 -0
- package/Services/Interfaces/IManifestEngine.d.ts.map +1 -0
- package/Services/Interfaces/IManifestEngine.js +4 -0
- package/Services/Interfaces/IManifestEngine.js.map +1 -0
- package/Services/ManifestBuilder.d.ts +47 -0
- package/Services/ManifestBuilder.d.ts.map +1 -0
- package/Services/ManifestBuilder.js +49 -0
- package/Services/ManifestBuilder.js.map +1 -0
- package/Services/ManifestEngine.d.ts +62 -0
- package/Services/ManifestEngine.d.ts.map +1 -0
- package/Services/ManifestEngine.js +283 -0
- package/Services/ManifestEngine.js.map +1 -0
- package/Types/Framework.d.ts +2 -0
- package/Types/Framework.d.ts.map +1 -0
- package/Types/Framework.js +3 -0
- package/Types/Framework.js.map +1 -0
- package/Types.d.ts +1 -0
- package/Types.d.ts.map +1 -0
- package/Types.js +45 -0
- package/Types.js.map +1 -0
- package/Utils.d.ts +50 -0
- package/Utils.d.ts.map +1 -0
- package/Utils.js +147 -0
- package/Utils.js.map +1 -0
- package/package.json +23 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ManifestBuilder = void 0;
|
|
5
|
+
const ManifestEngine_js_1 = require("./ManifestEngine.js");
|
|
6
|
+
/**
|
|
7
|
+
* The `ManifestBuilder` class.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
class ManifestBuilder {
|
|
12
|
+
// #region Fields
|
|
13
|
+
_logger;
|
|
14
|
+
_engine;
|
|
15
|
+
// #endregion
|
|
16
|
+
// #region Ctor
|
|
17
|
+
/**
|
|
18
|
+
* Constructs a new instance of the `ManifestBuilder` class.
|
|
19
|
+
*
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
constructor(config) {
|
|
23
|
+
this._logger = config.logger;
|
|
24
|
+
this._engine = config.engine ?? new ManifestEngine_js_1.ManifestEngine({
|
|
25
|
+
compiler: config.compiler,
|
|
26
|
+
debug: config.debug,
|
|
27
|
+
quiet: config.quiet,
|
|
28
|
+
verbose: config.verbose,
|
|
29
|
+
logger: this._logger,
|
|
30
|
+
framework: config.framework
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
// #endregion
|
|
34
|
+
// #region Methods
|
|
35
|
+
/**
|
|
36
|
+
* Creates a manifest.
|
|
37
|
+
*
|
|
38
|
+
* @param sources - The sources to include in the manifest.
|
|
39
|
+
* @param plugins - The plugins to use when creating the manifest.
|
|
40
|
+
* @returns The manifest.
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
create(sources, plugins) {
|
|
45
|
+
return this._engine.run(sources, plugins);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.ManifestBuilder = ManifestBuilder;
|
|
49
|
+
//# sourceMappingURL=ManifestBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManifestBuilder.js","sourceRoot":"","sources":["../../src/Services/ManifestBuilder.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAOlB,2DAAqD;AAqBrD;;;;GAIG;AACH,MAAa,eAAe;IAExB,iBAAiB;IAEA,OAAO,CAAU;IACjB,OAAO,CAAkB;IAE1C,aAAa;IAEb,eAAe;IAEf;;;;OAIG;IACH,YAAmB,MAA8B;QAC7C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,IAAI,IAAI,kCAAc,CAAC;YAC/C,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,SAAS,EAAE,MAAM,CAAC,SAAS;SAC9B,CAAC,CAAC;IACP,CAAC;IAED,aAAa;IAEb,kBAAkB;IAElB;;;;;;;;OAQG;IACI,MAAM,CAAC,OAA6B,EAAE,OAAwB;QACjE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;CAIJ;AA/CD,0CA+CC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { IPlugin } from '@breadstone-tools/cem-plugin';
|
|
2
|
+
import ts from 'typescript';
|
|
3
|
+
import type { Framework } from '../Types/Framework.js';
|
|
4
|
+
import type { IManifestEngine, IManifestEngineRunResult } from './Interfaces/IManifestEngine.js';
|
|
5
|
+
import { type ILogger } from '@breadstone-infrastructure/utilities';
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface IManifestEngineConfig {
|
|
10
|
+
compiler: {
|
|
11
|
+
program: ts.Program;
|
|
12
|
+
typeChecker: ts.TypeChecker;
|
|
13
|
+
};
|
|
14
|
+
debug?: boolean;
|
|
15
|
+
quiet?: boolean;
|
|
16
|
+
verbose?: boolean;
|
|
17
|
+
logger: ILogger;
|
|
18
|
+
framework?: Framework;
|
|
19
|
+
plugins?: Array<IPlugin>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The `ManifestEngine` class.
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export declare class ManifestEngine implements IManifestEngine {
|
|
27
|
+
private readonly _program;
|
|
28
|
+
private readonly _typeChecker;
|
|
29
|
+
private readonly _debug;
|
|
30
|
+
private readonly _verbose;
|
|
31
|
+
private readonly _quiet;
|
|
32
|
+
private readonly _logger;
|
|
33
|
+
private readonly _plugins;
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new instance of the `ManifestEngine` class.
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
constructor(config: IManifestEngineConfig);
|
|
40
|
+
/**
|
|
41
|
+
* Runs the manifest engine to create a manifest.
|
|
42
|
+
* It will run the plugins in the following order:
|
|
43
|
+
* 1. Initialize
|
|
44
|
+
* 2. Collect
|
|
45
|
+
* 3. Analyze
|
|
46
|
+
* 4. Module Link
|
|
47
|
+
* 5. Post Processing
|
|
48
|
+
* 6. Framework Specific
|
|
49
|
+
*
|
|
50
|
+
* @param sources - The sources to include in the manifest.
|
|
51
|
+
* @param plugins - The plugins to use when creating the manifest.
|
|
52
|
+
* @returns The manifest.
|
|
53
|
+
*
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
run(sources: Array<ts.SourceFile>, plugins?: Array<IPlugin>): IManifestEngineRunResult;
|
|
57
|
+
private initialize;
|
|
58
|
+
private collect;
|
|
59
|
+
private analyze;
|
|
60
|
+
private moduleLink;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=ManifestEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManifestEngine.d.ts","sourceRoot":"","sources":["../../src/Services/ManifestEngine.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAW,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,MAAM,YAAY,CAAC;AAwB5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,EAAQ,KAAK,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAI1E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE;QACN,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;QACpB,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC;KAC/B,CAAC;IACF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;CAC5B;AAED;;;;GAIG;AACH,qBAAa,cAAe,YAAW,eAAe;IAIlD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAa;IACtC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAiB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiB;IAM1C;;;;OAIG;gBACgB,MAAM,EAAE,qBAAqB;IA8ChD;;;;;;;;;;;;;;;OAeG;IACI,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,wBAAwB;IAsD7F,OAAO,CAAC,UAAU;IAsBlB,OAAO,CAAC,OAAO;IAkCf,OAAO,CAAC,OAAO;IA2Cf,OAAO,CAAC,UAAU;CA0BrB"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ManifestEngine = void 0;
|
|
8
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
9
|
+
const ArrowFunctionPlugin_js_1 = require("../Plugins/Analyse/ArrowFunctionPlugin.js");
|
|
10
|
+
const ClassJsDocPlugin_js_1 = require("../Plugins/Analyse/ClassJsDocPlugin.js");
|
|
11
|
+
const ClassPlugin_js_1 = require("../Plugins/Analyse/ClassPlugin.js");
|
|
12
|
+
const CustomElementsDefineCallsPlugin_js_1 = require("../Plugins/Analyse/CustomElementsDefineCallsPlugin.js");
|
|
13
|
+
const ExportsPlugin_js_1 = require("../Plugins/Analyse/ExportsPlugin.js");
|
|
14
|
+
const FunctionLikePlugin_js_1 = require("../Plugins/Analyse/FunctionLikePlugin.js");
|
|
15
|
+
const MixinPlugin_js_1 = require("../Plugins/Analyse/MixinPlugin.js");
|
|
16
|
+
const ReexportedWrappedMixinExportsPlugin_js_1 = require("../Plugins/Analyse/ReexportedWrappedMixinExportsPlugin.js");
|
|
17
|
+
const VariablePlugin_js_1 = require("../Plugins/Analyse/VariablePlugin.js");
|
|
18
|
+
const CollectImportsPlugin_js_1 = require("../Plugins/Collect/CollectImportsPlugin.js");
|
|
19
|
+
const Catalyst_js_1 = require("../Plugins/Framework/Catalyst/Catalyst.js");
|
|
20
|
+
const Fast_js_1 = require("../Plugins/Framework/Fast/Fast.js");
|
|
21
|
+
const Lit_js_1 = require("../Plugins/Framework/Lit/Lit.js");
|
|
22
|
+
const Lwc_js_1 = require("../Plugins/Framework/Lwc/Lwc.js");
|
|
23
|
+
const Stencil_js_1 = require("../Plugins/Framework/Stencil/Stencil.js");
|
|
24
|
+
const CleanupClassesPlugin_js_1 = require("../Plugins/Link/CleanupClassesPlugin.js");
|
|
25
|
+
const FieldDenyListPlugin_js_1 = require("../Plugins/Link/FieldDenyListPlugin.js");
|
|
26
|
+
const MethodDenyListPlugin_js_1 = require("../Plugins/Link/MethodDenyListPlugin.js");
|
|
27
|
+
const ApplyInheritancePlugin_js_1 = require("../Plugins/PostProcessing/ApplyInheritancePlugin.js");
|
|
28
|
+
const IsCustomElementPlugin_js_1 = require("../Plugins/PostProcessing/IsCustomElementPlugin.js");
|
|
29
|
+
const LinkClassToTagnamePlugin_js_1 = require("../Plugins/PostProcessing/LinkClassToTagnamePlugin.js");
|
|
30
|
+
const RemoveUnexportedDeclarationsPlugin_js_1 = require("../Plugins/PostProcessing/RemoveUnexportedDeclarationsPlugin.js");
|
|
31
|
+
const ResolveInitializersPlugin_js_1 = require("../Plugins/PostProcessing/ResolveInitializersPlugin.js");
|
|
32
|
+
const utilities_1 = require("@breadstone-infrastructure/utilities");
|
|
33
|
+
/**
|
|
34
|
+
* The `ManifestEngine` class.
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
class ManifestEngine {
|
|
39
|
+
// #region Fields
|
|
40
|
+
_program;
|
|
41
|
+
_typeChecker;
|
|
42
|
+
_debug;
|
|
43
|
+
_verbose;
|
|
44
|
+
_quiet;
|
|
45
|
+
_logger;
|
|
46
|
+
_plugins;
|
|
47
|
+
// #endregion
|
|
48
|
+
// #region Ctor
|
|
49
|
+
/**
|
|
50
|
+
* Constructs a new instance of the `ManifestEngine` class.
|
|
51
|
+
*
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
constructor(config) {
|
|
55
|
+
this._program = config.compiler.program;
|
|
56
|
+
this._typeChecker = config.compiler.typeChecker;
|
|
57
|
+
this._debug = config.debug ?? false;
|
|
58
|
+
this._verbose = config.verbose ?? false;
|
|
59
|
+
this._quiet = config.quiet ?? false;
|
|
60
|
+
this._logger = config.logger;
|
|
61
|
+
this._plugins = [
|
|
62
|
+
// collect
|
|
63
|
+
(0, CollectImportsPlugin_js_1.collectImportsPlugin)(),
|
|
64
|
+
// analyze
|
|
65
|
+
(0, ExportsPlugin_js_1.exportsPlugin)(),
|
|
66
|
+
(0, CustomElementsDefineCallsPlugin_js_1.customElementsDefineCallsPlugin)(),
|
|
67
|
+
(0, FunctionLikePlugin_js_1.functionLikePlugin)(),
|
|
68
|
+
(0, ArrowFunctionPlugin_js_1.arrowFunctionPlugin)(),
|
|
69
|
+
(0, ClassPlugin_js_1.classPlugin)(),
|
|
70
|
+
(0, MixinPlugin_js_1.mixinPlugin)(),
|
|
71
|
+
(0, VariablePlugin_js_1.variablePlugin)(),
|
|
72
|
+
(0, ReexportedWrappedMixinExportsPlugin_js_1.reexportedWrappedMixinExportsPlugin)(),
|
|
73
|
+
(0, ClassJsDocPlugin_js_1.classJsDocPlugin)(),
|
|
74
|
+
// link
|
|
75
|
+
(0, MethodDenyListPlugin_js_1.methodDenyListPlugin)(),
|
|
76
|
+
(0, FieldDenyListPlugin_js_1.fieldDenyListPlugin)(),
|
|
77
|
+
(0, CleanupClassesPlugin_js_1.cleanupClassesPlugin)(),
|
|
78
|
+
// post processing
|
|
79
|
+
(0, ResolveInitializersPlugin_js_1.resolveInitializersPlugin)(),
|
|
80
|
+
(0, LinkClassToTagnamePlugin_js_1.linkClassToTagnamePlugin)(),
|
|
81
|
+
(0, IsCustomElementPlugin_js_1.isCustomElementPlugin)(),
|
|
82
|
+
(0, ApplyInheritancePlugin_js_1.applyInheritancePlugin)(),
|
|
83
|
+
(0, RemoveUnexportedDeclarationsPlugin_js_1.removeUnexportedDeclarationsPlugin)(),
|
|
84
|
+
// framework specific
|
|
85
|
+
...config.framework === 'lit' ? (0, Lit_js_1.litFrameworkPlugins)()() : [],
|
|
86
|
+
...config.framework === 'stencil' ? (0, Stencil_js_1.stencilFrameworkPlugins)()() : [],
|
|
87
|
+
...config.framework === 'fast' ? (0, Fast_js_1.fastFrameworkPlugins)()() : [],
|
|
88
|
+
...config.framework === 'catalyst' ? (0, Catalyst_js_1.catalystFrameworkPlugins)()() : [],
|
|
89
|
+
...config.framework === 'lwc' ? (0, Lwc_js_1.lwcFrameworkPlugins)()() : [],
|
|
90
|
+
// custom plugins
|
|
91
|
+
...config.plugins ?? []
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
// #endregion
|
|
95
|
+
// #region Methods
|
|
96
|
+
/**
|
|
97
|
+
* Runs the manifest engine to create a manifest.
|
|
98
|
+
* It will run the plugins in the following order:
|
|
99
|
+
* 1. Initialize
|
|
100
|
+
* 2. Collect
|
|
101
|
+
* 3. Analyze
|
|
102
|
+
* 4. Module Link
|
|
103
|
+
* 5. Post Processing
|
|
104
|
+
* 6. Framework Specific
|
|
105
|
+
*
|
|
106
|
+
* @param sources - The sources to include in the manifest.
|
|
107
|
+
* @param plugins - The plugins to use when creating the manifest.
|
|
108
|
+
* @returns The manifest.
|
|
109
|
+
*
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
run(sources, plugins) {
|
|
113
|
+
plugins = [
|
|
114
|
+
...this._plugins,
|
|
115
|
+
...plugins ?? []
|
|
116
|
+
];
|
|
117
|
+
const pack = {
|
|
118
|
+
schemaVersion: '2.1.0',
|
|
119
|
+
readme: '',
|
|
120
|
+
modules: new Array()
|
|
121
|
+
};
|
|
122
|
+
const context = {
|
|
123
|
+
program: this._program,
|
|
124
|
+
typeChecker: this._typeChecker,
|
|
125
|
+
debug: this._debug,
|
|
126
|
+
verbose: this._verbose,
|
|
127
|
+
quiet: this._quiet,
|
|
128
|
+
logger: this._logger
|
|
129
|
+
};
|
|
130
|
+
this._logger.log(' initializing plugins...');
|
|
131
|
+
this._logger.debug(` > found ${(0, utilities_1.bold)(plugins.length.toString())} plugins`);
|
|
132
|
+
plugins.forEach((x) => {
|
|
133
|
+
this._logger.debug(` > ${x.name}`);
|
|
134
|
+
const m = new Array();
|
|
135
|
+
if (x.onInit) {
|
|
136
|
+
m.push('onInit');
|
|
137
|
+
}
|
|
138
|
+
if (x.onCollect) {
|
|
139
|
+
m.push('onCollect');
|
|
140
|
+
}
|
|
141
|
+
if (x.onAnalyze) {
|
|
142
|
+
m.push('onAnalyze');
|
|
143
|
+
}
|
|
144
|
+
if (x.onModuleLink) {
|
|
145
|
+
m.push('onModuleLink');
|
|
146
|
+
}
|
|
147
|
+
if (x.onPackageLink) {
|
|
148
|
+
m.push('onPackageLink');
|
|
149
|
+
}
|
|
150
|
+
this._logger.debug(` ${m.join(' | ')}`);
|
|
151
|
+
});
|
|
152
|
+
this.initialize(plugins, context, pack);
|
|
153
|
+
this.collect(plugins, context, sources);
|
|
154
|
+
this.analyze(plugins, context, sources, pack);
|
|
155
|
+
this.moduleLink(plugins, context, pack);
|
|
156
|
+
return pack;
|
|
157
|
+
}
|
|
158
|
+
initialize(plugins, context, pack) {
|
|
159
|
+
this._logger.log(' initialize');
|
|
160
|
+
plugins.forEach((p) => {
|
|
161
|
+
withErrorHandling(p.name, () => {
|
|
162
|
+
if (p.onInit) {
|
|
163
|
+
if (this._verbose) {
|
|
164
|
+
this._logger.debug(` ${p.name} onInit`);
|
|
165
|
+
}
|
|
166
|
+
p.onInit({
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
168
|
+
// @ts-ignore
|
|
169
|
+
ts: typescript_1.default,
|
|
170
|
+
customElementsManifest: pack,
|
|
171
|
+
context: context
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
collect(plugins, context, sources) {
|
|
178
|
+
this._logger.log(' collect');
|
|
179
|
+
sources.forEach((source) => {
|
|
180
|
+
this._logger.debug(` > ${source.fileName}`);
|
|
181
|
+
const visitNode = (node) => {
|
|
182
|
+
plugins.forEach((p) => {
|
|
183
|
+
withErrorHandling(p.name, () => {
|
|
184
|
+
if (p.onCollect) {
|
|
185
|
+
// if (this._verbose) {
|
|
186
|
+
// this._logger.logDebug(` ${p.name} onCollect}`);
|
|
187
|
+
// }
|
|
188
|
+
p.onCollect({
|
|
189
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
190
|
+
// @ts-ignore
|
|
191
|
+
ts: typescript_1.default,
|
|
192
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
193
|
+
// @ts-ignore
|
|
194
|
+
node: node,
|
|
195
|
+
context: context
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
typescript_1.default.forEachChild(node, visitNode);
|
|
201
|
+
};
|
|
202
|
+
visitNode(source);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
analyze(plugins, context, sources, pack) {
|
|
206
|
+
this._logger.log(' analyze');
|
|
207
|
+
sources.forEach((source) => {
|
|
208
|
+
this._logger.debug(` > ${source.fileName}`);
|
|
209
|
+
const moduleDoc = {
|
|
210
|
+
kind: 'javascript-module',
|
|
211
|
+
path: source.fileName,
|
|
212
|
+
declarations: new Array(),
|
|
213
|
+
exports: new Array()
|
|
214
|
+
};
|
|
215
|
+
const visitNode = (node) => {
|
|
216
|
+
plugins.forEach((p) => {
|
|
217
|
+
withErrorHandling(p.name, () => {
|
|
218
|
+
if (p.onAnalyze) {
|
|
219
|
+
// if (this._verbose) {
|
|
220
|
+
// this._logger.logDebug(` ${node.kind} onAnalyze`);
|
|
221
|
+
// }
|
|
222
|
+
p.onAnalyze({
|
|
223
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
224
|
+
// @ts-ignore
|
|
225
|
+
ts: typescript_1.default,
|
|
226
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
227
|
+
// @ts-ignore
|
|
228
|
+
node: node,
|
|
229
|
+
moduleDoc: moduleDoc,
|
|
230
|
+
context: context
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
typescript_1.default.forEachChild(node, visitNode);
|
|
236
|
+
};
|
|
237
|
+
visitNode(source);
|
|
238
|
+
pack.modules.push(moduleDoc);
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
moduleLink(plugins, context, pack) {
|
|
242
|
+
this._logger.log(' module link');
|
|
243
|
+
plugins.forEach((p) => {
|
|
244
|
+
withErrorHandling(p.name, () => {
|
|
245
|
+
if (p.onModuleLink) {
|
|
246
|
+
if (this._verbose) {
|
|
247
|
+
this._logger.debug(` ${p.name} onModuleLink`);
|
|
248
|
+
}
|
|
249
|
+
p.onModuleLink({
|
|
250
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
251
|
+
// @ts-ignore
|
|
252
|
+
ts: typescript_1.default,
|
|
253
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
254
|
+
// @ts-ignore
|
|
255
|
+
moduleDoc: pack.modules,
|
|
256
|
+
context: context
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
exports.ManifestEngine = ManifestEngine;
|
|
264
|
+
/**
|
|
265
|
+
* Error handling function for plugins.
|
|
266
|
+
* @param name - The name of the plugin.
|
|
267
|
+
* @param cb - The callback function to execute.
|
|
268
|
+
*/
|
|
269
|
+
function withErrorHandling(name, cb) {
|
|
270
|
+
try {
|
|
271
|
+
cb();
|
|
272
|
+
}
|
|
273
|
+
catch (e) {
|
|
274
|
+
let errorMessage = '';
|
|
275
|
+
const externalError = `Looks like you've hit an error in third party plugin: ${name}. Please try to create a minimal reproduction and inform the author of the ${name} plugin.`;
|
|
276
|
+
const coreError = 'Looks like you\'ve hit an error in the core library. Please try to create a minimal reproduction at https://custom-elements-manifest.netlify.com and create an issue at: https://github.com/open-wc/custom-elements-manifest/issues';
|
|
277
|
+
if (name) {
|
|
278
|
+
errorMessage = name.startsWith('CORE') ? coreError : externalError;
|
|
279
|
+
}
|
|
280
|
+
throw new Error(`\n\n[${name || 'unnamed-plugin'}]: ${errorMessage}\n\n${e.stack}\n`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=ManifestEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManifestEngine.js","sourceRoot":"","sources":["../../src/Services/ManifestEngine.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;;;;AAIlB,4DAA4B;AAC5B,sFAAgF;AAChF,gFAA0E;AAC1E,sEAAgE;AAChE,8GAAwG;AACxG,0EAAoE;AACpE,oFAA8E;AAC9E,sEAAgE;AAChE,sHAAgH;AAChH,4EAAsE;AACtE,wFAAkF;AAClF,2EAAqF;AACrF,+D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AAY,EAAE,EAAY;IACjD,IAAI,CAAC;QACD,EAAE,EAAE,CAAC;IACT,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,IAAI,YAAY,GAAG,EAAE,CAAC;QACtB,MAAM,aAAa,GAAG,yDAAyD,IAAI,8EAA8E,IAAI,UAAU,CAAC;QAChL,MAAM,SAAS,GAAG,qOAAqO,CAAC;QAExP,IAAI,IAAI,EAAE,CAAC;YACP,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC;QACvE,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,IAAI,gBAAgB,MAAM,YAAY,OAAQ,CAAW,CAAC,KAAK,IAAI,CAAC,CAAC;IACrG,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Framework.d.ts","sourceRoot":"","sources":["../../src/Types/Framework.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Framework.js","sourceRoot":"","sources":["../../src/Types/Framework.ts"],"names":[],"mappings":""}
|
package/Types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=Types.d.ts.map
|
package/Types.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../src/Types.ts"],"names":[],"mappings":""}
|
package/Types.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// //#region Imports
|
|
3
|
+
// import { type ClassMember, type CssCustomProperty, type CustomElementDeclaration, type JavaScriptModule, type Package } from '@breadstone-tools/cem-infrastructure';
|
|
4
|
+
// //#endregion
|
|
5
|
+
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/naming-convention
|
|
6
|
+
// export interface CssProperty extends CssCustomProperty {
|
|
7
|
+
// type?: {
|
|
8
|
+
// text?: string;
|
|
9
|
+
// };
|
|
10
|
+
// }
|
|
11
|
+
// // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/ban-ts-comment
|
|
12
|
+
// // @ts-ignore
|
|
13
|
+
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
14
|
+
// export interface Component extends CustomElementDeclaration {
|
|
15
|
+
// cssProperties?: Array<CssProperty>;
|
|
16
|
+
// members?: Array<ClassMember>;
|
|
17
|
+
// superclass?: {
|
|
18
|
+
// name?: string;
|
|
19
|
+
// package?: string;
|
|
20
|
+
// module?: string;
|
|
21
|
+
// };
|
|
22
|
+
// }
|
|
23
|
+
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
24
|
+
// // @ts-ignore
|
|
25
|
+
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
26
|
+
// export interface CustomModule extends JavaScriptModule {
|
|
27
|
+
// /**
|
|
28
|
+
// * The declarations of a module.
|
|
29
|
+
// *
|
|
30
|
+
// * For documentation purposes, all declarations that are reachable from
|
|
31
|
+
// * exports should be described here. Ie, functions and objects that may be
|
|
32
|
+
// * properties of exported objects, or passed as arguments to functions.
|
|
33
|
+
// */
|
|
34
|
+
// declarations?: Array<Component>;
|
|
35
|
+
// }
|
|
36
|
+
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
37
|
+
// // @ts-ignore
|
|
38
|
+
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
39
|
+
// export interface CEM extends Package {
|
|
40
|
+
// /**
|
|
41
|
+
// * An array of the modules this package contains.
|
|
42
|
+
// */
|
|
43
|
+
// modules: Array<CustomModule>;
|
|
44
|
+
// }
|
|
45
|
+
//# sourceMappingURL=Types.js.map
|
package/Types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Types.js","sourceRoot":"","sources":["../src/Types.ts"],"names":[],"mappings":";AAAA,oBAAoB;AAEpB,uKAAuK;AAEvK,eAAe;AAEf,sGAAsG;AACtG,2DAA2D;AAC3D,eAAe;AACf,yBAAyB;AACzB,SAAS;AACT,IAAI;AAEJ,sGAAsG;AACtG,gBAAgB;AAChB,mEAAmE;AACnE,gEAAgE;AAChE,0CAA0C;AAC1C,oCAAoC;AACpC,qBAAqB;AACrB,yBAAyB;AACzB,4BAA4B;AAC5B,2BAA2B;AAC3B,SAAS;AACT,IAAI;AAEJ,gEAAgE;AAChE,gBAAgB;AAChB,mEAAmE;AACnE,2DAA2D;AAC3D,UAAU;AACV,uCAAuC;AACvC,SAAS;AACT,8EAA8E;AAC9E,iFAAiF;AACjF,8EAA8E;AAC9E,UAAU;AACV,uCAAuC;AACvC,IAAI;AAEJ,gEAAgE;AAChE,gBAAgB;AAChB,mEAAmE;AACnE,yCAAyC;AACzC,UAAU;AACV,wDAAwD;AACxD,UAAU;AACV,oCAAoC;AACpC,IAAI"}
|
package/Utils.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for the result of splitting a path.
|
|
3
|
+
*/
|
|
4
|
+
interface ISplitPathResult {
|
|
5
|
+
packageRoot: string;
|
|
6
|
+
packageName: string;
|
|
7
|
+
specifier: string;
|
|
8
|
+
type: 'js' | 'json' | 'css';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Traverses up the directory structure to a specified depth.
|
|
12
|
+
* @param depth - The number of levels to traverse up.
|
|
13
|
+
* @param opts - Optional parameters, including current working directory.
|
|
14
|
+
* @returns An array of traversed paths.
|
|
15
|
+
*/
|
|
16
|
+
export declare function traverseUp(depth: number, opts?: {
|
|
17
|
+
cwd: string;
|
|
18
|
+
}): Array<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Checks if the given specifier is a bare module specifier.
|
|
21
|
+
* @param specifier - The specifier to check.
|
|
22
|
+
* @returns True if the specifier is a bare module specifier, otherwise false.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isBareModuleSpecifier(specifier: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Checks if the given specifier is a scoped package.
|
|
27
|
+
* @param specifier - The specifier to check.
|
|
28
|
+
* @returns True if the specifier is a scoped package, otherwise false.
|
|
29
|
+
*/
|
|
30
|
+
export declare function isScopedPackage(specifier: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Extracts the package name from a given specifier.
|
|
33
|
+
* @param specifier - The specifier to extract the package name from.
|
|
34
|
+
* @returns The extracted package name.
|
|
35
|
+
*/
|
|
36
|
+
export declare function extractPackageNameFromSpecifier(specifier: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Splits a full path into its components.
|
|
39
|
+
* @param fullPath - The full path to split.
|
|
40
|
+
* @returns The split path result.
|
|
41
|
+
*/
|
|
42
|
+
export declare function splitPath(fullPath: string): ISplitPathResult;
|
|
43
|
+
/**
|
|
44
|
+
* Gets the unique packages from an array of paths.
|
|
45
|
+
* @param paths - The array of paths to process.
|
|
46
|
+
* @returns An array of unique package names.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getUniquePackages(paths: Array<string>): Array<string>;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=Utils.d.ts.map
|
package/Utils.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../src/Utils.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,UAAU,gBAAgB;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,KAAK,CAAC;CAC/B;AASD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAK/E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAQzE;AAoDD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAyB5D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAMrE"}
|