@omnia/tooling-composers 8.0.47-vnext → 8.0.48-dev

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.
@@ -1,4 +1,4 @@
1
- import { WebComponentOptions } from "./models";
1
+ import { ElementOptions } from "./models";
2
2
  import { CombinableRuleComposer, ICombinableRuleComposer } from "./CombinableRuleComposer";
3
3
  import { WebComponentDefinition, OmniaBlock } from '../../fx-models';
4
4
  import { ComposerBase, IComposerBase } from './ComposerBase';
@@ -19,7 +19,7 @@ export declare class ComponentComposer extends ComposerBase<IWebComponentCompose
19
19
  private ruleComposer;
20
20
  constructor(manifestId: string, manifestName?: string);
21
21
  withDefinition: (definition: WebComponentDefinition) => this;
22
- registerComponent: (componentOptions: WebComponentOptions) => this;
22
+ registerComponent: (componentOptions: ElementOptions) => this;
23
23
  withLoadRules: () => CombinableRuleComposer<IWebComponentComposer>;
24
24
  registerOmniaBlock: <P, T extends OmniaBlock<P>>(options?: T) => this;
25
25
  private persistCombinedRules;
@@ -1,27 +1,27 @@
1
1
  import { IClientLoadableManifestProvider, ResourceManifest } from "./LoadableManifestRegistry";
2
- import { ResourceBuildOptions, WebComponentOptions } from "./models/index";
3
- import { WebComponentBundleManifest, ClientResolvableLoadRule, WebComponentDefinition, GuidValue } from '../../fx-models';
2
+ import { ResourceBuildOptions, ElementOptions } from "./models/index";
3
+ import { ComponentBundleManifest, ClientResolvableLoadRule, WebComponentDefinition, GuidValue } from '../../fx-models';
4
4
  export declare class ComponentRegistration {
5
- componentOptions: WebComponentOptions;
5
+ componentOptions: ElementOptions;
6
6
  manifestPath: string;
7
7
  manifest: ResourceManifest;
8
8
  buildOptions: ResourceBuildOptions;
9
9
  definition: WebComponentDefinition;
10
10
  extendApiRules: Array<ClientResolvableLoadRule>;
11
11
  loadRules: Array<ClientResolvableLoadRule>;
12
- constructor(componentOptions: WebComponentOptions, manifestPath: string, manifest: ResourceManifest);
12
+ constructor(componentOptions: ElementOptions, manifestPath: string, manifest: ResourceManifest);
13
13
  }
14
14
  export declare class ComponentRegistry implements IClientLoadableManifestProvider {
15
15
  private static ComponentRegistrations;
16
16
  private static ComponentElements;
17
- static registerComponent: (manifest: ResourceManifest, componentOptions: WebComponentOptions) => void;
17
+ static registerComponent: (manifest: ResourceManifest, componentOptions: ElementOptions) => void;
18
18
  static getComponentDefinition: (manifest: ResourceManifest) => WebComponentDefinition;
19
19
  static addComponentDefinition: (manifest: ResourceManifest, definition: WebComponentDefinition) => void;
20
20
  static addComponentBuildOptions: (manifest: ResourceManifest, buildOptions: ResourceBuildOptions) => void;
21
21
  static newCombinedRules: (manifest: ResourceManifest, rules: Array<ClientResolvableLoadRule>) => void;
22
22
  static getRegistrations: () => Array<ComponentRegistration>;
23
23
  static getComponentRegistrations: () => Array<ComponentRegistration>;
24
- getClientLoadableManifests: (currentServiceId: GuidValue) => Array<WebComponentBundleManifest>;
24
+ getClientLoadableManifests: (currentServiceId: GuidValue) => Array<ComponentBundleManifest>;
25
25
  clearState: () => void;
26
26
  private static ensureCorrectManifest;
27
27
  }
@@ -149,11 +149,7 @@ ComponentRegistry.getRegistrations = () => {
149
149
  return components;
150
150
  };
151
151
  ComponentRegistry.getComponentRegistrations = () => {
152
- let components = [];
153
- for (const wc of ComponentRegistry.ComponentRegistrations.values()) {
154
- components.push(wc);
155
- }
156
- return components;
152
+ return Array.from(ComponentRegistry.ComponentRegistrations.values());
157
153
  };
158
154
  ComponentRegistry.ensureCorrectManifest = (manifest) => {
159
155
  if (!manifest ||
@@ -1,5 +1,5 @@
1
1
  import { IBlockingComposer } from "./BlockingComposer";
2
- import { ResourcesOptions, WebComponentOptions, ILocalizationComposer, ManifestGroupOptions, LocalizationOptions, ServiceFeatureOption, ServiceAppDefinitionOption, ServiceRoleDefinitionOption } from "./models";
2
+ import { ResourcesOptions, ElementOptions, ILocalizationComposer, ManifestGroupOptions, LocalizationOptions, ServiceFeatureOption, ServiceAppDefinitionOption, ServiceRoleDefinitionOption } from "./models";
3
3
  import { IResourcesComposer, IReOpendedResourcesComposer } from "./ResourcesComposer";
4
4
  import { IWebComponentComposer } from "./ComponentComposer";
5
5
  import { IManifestGroupComposer } from "./ManifestGroupComposer";
@@ -19,7 +19,7 @@ export interface INewManifestComposer extends IRegisterService {
19
19
  * Usage: registerWebComponent({...}).*additionalOperations
20
20
  * @param componentOptions the options for the webcomponent
21
21
  */
22
- registerWebComponent: (componentOptions: WebComponentOptions) => IWebComponentComposer;
22
+ registerElement: (componentOptions: ElementOptions) => IWebComponentComposer;
23
23
  /**
24
24
  * Registers a new resources manifest
25
25
  * Usage: registerResource({...}).*additionalOperations
@@ -33,7 +33,7 @@ export interface INewManifestComposer extends IRegisterService {
33
33
  * Usage: registerResourceGroup({...}).*additionalOperations
34
34
  * @param groupOptions the options for the defining the webcomponent group.
35
35
  */
36
- registerResourceGroup: (groupOptions: ManifestGroupOptions) => IManifestGroupComposer;
36
+ registerResourceGroup: (groupOptions: ManifestGroupOptions<GuidValue>) => IManifestGroupComposer;
37
37
  /**
38
38
  * Registers a new localization manifest
39
39
  * Used to add labels for localization
@@ -17,7 +17,7 @@ class NewManifestComposer {
17
17
  constructor(manifestId, manifestName) {
18
18
  this.manifestId = manifestId;
19
19
  this.manifestName = manifestName;
20
- this.registerWebComponent = (componentOptions) => {
20
+ this.registerElement = (componentOptions) => {
21
21
  return new ComponentComposer_1.ComponentComposer(this.manifestId, this.manifestName).registerComponent(componentOptions);
22
22
  };
23
23
  this.registerResourceGroup = (componentGroupOptions) => {
@@ -0,0 +1,11 @@
1
+ import { ServiceOptions } from './models';
2
+ import { IServiceManifestComposer, ServiceManifestComposer } from './ServiceManifestComposer';
3
+ export interface ICustomServiceComposer extends IServiceManifestComposer<ICustomServiceComposer> {
4
+ runHelm: (cmd: string) => ICustomServiceComposer;
5
+ }
6
+ export declare class CustomServiceComposer extends ServiceManifestComposer<CustomServiceComposer> implements ICustomServiceComposer {
7
+ private manifestId;
8
+ private manifestTitle;
9
+ constructor(manifestId: string, manifestTitle: string, serviceOptions: ServiceOptions);
10
+ runHelm(cmd: string): this;
11
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomServiceComposer = void 0;
4
+ const models_1 = require("./models");
5
+ const Utils_1 = require("./Utils");
6
+ const ServiceManifestRegistry_1 = require("./ServiceManifestRegistry");
7
+ const ServiceManifestComposer_1 = require("./ServiceManifestComposer");
8
+ class CustomServiceComposer extends ServiceManifestComposer_1.ServiceManifestComposer {
9
+ constructor(manifestId, manifestTitle, serviceOptions) {
10
+ // TODO wait hot reload update not execute composer two times
11
+ super(() => { return this; });
12
+ this.manifestId = manifestId;
13
+ this.manifestTitle = manifestTitle;
14
+ if (!Utils_1.Utils.isValidGuid(this.manifestId)) {
15
+ throw new Error("Can't register omnia service with id: " + this.manifestId + " must be a valid Guid");
16
+ }
17
+ let serviceInfo = {
18
+ description: serviceOptions.description,
19
+ id: manifestId,
20
+ serviceType: models_1.ServiceTypes.Custom,
21
+ title: manifestTitle,
22
+ optionalService: false
23
+ };
24
+ ServiceManifestRegistry_1.ServiceManifestRegistry.AddService(serviceInfo);
25
+ }
26
+ runHelm(cmd) {
27
+ ServiceManifestRegistry_1.ServiceManifestRegistry.getServiceInfo().hemlCommand = cmd;
28
+ return this;
29
+ }
30
+ }
31
+ exports.CustomServiceComposer = CustomServiceComposer;
@@ -12,6 +12,13 @@ class ManifestGroupRegistration {
12
12
  this.manifestPath = manifestPath;
13
13
  this.manifest = manifest;
14
14
  this.loadRules = [];
15
+ // ensure is string value
16
+ if (this.manifestGroupOptions.resourceManifestIds) {
17
+ this.manifestGroupOptions.resourceManifestIds = this.manifestGroupOptions.resourceManifestIds.map(r => r.toString());
18
+ }
19
+ if (this.manifestGroupOptions.webComponentManifestIds) {
20
+ this.manifestGroupOptions.webComponentManifestIds = this.manifestGroupOptions.webComponentManifestIds.map(r => r.toString());
21
+ }
15
22
  }
16
23
  }
17
24
  exports.ManifestGroupRegistration = ManifestGroupRegistration;
@@ -1,6 +1,7 @@
1
1
  import { ServiceOptions } from './models';
2
2
  import { IWebAppServiceComposer } from './WebAppServiceComposer';
3
3
  import { IWorkerServiceComposer } from './WorkerServiceComposer';
4
+ import { ICustomServiceComposer } from './CustomServiceComposer';
4
5
  export interface IRegisterService {
5
6
  /** Specify service type for this omnia service project.
6
7
  E.g. A service could be a worker, doing simple async jobs, worker queues etc
@@ -17,6 +18,10 @@ export interface IServiceComposer {
17
18
  * Register service to be of type worker
18
19
  */
19
20
  AsWorker: () => IWorkerServiceComposer;
21
+ /**
22
+ * Register service to be of custom type (to install heml)
23
+ */
24
+ AsCustom: () => ICustomServiceComposer;
20
25
  }
21
26
  export declare class ServiceComposer implements IServiceComposer {
22
27
  private manifestId;
@@ -25,4 +30,5 @@ export declare class ServiceComposer implements IServiceComposer {
25
30
  constructor(manifestId: string, manifestName: string, serviceInfo: ServiceOptions);
26
31
  AsWebApp: () => IWebAppServiceComposer;
27
32
  AsWorker: () => IWorkerServiceComposer;
33
+ AsCustom: () => ICustomServiceComposer;
28
34
  }
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ServiceComposer = void 0;
4
4
  const Utils_1 = require("./Utils");
5
- const WorkerServiceComposer_1 = require("./WorkerServiceComposer");
6
5
  const WebAppServiceComposer_1 = require("./WebAppServiceComposer");
6
+ const WorkerServiceComposer_1 = require("./WorkerServiceComposer");
7
+ const CustomServiceComposer_1 = require("./CustomServiceComposer");
7
8
  class ServiceComposer {
8
9
  constructor(manifestId, manifestName, serviceInfo) {
9
10
  // TODO wait hot reload update not execute composer two times
@@ -16,6 +17,9 @@ class ServiceComposer {
16
17
  this.AsWorker = () => {
17
18
  return new WorkerServiceComposer_1.WorkerServiceComposer(this.manifestId, this.manifestName, this.serviceInfo);
18
19
  };
20
+ this.AsCustom = () => {
21
+ return new CustomServiceComposer_1.CustomServiceComposer(this.manifestId, this.manifestName, this.serviceInfo);
22
+ };
19
23
  if (!Utils_1.Utils.isValidGuid(this.manifestId)) {
20
24
  throw new Error("Can't register service with id: " + this.manifestId + " must be a valid Guid");
21
25
  }
@@ -8,7 +8,8 @@ class ServiceManifestRegistry {
8
8
  ServiceManifestRegistry.Service = null;
9
9
  ServiceManifestRegistry.AddService = (service) => {
10
10
  if (!(service.serviceType === index_1.ServiceTypes.WebApp ||
11
- service.serviceType === index_1.ServiceTypes.Worker)) {
11
+ service.serviceType === index_1.ServiceTypes.Worker ||
12
+ service.serviceType === index_1.ServiceTypes.Custom)) {
12
13
  throw new Error("Unknown service type: " + JSON.stringify(service));
13
14
  }
14
15
  if (ServiceManifestRegistry.Service) {
@@ -20,4 +20,5 @@ export * from './BuildConfigurationRegistry';
20
20
  export * from './ServiceManifestRegistry';
21
21
  export * from './ImportManifestRegistry';
22
22
  export * from "./ConfigurationClientServiceRegistry";
23
- export { type BuildOptions, ServiceTypes } from "./models/index";
23
+ export { type BuildOptions, ServiceTypes, type ElementOptions as WebComponentOptions } from "./models/index";
24
+ export * from "./CustomServiceComposer";
@@ -26,5 +26,6 @@ tslib_1.__exportStar(require("./ImportManifestRegistry"), exports);
26
26
  tslib_1.__exportStar(require("./ConfigurationClientServiceRegistry"), exports);
27
27
  var index_1 = require("./models/index");
28
28
  Object.defineProperty(exports, "ServiceTypes", { enumerable: true, get: function () { return index_1.ServiceTypes; } });
29
+ tslib_1.__exportStar(require("./CustomServiceComposer"), exports);
29
30
  const models_1 = require("../../fx-models");
30
31
  var ignore = models_1.AuthenticationValidationStatuses;
@@ -49,7 +49,11 @@ export interface BuildOptions {
49
49
  /**
50
50
  * Create dynamic documentaion with manifest id.
51
51
  */
52
- dynamicDocManifestId?: GuidValue;
52
+ docResourceManifestId?: GuidValue;
53
+ /**
54
+ * Create a namespace to web component tag
55
+ */
56
+ webComponentNamespace?: string;
53
57
  }
54
58
  export interface CircularDependencyOptions {
55
59
  /**
@@ -1,4 +1,4 @@
1
- export interface WebComponentOptions {
1
+ export interface ElementOptions {
2
2
  /** The name for this component, this should be a none conflicting name
3
3
  e.g. use project as prefix myuniqueprojectname-componentName.
4
4
  i.e. <myuniqueprojectname-componentName></myuniqueprojectname-componentName> */
@@ -5,7 +5,8 @@ export declare enum RequestedResourceTypes {
5
5
  }
6
6
  export declare enum ServiceTypes {
7
7
  WebApp = "WebAppService",
8
- Worker = "WorkerService"
8
+ Worker = "WorkerService",
9
+ Custom = "CustomService"
9
10
  }
10
11
  export declare enum SecurityProviderTypes {
11
12
  RoleBased = "RoleBasedProvider",
@@ -33,7 +34,8 @@ export declare enum ServerManifestTypes {
33
34
  ServiceFeature = "servicefeature",
34
35
  ServiceAppDefinition = "serviceappdefinition",
35
36
  AzureADAppPermission = "azureadapppermission",
36
- ServiceRoleDefinition = "serviceroledefinition"
37
+ ServiceRoleDefinition = "serviceroledefinition",
38
+ HemlProvider = "hemlprovider"
37
39
  }
38
40
  export declare enum BundleTargetTypes {
39
41
  Javascript = "js",
@@ -11,6 +11,7 @@ var ServiceTypes;
11
11
  (function (ServiceTypes) {
12
12
  ServiceTypes["WebApp"] = "WebAppService";
13
13
  ServiceTypes["Worker"] = "WorkerService";
14
+ ServiceTypes["Custom"] = "CustomService";
14
15
  })(ServiceTypes = exports.ServiceTypes || (exports.ServiceTypes = {}));
15
16
  var SecurityProviderTypes;
16
17
  (function (SecurityProviderTypes) {
@@ -44,6 +45,7 @@ var ServerManifestTypes;
44
45
  ServerManifestTypes["ServiceAppDefinition"] = "serviceappdefinition";
45
46
  ServerManifestTypes["AzureADAppPermission"] = "azureadapppermission";
46
47
  ServerManifestTypes["ServiceRoleDefinition"] = "serviceroledefinition";
48
+ ServerManifestTypes["HemlProvider"] = "hemlprovider";
47
49
  })(ServerManifestTypes = exports.ServerManifestTypes || (exports.ServerManifestTypes = {}));
48
50
  var BundleTargetTypes;
49
51
  (function (BundleTargetTypes) {
@@ -1,6 +1,7 @@
1
- export interface ManifestGroupOptions {
1
+ import { GuidValue } from "@omnia/fx-models";
2
+ export interface ManifestGroupOptions<T extends string | GuidValue = string> {
2
3
  /** The manifest id's of the webcomponent's to include in this group */
3
- webComponentManifestIds?: Array<string>;
4
+ webComponentManifestIds?: Array<T>;
4
5
  /** The manifest id's of the resources to include in this group */
5
- resourceManifestIds?: Array<string>;
6
+ resourceManifestIds?: Array<T>;
6
7
  }
@@ -4,7 +4,7 @@ import { IIcon } from '../../../fx-models/Icon';
4
4
  import { ServiceParam } from '../../../fx-models/ServiceParam';
5
5
  import { FeatureUIOption, IFeatureConfiguration } from '../../../fx-models/Feature';
6
6
  import { GuidValue } from "@omnia/fx-models";
7
- import { OmniaBackendRuntimes, OmniaRoleTypes } from "../../../fx-models/Enums";
7
+ import { OmniaBackendRuntimes, OmniaRoleTypes, PersistentDiskTypes } from "../../../fx-models/Enums";
8
8
  import { AzureAdAppPermissionInfo, AzureAdAppResourceAccessWithAlternate } from "../../../fx-models/AzureAdAppPermissions";
9
9
  import { AzureAdAppPermissionOption } from "../AzureAdAppPermissionHelper";
10
10
  export interface ServiceFeatureOption {
@@ -98,6 +98,7 @@ export interface AppResourceType {
98
98
  icon: IIcon;
99
99
  parameters: Array<ServiceParam>;
100
100
  providedParameters: Array<ServiceParam>;
101
+ requiredFeatures?: Array<GuidValue>;
101
102
  }
102
103
  export interface ServiceAppDefinitionOption {
103
104
  title: string;
@@ -159,6 +160,7 @@ export interface ResourceOptionBase {
159
160
  export interface SqlResourceOption extends ResourceOptionBase {
160
161
  }
161
162
  export interface PersistentDiskResourceOption extends ResourceOptionBase {
163
+ type?: PersistentDiskTypes;
162
164
  }
163
165
  export interface SqlElasticPoolResourceOption extends ResourceOptionBase {
164
166
  elasticPoolId: GuidValue;
@@ -216,6 +218,9 @@ export interface ServiceBase extends ServiceOptions {
216
218
  serviceType: ServiceTypes;
217
219
  optionalService: boolean;
218
220
  }
221
+ export interface CustomService extends ServiceBase {
222
+ hemlCommand?: string;
223
+ }
219
224
  export interface ServiceManifest extends ServiceBase, ServerManifest {
220
225
  }
221
226
  export interface SecurityProviderIdentity {
@@ -149,6 +149,16 @@ function build(scanFolders, cleanOutputBeforeBuild) {
149
149
  if (!DevelopmentBuildConfiguration_1.DevelopmentBuildConfiguration.isEnableBuild) {
150
150
  resolve();
151
151
  }
152
+ else if (process.argv.length > 0
153
+ && process.argv.find(argv => argv === "--package") !== undefined) {
154
+ cleanOutput = false;
155
+ afterScanManifest()
156
+ .then(beforeBundleManifest, chainError)
157
+ .then(resolve, reject)
158
+ .catch((err) => {
159
+ reject(err);
160
+ });
161
+ }
152
162
  else if (process.argv.length > 0
153
163
  && process.argv.find(argv => argv === "--manifestOnly") !== undefined
154
164
  && (process.argv.find(argv => argv === "--force") !== undefined
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/tooling-composers",
3
3
  "license": "MIT",
4
- "version": "8.0.47-vnext",
4
+ "version": "8.0.48-dev",
5
5
  "description": "Provide tooling to work with manifest things.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -19,8 +19,8 @@
19
19
  ],
20
20
  "author": "Precio Fishbone",
21
21
  "dependencies": {
22
- "@omnia/fx-models": "8.0.47-vnext",
23
- "@omnia/tooling": "8.0.47-vnext",
22
+ "@omnia/fx-models": "8.0.48-dev",
23
+ "@omnia/tooling": "8.0.48-dev",
24
24
  "deep-extend": "0.6.0",
25
25
  "fs-extra": "11.1.0",
26
26
  "del": "6.0.0",