@teambit/application 0.0.497 → 0.0.499

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.
@@ -7,5 +7,6 @@ export declare class AppTypePlugin implements PluginDefinition {
7
7
  private appSlot;
8
8
  constructor(pattern: string, appType: ApplicationType<unknown>, appSlot: ApplicationSlot);
9
9
  runtimes: string[];
10
- register(object: any): Promise<void>;
10
+ register(object: any): void;
11
+ private validateApp;
11
12
  }
@@ -2,8 +2,6 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
- require("core-js/modules/es.promise.js");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
@@ -19,6 +17,16 @@ function _defineProperty2() {
19
17
  return data;
20
18
  }
21
19
 
20
+ function _bitError() {
21
+ const data = require("@teambit/bit-error");
22
+
23
+ _bitError = function () {
24
+ return data;
25
+ };
26
+
27
+ return data;
28
+ }
29
+
22
30
  function _cli() {
23
31
  const data = require("@teambit/cli");
24
32
 
@@ -37,11 +45,18 @@ class AppTypePlugin {
37
45
  (0, _defineProperty2().default)(this, "runtimes", [_cli().MainRuntime.name]);
38
46
  }
39
47
 
40
- async register(object) {
41
- const app = await this.appType.createApp(object);
48
+ register(object) {
49
+ const app = this.appType.createApp(object);
50
+ this.validateApp(app);
42
51
  this.appSlot.register([app]);
43
52
  }
44
53
 
54
+ validateApp(app) {
55
+ if (app.name.includes(' ')) {
56
+ throw new (_bitError().BitError)(`app name "${app.name}" is invalid. spaces are not permitted`);
57
+ }
58
+ }
59
+
45
60
  }
46
61
 
47
62
  exports.AppTypePlugin = AppTypePlugin;
@@ -1 +1 @@
1
- {"version":3,"names":["AppTypePlugin","constructor","pattern","appType","appSlot","MainRuntime","name","register","object","app","createApp"],"sources":["app-type.plugin.ts"],"sourcesContent":["import { PluginDefinition } from '@teambit/aspect-loader';\nimport { MainRuntime } from '@teambit/cli';\nimport { ApplicationType } from './application-type';\nimport { ApplicationSlot } from './application.main.runtime';\n\nexport class AppTypePlugin implements PluginDefinition {\n constructor(readonly pattern: string, private appType: ApplicationType<unknown>, private appSlot: ApplicationSlot) {}\n\n runtimes = [MainRuntime.name];\n\n async register(object: any) {\n const app = await this.appType.createApp(object);\n this.appSlot.register([app]);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIO,MAAMA,aAAN,CAAgD;EACrDC,WAAW,CAAUC,OAAV,EAAmCC,OAAnC,EAA8EC,OAA9E,EAAwG;IAAA,KAA9FF,OAA8F,GAA9FA,OAA8F;IAAA,KAArEC,OAAqE,GAArEA,OAAqE;IAAA,KAA1BC,OAA0B,GAA1BA,OAA0B;IAAA,kDAExG,CAACC,kBAAA,CAAYC,IAAb,CAFwG;EAAE;;EAIvG,MAARC,QAAQ,CAACC,MAAD,EAAc;IAC1B,MAAMC,GAAG,GAAG,MAAM,KAAKN,OAAL,CAAaO,SAAb,CAAuBF,MAAvB,CAAlB;IACA,KAAKJ,OAAL,CAAaG,QAAb,CAAsB,CAACE,GAAD,CAAtB;EACD;;AARoD"}
1
+ {"version":3,"names":["AppTypePlugin","constructor","pattern","appType","appSlot","MainRuntime","name","register","object","app","createApp","validateApp","includes","BitError"],"sources":["app-type.plugin.ts"],"sourcesContent":["import { PluginDefinition } from '@teambit/aspect-loader';\nimport { BitError } from '@teambit/bit-error';\nimport { MainRuntime } from '@teambit/cli';\nimport { Application } from './application';\nimport { ApplicationType } from './application-type';\nimport { ApplicationSlot } from './application.main.runtime';\n\nexport class AppTypePlugin implements PluginDefinition {\n constructor(readonly pattern: string, private appType: ApplicationType<unknown>, private appSlot: ApplicationSlot) {}\n\n runtimes = [MainRuntime.name];\n\n register(object: any) {\n const app = this.appType.createApp(object);\n this.validateApp(app);\n this.appSlot.register([app]);\n }\n\n private validateApp(app: Application) {\n if (app.name.includes(' ')) {\n throw new BitError(`app name \"${app.name}\" is invalid. spaces are not permitted`);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKO,MAAMA,aAAN,CAAgD;EACrDC,WAAW,CAAUC,OAAV,EAAmCC,OAAnC,EAA8EC,OAA9E,EAAwG;IAAA,KAA9FF,OAA8F,GAA9FA,OAA8F;IAAA,KAArEC,OAAqE,GAArEA,OAAqE;IAAA,KAA1BC,OAA0B,GAA1BA,OAA0B;IAAA,kDAExG,CAACC,kBAAA,CAAYC,IAAb,CAFwG;EAAE;;EAIrHC,QAAQ,CAACC,MAAD,EAAc;IACpB,MAAMC,GAAG,GAAG,KAAKN,OAAL,CAAaO,SAAb,CAAuBF,MAAvB,CAAZ;IACA,KAAKG,WAAL,CAAiBF,GAAjB;IACA,KAAKL,OAAL,CAAaG,QAAb,CAAsB,CAACE,GAAD,CAAtB;EACD;;EAEOE,WAAW,CAACF,GAAD,EAAmB;IACpC,IAAIA,GAAG,CAACH,IAAJ,CAASM,QAAT,CAAkB,GAAlB,CAAJ,EAA4B;MAC1B,MAAM,KAAIC,oBAAJ,EAAc,aAAYJ,GAAG,CAACH,IAAK,wCAAnC,CAAN;IACD;EACF;;AAfoD"}
@@ -5,5 +5,5 @@ export declare class AppPlugin implements PluginDefinition {
5
5
  constructor(appSlot: ApplicationSlot);
6
6
  pattern: string;
7
7
  runtimes: string[];
8
- register(object: any): Promise<void>;
8
+ register(object: any): void;
9
9
  }
@@ -2,8 +2,6 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
- require("core-js/modules/es.promise.js");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
@@ -37,7 +35,7 @@ class AppPlugin {
37
35
  } // TODO - this matches NOTHING
38
36
 
39
37
 
40
- async register(object) {
38
+ register(object) {
41
39
  return this.appSlot.register([object]);
42
40
  }
43
41
 
@@ -1 +1 @@
1
- {"version":3,"names":["AppPlugin","constructor","appSlot","MainRuntime","name","register","object"],"sources":["app.plugin.ts"],"sourcesContent":["import { PluginDefinition } from '@teambit/aspect-loader';\nimport { MainRuntime } from '@teambit/cli';\nimport { ApplicationSlot } from './application.main.runtime';\n\nexport class AppPlugin implements PluginDefinition {\n constructor(private appSlot: ApplicationSlot) {}\n\n // TODO - this matches NOTHING\n pattern = '*.app.*?(ts|tsx|js|jsx)$';\n\n runtimes = [MainRuntime.name];\n\n async register(object: any) {\n return this.appSlot.register([object]);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,SAAN,CAA4C;EACjDC,WAAW,CAASC,OAAT,EAAmC;IAAA,KAA1BA,OAA0B,GAA1BA,OAA0B;IAAA,iDAGpC,0BAHoC;IAAA,kDAKnC,CAACC,kBAAA,CAAYC,IAAb,CALmC;EAAE,CADC,CAGjD;;;EAKc,MAARC,QAAQ,CAACC,MAAD,EAAc;IAC1B,OAAO,KAAKJ,OAAL,CAAaG,QAAb,CAAsB,CAACC,MAAD,CAAtB,CAAP;EACD;;AAVgD"}
1
+ {"version":3,"names":["AppPlugin","constructor","appSlot","MainRuntime","name","register","object"],"sources":["app.plugin.ts"],"sourcesContent":["import { PluginDefinition } from '@teambit/aspect-loader';\nimport { MainRuntime } from '@teambit/cli';\nimport { ApplicationSlot } from './application.main.runtime';\n\nexport class AppPlugin implements PluginDefinition {\n constructor(private appSlot: ApplicationSlot) {}\n\n // TODO - this matches NOTHING\n pattern = '*.app.*?(ts|tsx|js|jsx)$';\n\n runtimes = [MainRuntime.name];\n\n register(object: any) {\n return this.appSlot.register([object]);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,SAAN,CAA4C;EACjDC,WAAW,CAASC,OAAT,EAAmC;IAAA,KAA1BA,OAA0B,GAA1BA,OAA0B;IAAA,iDAGpC,0BAHoC;IAAA,kDAKnC,CAACC,kBAAA,CAAYC,IAAb,CALmC;EAAE,CADC,CAGjD;;;EAKAC,QAAQ,CAACC,MAAD,EAAc;IACpB,OAAO,KAAKJ,OAAL,CAAaG,QAAb,CAAsB,CAACC,MAAD,CAAtB,CAAP;EACD;;AAVgD"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/application",
3
- "version": "0.0.497",
3
+ "version": "0.0.499",
4
4
  "homepage": "https://bit.dev/teambit/harmony/application",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.harmony",
8
8
  "name": "application",
9
- "version": "0.0.497"
9
+ "version": "0.0.499"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -16,17 +16,17 @@
16
16
  "pluralize": "8.0.0",
17
17
  "@babel/runtime": "7.12.18",
18
18
  "core-js": "^3.0.0",
19
- "@teambit/builder": "0.0.855",
20
- "@teambit/component": "0.0.855",
21
- "@teambit/isolator": "0.0.855",
22
- "@teambit/envs": "0.0.855",
23
- "@teambit/cli-table": "0.0.40",
24
- "@teambit/cli": "0.0.568",
25
- "@teambit/aspect-loader": "0.0.855",
26
19
  "@teambit/harmony": "0.3.3",
20
+ "@teambit/builder": "0.0.857",
21
+ "@teambit/component": "0.0.857",
22
+ "@teambit/isolator": "0.0.857",
23
+ "@teambit/envs": "0.0.857",
24
+ "@teambit/cli-table": "0.0.40",
25
+ "@teambit/cli": "0.0.569",
26
+ "@teambit/aspect-loader": "0.0.857",
27
27
  "@teambit/bit-error": "0.0.400",
28
- "@teambit/logger": "0.0.661",
29
- "@teambit/workspace": "0.0.855"
28
+ "@teambit/logger": "0.0.662",
29
+ "@teambit/workspace": "0.0.857"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/react": "^17.0.8",
@@ -39,7 +39,7 @@
39
39
  "@types/node": "12.20.4"
40
40
  },
41
41
  "peerDependencies": {
42
- "@teambit/legacy": "1.0.349",
42
+ "@teambit/legacy": "1.0.350",
43
43
  "react-dom": "^16.8.0 || ^17.0.0",
44
44
  "react": "^16.8.0 || ^17.0.0"
45
45
  },
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.497/dist/application.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.497/dist/application.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.499/dist/application.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_application@0.0.499/dist/application.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];