@teambit/node 0.0.881 → 0.0.882

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.
Files changed (106) hide show
  1. package/artifacts/env-template/public/{238.c1f9da1cb2656218c1b2.js → 700.1acd4584914cac5d9064.js} +15 -15
  2. package/artifacts/env-template/public/assets-manifest.json +16 -16
  3. package/artifacts/env-template/public/{compositions.7800ffeb4c0c2a49a47b.js → compositions.f585ccb459e93e7ed228.js} +1 -1
  4. package/artifacts/env-template/public/compositions.html +1 -1
  5. package/artifacts/env-template/public/{overview.12a1a78394c3da5ea9d7.js → overview.b1cfdc5c24036d810af2.js} +1 -1
  6. package/artifacts/env-template/public/overview.html +1 -1
  7. package/artifacts/env-template/public/{peers.f040709ae6d35f0c2308.js → peers.5dff83ab024225e2a9b6.js} +0 -0
  8. package/artifacts/env-template/public/{preview-root.72df8802c9e617f63a64.js → preview-root.eebdddc2e40f752a9312.js} +1 -1
  9. package/artifacts/env-template/public/static/css/700.bd8655a5.css +1 -0
  10. package/artifacts/env-template/public/static/css/compositions.e163efe5.css +1 -0
  11. package/artifacts/env-template/public/static/css/{overview.367aeb5b.css → overview.18adf1ee.css} +1 -1
  12. package/artifacts/preview/teambit_harmony_node-preview.js +1 -1
  13. package/{compositions-1666409808293.js → compositions-1666496165706.js} +0 -0
  14. package/dist/index.js +0 -3
  15. package/dist/index.js.map +1 -1
  16. package/dist/jest/index.js +0 -4
  17. package/dist/jest/index.js.map +1 -1
  18. package/dist/jest/jest.config.js +0 -8
  19. package/dist/jest/jest.config.js.map +1 -1
  20. package/dist/node.app-type.js +0 -7
  21. package/dist/node.app-type.js.map +1 -1
  22. package/dist/node.application.js +0 -23
  23. package/dist/node.application.js.map +1 -1
  24. package/dist/node.aspect.js +0 -5
  25. package/dist/node.aspect.js.map +1 -1
  26. package/dist/node.composition.js +0 -6
  27. package/dist/node.composition.js.map +1 -1
  28. package/dist/node.env.js +2 -21
  29. package/dist/node.env.js.map +1 -1
  30. package/dist/node.main.runtime.js +2 -65
  31. package/dist/node.main.runtime.js.map +1 -1
  32. package/dist/node.ui.runtime.js +4 -32
  33. package/dist/node.ui.runtime.js.map +1 -1
  34. package/dist/templates/express-app/files/app-root.js +0 -1
  35. package/dist/templates/express-app/files/app-root.js.map +1 -1
  36. package/dist/templates/express-app/files/composition.js +0 -1
  37. package/dist/templates/express-app/files/composition.js.map +1 -1
  38. package/dist/templates/express-app/files/doc.js +0 -1
  39. package/dist/templates/express-app/files/doc.js.map +1 -1
  40. package/dist/templates/express-app/files/get-port.js +0 -1
  41. package/dist/templates/express-app/files/get-port.js.map +1 -1
  42. package/dist/templates/express-app/files/index.js +0 -1
  43. package/dist/templates/express-app/files/index.js.map +1 -1
  44. package/dist/templates/express-app/files/mock-route.js +0 -1
  45. package/dist/templates/express-app/files/mock-route.js.map +1 -1
  46. package/dist/templates/express-app/files/node-app.js +0 -1
  47. package/dist/templates/express-app/files/node-app.js.map +1 -1
  48. package/dist/templates/express-app/files/route.js +0 -1
  49. package/dist/templates/express-app/files/route.js.map +1 -1
  50. package/dist/templates/express-app/files/test.js +0 -1
  51. package/dist/templates/express-app/files/test.js.map +1 -1
  52. package/dist/templates/express-app/index.js +4 -23
  53. package/dist/templates/express-app/index.js.map +1 -1
  54. package/dist/templates/express-route/files/composition.js +0 -1
  55. package/dist/templates/express-route/files/composition.js.map +1 -1
  56. package/dist/templates/express-route/files/doc.js +0 -1
  57. package/dist/templates/express-route/files/doc.js.map +1 -1
  58. package/dist/templates/express-route/files/index.js +0 -1
  59. package/dist/templates/express-route/files/index.js.map +1 -1
  60. package/dist/templates/express-route/files/main.js +0 -1
  61. package/dist/templates/express-route/files/main.js.map +1 -1
  62. package/dist/templates/express-route/files/test.js +0 -1
  63. package/dist/templates/express-route/files/test.js.map +1 -1
  64. package/dist/templates/express-route/index.js +4 -11
  65. package/dist/templates/express-route/index.js.map +1 -1
  66. package/dist/templates/node/files/composition.js +0 -1
  67. package/dist/templates/node/files/composition.js.map +1 -1
  68. package/dist/templates/node/files/doc.js +0 -1
  69. package/dist/templates/node/files/doc.js.map +1 -1
  70. package/dist/templates/node/files/index.js +0 -1
  71. package/dist/templates/node/files/index.js.map +1 -1
  72. package/dist/templates/node/files/main.js +0 -1
  73. package/dist/templates/node/files/main.js.map +1 -1
  74. package/dist/templates/node/files/test.js +0 -1
  75. package/dist/templates/node/files/test.js.map +1 -1
  76. package/dist/templates/node/index.js +0 -16
  77. package/dist/templates/node/index.js.map +1 -1
  78. package/dist/templates/node-env/files/aspect.js +0 -1
  79. package/dist/templates/node-env/files/aspect.js.map +1 -1
  80. package/dist/templates/node-env/files/doc.js +0 -1
  81. package/dist/templates/node-env/files/doc.js.map +1 -1
  82. package/dist/templates/node-env/files/index.js +0 -1
  83. package/dist/templates/node-env/files/index.js.map +1 -1
  84. package/dist/templates/node-env/files/jest.config.js +0 -1
  85. package/dist/templates/node-env/files/jest.config.js.map +1 -1
  86. package/dist/templates/node-env/files/main.runtime.js +0 -1
  87. package/dist/templates/node-env/files/main.runtime.js.map +1 -1
  88. package/dist/templates/node-env/files/preview.runtime.js +0 -1
  89. package/dist/templates/node-env/files/preview.runtime.js.map +1 -1
  90. package/dist/templates/node-env/files/typescript/styles.js +0 -1
  91. package/dist/templates/node-env/files/typescript/styles.js.map +1 -1
  92. package/dist/templates/node-env/files/typescript/ts-transformer.js +0 -1
  93. package/dist/templates/node-env/files/typescript/ts-transformer.js.map +1 -1
  94. package/dist/templates/node-env/files/typescript/typescript.config.js +0 -1
  95. package/dist/templates/node-env/files/typescript/typescript.config.js.map +1 -1
  96. package/dist/templates/node-env/files/webpack.config.js +0 -1
  97. package/dist/templates/node-env/files/webpack.config.js.map +1 -1
  98. package/dist/templates/node-env/index.js +0 -31
  99. package/dist/templates/node-env/index.js.map +1 -1
  100. package/{overview-1666409808293.js → overview-1666496165706.js} +0 -0
  101. package/package-tar/teambit-node-0.0.882.tgz +0 -0
  102. package/package.json +14 -14
  103. package/{preview-1666409808293.js → preview-1666496165706.js} +2 -2
  104. package/artifacts/env-template/public/static/css/238.a0238c25.css +0 -1
  105. package/artifacts/env-template/public/static/css/compositions.6d8c7702.css +0 -1
  106. package/package-tar/teambit-node-0.0.881.tgz +0 -0
@@ -1,176 +1,124 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.array.iterator.js");
6
-
7
5
  require("core-js/modules/es.promise.js");
8
-
9
6
  Object.defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
9
  exports.NodeMain = void 0;
13
-
14
10
  function _defineProperty2() {
15
11
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
-
17
12
  _defineProperty2 = function () {
18
13
  return data;
19
14
  };
20
-
21
15
  return data;
22
16
  }
23
-
24
17
  function _mergeDeepLeft() {
25
18
  const data = _interopRequireDefault(require("ramda/src/mergeDeepLeft"));
26
-
27
19
  _mergeDeepLeft = function () {
28
20
  return data;
29
21
  };
30
-
31
22
  return data;
32
23
  }
33
-
34
24
  function _typescript() {
35
25
  const data = require("@teambit/typescript");
36
-
37
26
  _typescript = function () {
38
27
  return data;
39
28
  };
40
-
41
29
  return data;
42
30
  }
43
-
44
31
  function _application() {
45
32
  const data = require("@teambit/application");
46
-
47
33
  _application = function () {
48
34
  return data;
49
35
  };
50
-
51
36
  return data;
52
37
  }
53
-
54
38
  function _logger() {
55
39
  const data = require("@teambit/logger");
56
-
57
40
  _logger = function () {
58
41
  return data;
59
42
  };
60
-
61
43
  return data;
62
44
  }
63
-
64
45
  function _cli() {
65
46
  const data = require("@teambit/cli");
66
-
67
47
  _cli = function () {
68
48
  return data;
69
49
  };
70
-
71
50
  return data;
72
51
  }
73
-
74
52
  function _generator() {
75
53
  const data = require("@teambit/generator");
76
-
77
54
  _generator = function () {
78
55
  return data;
79
56
  };
80
-
81
57
  return data;
82
58
  }
83
-
84
59
  function _envs() {
85
60
  const data = require("@teambit/envs");
86
-
87
61
  _envs = function () {
88
62
  return data;
89
63
  };
90
-
91
64
  return data;
92
65
  }
93
-
94
66
  function _react() {
95
67
  const data = require("@teambit/react");
96
-
97
68
  _react = function () {
98
69
  return data;
99
70
  };
100
-
101
71
  return data;
102
72
  }
103
-
104
73
  function _node() {
105
74
  const data = require("./node.aspect");
106
-
107
75
  _node = function () {
108
76
  return data;
109
77
  };
110
-
111
78
  return data;
112
79
  }
113
-
114
80
  function _node2() {
115
81
  const data = require("./node.env");
116
-
117
82
  _node2 = function () {
118
83
  return data;
119
84
  };
120
-
121
85
  return data;
122
86
  }
123
-
124
87
  function _nodeEnv() {
125
88
  const data = require("./templates/node-env");
126
-
127
89
  _nodeEnv = function () {
128
90
  return data;
129
91
  };
130
-
131
92
  return data;
132
93
  }
133
-
134
94
  function _node3() {
135
95
  const data = require("./templates/node");
136
-
137
96
  _node3 = function () {
138
97
  return data;
139
98
  };
140
-
141
99
  return data;
142
100
  }
143
-
144
101
  function _node4() {
145
102
  const data = require("./node.app-type");
146
-
147
103
  _node4 = function () {
148
104
  return data;
149
105
  };
150
-
151
106
  return data;
152
107
  }
153
-
154
108
  function _expressApp() {
155
109
  const data = require("./templates/express-app");
156
-
157
110
  _expressApp = function () {
158
111
  return data;
159
112
  };
160
-
161
113
  return data;
162
114
  }
163
-
164
115
  function _expressRoute() {
165
116
  const data = require("./templates/express-route");
166
-
167
117
  _expressRoute = function () {
168
118
  return data;
169
119
  };
170
-
171
120
  return data;
172
121
  }
173
-
174
122
  class NodeMain {
175
123
  constructor(react, tsAspect, nodeEnv, envs) {
176
124
  this.react = react;
@@ -191,16 +139,15 @@ class NodeMain {
191
139
  (0, _defineProperty2().default)(this, "useEslint", this.react.useEslint.bind(this.react));
192
140
  (0, _defineProperty2().default)(this, "overrideMounter", this.react.overrideMounter.bind(this.react));
193
141
  }
194
-
195
142
  icon() {
196
143
  return 'https://static.bit.dev/extensions-icons/nodejs.svg';
197
144
  }
145
+
198
146
  /**
199
147
  * @deprecated use useTypescript()
200
148
  * override the TS config of the environment.
201
149
  */
202
150
 
203
-
204
151
  /**
205
152
  * override the env's typescript config for both dev and build time.
206
153
  * Replaces both overrideTsConfig (devConfig) and overrideBuildTsConfig (buildConfig)
@@ -208,13 +155,10 @@ class NodeMain {
208
155
  useTypescript(modifiers, tsModule) {
209
156
  const overrides = {};
210
157
  const devTransformers = modifiers === null || modifiers === void 0 ? void 0 : modifiers.devConfig;
211
-
212
158
  if (devTransformers) {
213
159
  overrides.getCompiler = () => this.nodeEnv.getCompiler(devTransformers, tsModule);
214
160
  }
215
-
216
161
  const buildTransformers = modifiers === null || modifiers === void 0 ? void 0 : modifiers.buildConfig;
217
-
218
162
  if (buildTransformers) {
219
163
  const buildPipeModifiers = {
220
164
  tsModifier: {
@@ -222,18 +166,16 @@ class NodeMain {
222
166
  module: tsModule
223
167
  }
224
168
  };
225
-
226
169
  overrides.getBuildPipe = () => this.nodeEnv.getBuildPipe(buildPipeModifiers);
227
170
  }
228
-
229
171
  return this.envs.override(overrides);
230
172
  }
173
+
231
174
  /**
232
175
  * override the env's dev server and preview webpack configurations.
233
176
  * Replaces both overrideDevServerConfig and overridePreviewConfig
234
177
  */
235
178
 
236
-
237
179
  /**
238
180
  * override the dependency configuration of the component environment.
239
181
  */
@@ -242,14 +184,12 @@ class NodeMain {
242
184
  getDependencies: () => (0, _mergeDeepLeft().default)(dependencyPolicy, this.nodeEnv.getDependencies())
243
185
  });
244
186
  }
245
-
246
187
  /**
247
188
  * create a new composition of the node environment.
248
189
  */
249
190
  compose(transformers, targetEnv = {}) {
250
191
  return this.envs.compose(this.envs.merge(targetEnv, this.nodeEnv), transformers);
251
192
  }
252
-
253
193
  static async provider([loggerAspect, envs, application, react, generator, tsAspect]) {
254
194
  const logger = loggerAspect.createLogger(_node().NodeAspect.id);
255
195
  const nodeEnv = envs.merge(new (_node2().NodeEnv)(tsAspect, react), react.reactEnv);
@@ -259,13 +199,10 @@ class NodeMain {
259
199
  generator.registerComponentTemplate([_nodeEnv().nodeEnvTemplate, _node3().nodeTemplate, _expressApp().expressAppTemplate, _expressRoute().expressRouteTemplate]);
260
200
  return new NodeMain(react, tsAspect, nodeEnv, envs);
261
201
  }
262
-
263
202
  }
264
-
265
203
  exports.NodeMain = NodeMain;
266
204
  (0, _defineProperty2().default)(NodeMain, "runtime", _cli().MainRuntime);
267
205
  (0, _defineProperty2().default)(NodeMain, "dependencies", [_logger().LoggerAspect, _envs().EnvsAspect, _application().ApplicationAspect, _react().ReactAspect, _generator().GeneratorAspect, _typescript().TypescriptAspect]);
268
-
269
206
  _node().NodeAspect.addRuntime(NodeMain);
270
207
 
271
208
  //# sourceMappingURL=node.main.runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NodeMain","constructor","react","tsAspect","nodeEnv","envs","overrideTsConfig","bind","overrideJestConfig","overrideBuildPipe","overrideCompiler","overrideCompilerTasks","overrideBuildTsConfig","overridePackageJsonProps","overridePreviewConfig","overrideDevServerConfig","useWebpack","usePrettier","useEslint","overrideMounter","icon","useTypescript","modifiers","tsModule","overrides","devTransformers","devConfig","getCompiler","buildTransformers","buildConfig","buildPipeModifiers","tsModifier","transformers","module","getBuildPipe","override","overrideDependencies","dependencyPolicy","getDependencies","mergeDeepLeft","compose","targetEnv","merge","provider","loggerAspect","application","generator","logger","createLogger","NodeAspect","id","NodeEnv","reactEnv","registerEnv","nodeAppType","NodeAppType","registerAppType","registerComponentTemplate","nodeEnvTemplate","nodeTemplate","expressAppTemplate","expressRouteTemplate","MainRuntime","LoggerAspect","EnvsAspect","ApplicationAspect","ReactAspect","GeneratorAspect","TypescriptAspect","addRuntime"],"sources":["node.main.runtime.ts"],"sourcesContent":["import mergeDeepLeft from 'ramda/src/mergeDeepLeft';\nimport { EnvPolicyConfigObject } from '@teambit/dependency-resolver';\nimport { TsConfigSourceFile } from 'typescript';\nimport { TsCompilerOptionsWithoutTsConfig, TypescriptAspect, TypescriptMain } from '@teambit/typescript';\nimport { ApplicationAspect, ApplicationMain } from '@teambit/application';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { MainRuntime } from '@teambit/cli';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { BuildTask } from '@teambit/builder';\nimport { Compiler } from '@teambit/compiler';\nimport { PackageJsonProps } from '@teambit/pkg';\nimport { EnvsAspect, EnvsMain, EnvTransformer, Environment } from '@teambit/envs';\nimport { ReactAspect, ReactEnv, ReactMain, UseTypescriptModifiers } from '@teambit/react';\nimport { NodeAspect } from './node.aspect';\nimport { NodeEnv } from './node.env';\nimport { nodeEnvTemplate } from './templates/node-env';\nimport { nodeTemplate } from './templates/node';\nimport { NodeAppType } from './node.app-type';\nimport { expressAppTemplate } from './templates/express-app';\nimport { expressRouteTemplate } from './templates/express-route';\n\nexport class NodeMain {\n constructor(\n private react: ReactMain,\n\n private tsAspect: TypescriptMain,\n\n readonly nodeEnv: NodeEnv,\n\n private envs: EnvsMain\n ) {}\n\n icon() {\n return 'https://static.bit.dev/extensions-icons/nodejs.svg';\n }\n\n /**\n * @deprecated use useTypescript()\n * override the TS config of the environment.\n */\n overrideTsConfig: (\n tsconfig: TsConfigSourceFile,\n compilerOptions?: Partial<TsCompilerOptionsWithoutTsConfig>,\n tsModule?: any\n ) => EnvTransformer = this.react.overrideTsConfig.bind(this.react);\n\n /**\n * override the jest config of the environment.\n */\n overrideJestConfig = this.react.overrideJestConfig.bind(this.react);\n\n /**\n * override the env build pipeline.\n */\n overrideBuildPipe: (tasks: BuildTask[]) => EnvTransformer = this.react.overrideBuildPipe.bind(this.react);\n\n /**\n * override the env compilers list.\n */\n overrideCompiler: (compiler: Compiler) => EnvTransformer = this.react.overrideCompiler.bind(this.react);\n\n /**\n * override the env compilers tasks in the build pipe.\n */\n overrideCompilerTasks: (tasks: BuildTask[]) => EnvTransformer = this.react.overrideCompilerTasks.bind(this.react);\n\n /**\n * @deprecated use useTypescript()\n * override the build ts config.\n */\n overrideBuildTsConfig: (\n tsconfig: any,\n compilerOptions?: Partial<TsCompilerOptionsWithoutTsConfig>\n ) => EnvTransformer = this.react.overrideBuildTsConfig.bind(this.react);\n\n /**\n * override package json properties.\n */\n overridePackageJsonProps: (props: PackageJsonProps) => EnvTransformer = this.react.overridePackageJsonProps.bind(\n this.react\n );\n\n /**\n * @deprecated - use useWebpack\n * override the preview config in the env.\n */\n overridePreviewConfig = this.react.overridePreviewConfig.bind(this.react);\n\n /**\n * @deprecated - use useWebpack\n * override the dev server configuration.\n */\n overrideDevServerConfig = this.react.overrideDevServerConfig.bind(this.react);\n\n /**\n * override the env's typescript config for both dev and build time.\n * Replaces both overrideTsConfig (devConfig) and overrideBuildTsConfig (buildConfig)\n */\n useTypescript(modifiers?: UseTypescriptModifiers, tsModule?: any) {\n const overrides: any = {};\n const devTransformers = modifiers?.devConfig;\n if (devTransformers) {\n overrides.getCompiler = () => this.nodeEnv.getCompiler(devTransformers, tsModule);\n }\n const buildTransformers = modifiers?.buildConfig;\n if (buildTransformers) {\n const buildPipeModifiers = {\n tsModifier: {\n transformers: buildTransformers,\n module: tsModule,\n },\n };\n overrides.getBuildPipe = () => this.nodeEnv.getBuildPipe(buildPipeModifiers);\n }\n return this.envs.override(overrides);\n }\n\n /**\n * override the env's dev server and preview webpack configurations.\n * Replaces both overrideDevServerConfig and overridePreviewConfig\n */\n useWebpack = this.react.useWebpack.bind(this.react);\n\n /**\n * An API to mutate the prettier config\n */\n usePrettier = this.react.usePrettier.bind(this.react);\n\n /**\n * An API to mutate the eslint config\n */\n useEslint = this.react.useEslint.bind(this.react);\n\n /**\n * override the dependency configuration of the component environment.\n */\n overrideDependencies(dependencyPolicy: EnvPolicyConfigObject) {\n return this.envs.override({\n getDependencies: () => mergeDeepLeft(dependencyPolicy, this.nodeEnv.getDependencies()),\n });\n }\n\n overrideMounter = this.react.overrideMounter.bind(this.react);\n\n /**\n * create a new composition of the node environment.\n */\n compose(transformers: EnvTransformer[], targetEnv: Environment = {}) {\n return this.envs.compose(this.envs.merge(targetEnv, this.nodeEnv), transformers);\n }\n\n static runtime = MainRuntime;\n static dependencies = [LoggerAspect, EnvsAspect, ApplicationAspect, ReactAspect, GeneratorAspect, TypescriptAspect];\n\n static async provider([loggerAspect, envs, application, react, generator, tsAspect]: [\n LoggerMain,\n EnvsMain,\n ApplicationMain,\n ReactMain,\n GeneratorMain,\n TypescriptMain\n ]) {\n const logger = loggerAspect.createLogger(NodeAspect.id);\n const nodeEnv = envs.merge<NodeEnv, ReactEnv>(new NodeEnv(tsAspect, react), react.reactEnv);\n envs.registerEnv(nodeEnv);\n const nodeAppType = new NodeAppType('node-app', nodeEnv, logger);\n application.registerAppType(nodeAppType);\n generator.registerComponentTemplate([nodeEnvTemplate, nodeTemplate, expressAppTemplate, expressRouteTemplate]);\n return new NodeMain(react, tsAspect, nodeEnv, envs);\n }\n}\n\nNodeAspect.addRuntime(NodeMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAA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nE,OAAO,KAAKpC,IAAL,CAAUmC,OAAV,CAAkB,KAAKnC,IAAL,CAAUqC,KAAV,CAAgBD,SAAhB,EAA2B,KAAKrC,OAAhC,CAAlB,EAA4D4B,YAA5D,CAAP;EACD;;EAKoB,aAARW,QAAQ,CAAC,CAACC,YAAD,EAAevC,IAAf,EAAqBwC,WAArB,EAAkC3C,KAAlC,EAAyC4C,SAAzC,EAAoD3C,QAApD,CAAD,EAOlB;IACD,MAAM4C,MAAM,GAAGH,YAAY,CAACI,YAAb,CAA0BC,kBAAA,CAAWC,EAArC,CAAf;IACA,MAAM9C,OAAO,GAAGC,IAAI,CAACqC,KAAL,CAA8B,KAAIS,gBAAJ,EAAYhD,QAAZ,EAAsBD,KAAtB,CAA9B,EAA4DA,KAAK,CAACkD,QAAlE,CAAhB;IACA/C,IAAI,CAACgD,WAAL,CAAiBjD,OAAjB;IACA,MAAMkD,WAAW,GAAG,KAAIC,oBAAJ,EAAgB,UAAhB,EAA4BnD,OAA5B,EAAqC2C,MAArC,CAApB;IACAF,WAAW,CAACW,eAAZ,CAA4BF,WAA5B;IACAR,SAAS,CAACW,yBAAV,CAAoC,CAACC,0BAAD,EAAkBC,qBAAlB,EAAgCC,gCAAhC,EAAoDC,oCAApD,CAApC;IACA,OAAO,IAAI7D,QAAJ,CAAaE,KAAb,EAAoBC,QAApB,EAA8BC,OAA9B,EAAuCC,IAAvC,CAAP;EACD;;AApJmB;;;gCAATL,Q,aAkIM8D,kB;gCAlIN9D,Q,kBAmIW,CAAC+D,sBAAD,EAAeC,kBAAf,EAA2BC,gCAA3B,EAA8CC,oBAA9C,EAA2DC,4BAA3D,EAA4EC,8BAA5E,C;;AAoBxBnB,kBAAA,CAAWoB,UAAX,CAAsBrE,QAAtB"}
1
+ {"version":3,"names":["NodeMain","constructor","react","tsAspect","nodeEnv","envs","overrideTsConfig","bind","overrideJestConfig","overrideBuildPipe","overrideCompiler","overrideCompilerTasks","overrideBuildTsConfig","overridePackageJsonProps","overridePreviewConfig","overrideDevServerConfig","useWebpack","usePrettier","useEslint","overrideMounter","icon","useTypescript","modifiers","tsModule","overrides","devTransformers","devConfig","getCompiler","buildTransformers","buildConfig","buildPipeModifiers","tsModifier","transformers","module","getBuildPipe","override","overrideDependencies","dependencyPolicy","getDependencies","mergeDeepLeft","compose","targetEnv","merge","provider","loggerAspect","application","generator","logger","createLogger","NodeAspect","id","NodeEnv","reactEnv","registerEnv","nodeAppType","NodeAppType","registerAppType","registerComponentTemplate","nodeEnvTemplate","nodeTemplate","expressAppTemplate","expressRouteTemplate","MainRuntime","LoggerAspect","EnvsAspect","ApplicationAspect","ReactAspect","GeneratorAspect","TypescriptAspect","addRuntime"],"sources":["node.main.runtime.ts"],"sourcesContent":["import mergeDeepLeft from 'ramda/src/mergeDeepLeft';\nimport { EnvPolicyConfigObject } from '@teambit/dependency-resolver';\nimport { TsConfigSourceFile } from 'typescript';\nimport { TsCompilerOptionsWithoutTsConfig, TypescriptAspect, TypescriptMain } from '@teambit/typescript';\nimport { ApplicationAspect, ApplicationMain } from '@teambit/application';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { MainRuntime } from '@teambit/cli';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { BuildTask } from '@teambit/builder';\nimport { Compiler } from '@teambit/compiler';\nimport { PackageJsonProps } from '@teambit/pkg';\nimport { EnvsAspect, EnvsMain, EnvTransformer, Environment } from '@teambit/envs';\nimport { ReactAspect, ReactEnv, ReactMain, UseTypescriptModifiers } from '@teambit/react';\nimport { NodeAspect } from './node.aspect';\nimport { NodeEnv } from './node.env';\nimport { nodeEnvTemplate } from './templates/node-env';\nimport { nodeTemplate } from './templates/node';\nimport { NodeAppType } from './node.app-type';\nimport { expressAppTemplate } from './templates/express-app';\nimport { expressRouteTemplate } from './templates/express-route';\n\nexport class NodeMain {\n constructor(\n private react: ReactMain,\n\n private tsAspect: TypescriptMain,\n\n readonly nodeEnv: NodeEnv,\n\n private envs: EnvsMain\n ) {}\n\n icon() {\n return 'https://static.bit.dev/extensions-icons/nodejs.svg';\n }\n\n /**\n * @deprecated use useTypescript()\n * override the TS config of the environment.\n */\n overrideTsConfig: (\n tsconfig: TsConfigSourceFile,\n compilerOptions?: Partial<TsCompilerOptionsWithoutTsConfig>,\n tsModule?: any\n ) => EnvTransformer = this.react.overrideTsConfig.bind(this.react);\n\n /**\n * override the jest config of the environment.\n */\n overrideJestConfig = this.react.overrideJestConfig.bind(this.react);\n\n /**\n * override the env build pipeline.\n */\n overrideBuildPipe: (tasks: BuildTask[]) => EnvTransformer = this.react.overrideBuildPipe.bind(this.react);\n\n /**\n * override the env compilers list.\n */\n overrideCompiler: (compiler: Compiler) => EnvTransformer = this.react.overrideCompiler.bind(this.react);\n\n /**\n * override the env compilers tasks in the build pipe.\n */\n overrideCompilerTasks: (tasks: BuildTask[]) => EnvTransformer = this.react.overrideCompilerTasks.bind(this.react);\n\n /**\n * @deprecated use useTypescript()\n * override the build ts config.\n */\n overrideBuildTsConfig: (\n tsconfig: any,\n compilerOptions?: Partial<TsCompilerOptionsWithoutTsConfig>\n ) => EnvTransformer = this.react.overrideBuildTsConfig.bind(this.react);\n\n /**\n * override package json properties.\n */\n overridePackageJsonProps: (props: PackageJsonProps) => EnvTransformer = this.react.overridePackageJsonProps.bind(\n this.react\n );\n\n /**\n * @deprecated - use useWebpack\n * override the preview config in the env.\n */\n overridePreviewConfig = this.react.overridePreviewConfig.bind(this.react);\n\n /**\n * @deprecated - use useWebpack\n * override the dev server configuration.\n */\n overrideDevServerConfig = this.react.overrideDevServerConfig.bind(this.react);\n\n /**\n * override the env's typescript config for both dev and build time.\n * Replaces both overrideTsConfig (devConfig) and overrideBuildTsConfig (buildConfig)\n */\n useTypescript(modifiers?: UseTypescriptModifiers, tsModule?: any) {\n const overrides: any = {};\n const devTransformers = modifiers?.devConfig;\n if (devTransformers) {\n overrides.getCompiler = () => this.nodeEnv.getCompiler(devTransformers, tsModule);\n }\n const buildTransformers = modifiers?.buildConfig;\n if (buildTransformers) {\n const buildPipeModifiers = {\n tsModifier: {\n transformers: buildTransformers,\n module: tsModule,\n },\n };\n overrides.getBuildPipe = () => this.nodeEnv.getBuildPipe(buildPipeModifiers);\n }\n return this.envs.override(overrides);\n }\n\n /**\n * override the env's dev server and preview webpack configurations.\n * Replaces both overrideDevServerConfig and overridePreviewConfig\n */\n useWebpack = this.react.useWebpack.bind(this.react);\n\n /**\n * An API to mutate the prettier config\n */\n usePrettier = this.react.usePrettier.bind(this.react);\n\n /**\n * An API to mutate the eslint config\n */\n useEslint = this.react.useEslint.bind(this.react);\n\n /**\n * override the dependency configuration of the component environment.\n */\n overrideDependencies(dependencyPolicy: EnvPolicyConfigObject) {\n return this.envs.override({\n getDependencies: () => mergeDeepLeft(dependencyPolicy, this.nodeEnv.getDependencies()),\n });\n }\n\n overrideMounter = this.react.overrideMounter.bind(this.react);\n\n /**\n * create a new composition of the node environment.\n */\n compose(transformers: EnvTransformer[], targetEnv: Environment = {}) {\n return this.envs.compose(this.envs.merge(targetEnv, this.nodeEnv), transformers);\n }\n\n static runtime = MainRuntime;\n static dependencies = [LoggerAspect, EnvsAspect, ApplicationAspect, ReactAspect, GeneratorAspect, TypescriptAspect];\n\n static async provider([loggerAspect, envs, application, react, generator, tsAspect]: [\n LoggerMain,\n EnvsMain,\n ApplicationMain,\n ReactMain,\n GeneratorMain,\n TypescriptMain\n ]) {\n const logger = loggerAspect.createLogger(NodeAspect.id);\n const nodeEnv = envs.merge<NodeEnv, ReactEnv>(new NodeEnv(tsAspect, react), react.reactEnv);\n envs.registerEnv(nodeEnv);\n const nodeAppType = new NodeAppType('node-app', nodeEnv, logger);\n application.registerAppType(nodeAppType);\n generator.registerComponentTemplate([nodeEnvTemplate, nodeTemplate, expressAppTemplate, expressRouteTemplate]);\n return new NodeMain(react, tsAspect, nodeEnv, envs);\n }\n}\n\nNodeAspect.addRuntime(NodeMain);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IA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EAAE2C,MAAM,CAAC;IAChEF,WAAW,CAACW,eAAe,CAACF,WAAW,CAAC;IACxCR,SAAS,CAACW,yBAAyB,CAAC,CAACC,0BAAe,EAAEC,qBAAY,EAAEC,gCAAkB,EAAEC,oCAAoB,CAAC,CAAC;IAC9G,OAAO,IAAI7D,QAAQ,CAACE,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,IAAI,CAAC;EACrD;AACF;AAAC;AAAA,gCArJYL,QAAQ,aAkIF8D,kBAAW;AAAA,gCAlIjB9D,QAAQ,kBAmIG,CAAC+D,sBAAY,EAAEC,kBAAU,EAAEC,gCAAiB,EAAEC,oBAAW,EAAEC,4BAAe,EAAEC,8BAAgB,CAAC;AAoBrHnB,kBAAU,CAACoB,UAAU,CAACrE,QAAQ,CAAC"}
@@ -1,98 +1,74 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.array.iterator.js");
6
-
7
5
  require("core-js/modules/es.promise.js");
8
-
9
6
  Object.defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
9
  exports.default = exports.NodeEnvUI = void 0;
13
-
14
10
  function _defineProperty2() {
15
11
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
-
17
12
  _defineProperty2 = function () {
18
13
  return data;
19
14
  };
20
-
21
15
  return data;
22
16
  }
23
-
24
17
  function _react() {
25
18
  const data = _interopRequireDefault(require("react"));
26
-
27
19
  _react = function () {
28
20
  return data;
29
21
  };
30
-
31
22
  return data;
32
23
  }
33
-
34
24
  function _compositions() {
35
25
  const data = require("@teambit/compositions");
36
-
37
26
  _compositions = function () {
38
27
  return data;
39
28
  };
40
-
41
29
  return data;
42
30
  }
43
-
44
31
  function _ui() {
45
32
  const data = require("@teambit/ui");
46
-
47
33
  _ui = function () {
48
34
  return data;
49
35
  };
50
-
51
36
  return data;
52
37
  }
53
-
54
38
  function _tester() {
55
39
  const data = require("@teambit/tester");
56
-
57
40
  _tester = function () {
58
41
  return data;
59
42
  };
60
-
61
43
  return data;
62
44
  }
63
-
64
45
  function _designUi() {
65
46
  const data = require("@teambit/design.ui.empty-box");
66
-
67
47
  _designUi = function () {
68
48
  return data;
69
49
  };
70
-
71
50
  return data;
72
51
  }
73
-
74
52
  function _node() {
75
53
  const data = require("./node.aspect");
76
-
77
54
  _node = function () {
78
55
  return data;
79
56
  };
80
-
81
57
  return data;
82
58
  }
83
-
84
59
  class NodeEnvUI {
85
60
  static async provider([compositionsUI, testerUi]) {
86
- const nodeEnvUI = new NodeEnvUI(); // TODO: pass the docs url into here after fetch it from the community aspect
87
-
61
+ const nodeEnvUI = new NodeEnvUI();
62
+ // TODO: pass the docs url into here after fetch it from the community aspect
88
63
  testerUi.registerEmptyState(() => {
89
64
  return /*#__PURE__*/_react().default.createElement(_designUi().EmptyBox, {
90
65
  title: "This component doesn\u2019t have any tests.",
91
66
  linkText: "Learn how to add tests to your node components",
92
67
  link: `https://bit.dev/docs/dev-services-overview/tester/tester-overview`
93
68
  });
94
- }); // TODO: pass the docs url into here after fetch it from the community aspect
69
+ });
95
70
 
71
+ // TODO: pass the docs url into here after fetch it from the community aspect
96
72
  compositionsUI.registerEmptyState(() => {
97
73
  return /*#__PURE__*/_react().default.createElement(_designUi().EmptyBox, {
98
74
  title: "This component doesn\u2019t have any compositions.",
@@ -102,16 +78,12 @@ class NodeEnvUI {
102
78
  });
103
79
  return nodeEnvUI;
104
80
  }
105
-
106
81
  }
107
-
108
82
  exports.NodeEnvUI = NodeEnvUI;
109
83
  (0, _defineProperty2().default)(NodeEnvUI, "runtime", _ui().UIRuntime);
110
84
  (0, _defineProperty2().default)(NodeEnvUI, "slots", []);
111
85
  (0, _defineProperty2().default)(NodeEnvUI, "dependencies", [_compositions().CompositionsAspect, _tester().TesterAspect]);
112
-
113
86
  _node().NodeAspect.addRuntime(NodeEnvUI);
114
-
115
87
  var _default = NodeEnvUI;
116
88
  exports.default = _default;
117
89
 
@@ -1 +1 @@
1
- {"version":3,"names":["NodeEnvUI","provider","compositionsUI","testerUi","nodeEnvUI","registerEmptyState","UIRuntime","CompositionsAspect","TesterAspect","NodeAspect","addRuntime"],"sources":["node.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport { CompositionsAspect, CompositionsUI } from '@teambit/compositions';\nimport { UIRuntime } from '@teambit/ui';\nimport { TesterAspect, TesterUI } from '@teambit/tester';\nimport { EmptyBox } from '@teambit/design.ui.empty-box';\nimport { NodeAspect } from './node.aspect';\n\nexport class NodeEnvUI {\n static runtime = UIRuntime;\n static slots = [];\n static dependencies = [CompositionsAspect, TesterAspect];\n\n static async provider([compositionsUI, testerUi]: [CompositionsUI, TesterUI]) {\n const nodeEnvUI = new NodeEnvUI();\n // TODO: pass the docs url into here after fetch it from the community aspect\n testerUi.registerEmptyState(() => {\n return (\n <EmptyBox\n title=\"This component doesn’t have any tests.\"\n linkText=\"Learn how to add tests to your node components\"\n link={`https://bit.dev/docs/dev-services-overview/tester/tester-overview`}\n />\n );\n });\n\n // TODO: pass the docs url into here after fetch it from the community aspect\n compositionsUI.registerEmptyState(() => {\n return (\n <EmptyBox\n title=\"This component doesn’t have any compositions.\"\n linkText=\"Learn how to add compositions to your node components\"\n link={`https://bit.dev/docs/dev-services-overview/compositions/compositions-overview`}\n />\n );\n });\n\n return nodeEnvUI;\n }\n}\n\nNodeAspect.addRuntime(NodeEnvUI);\n\nexport default NodeEnvUI;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,SAAN,CAAgB;EAKA,aAARC,QAAQ,CAAC,CAACC,cAAD,EAAiBC,QAAjB,CAAD,EAAyD;IAC5E,MAAMC,SAAS,GAAG,IAAIJ,SAAJ,EAAlB,CAD4E,CAE5E;;IACAG,QAAQ,CAACE,kBAAT,CAA4B,MAAM;MAChC,oBACE,+BAAC,oBAAD;QACE,KAAK,EAAC,6CADR;QAEE,QAAQ,EAAC,gDAFX;QAGE,IAAI,EAAG;MAHT,EADF;IAOD,CARD,EAH4E,CAa5E;;IACAH,cAAc,CAACG,kBAAf,CAAkC,MAAM;MACtC,oBACE,+BAAC,oBAAD;QACE,KAAK,EAAC,oDADR;QAEE,QAAQ,EAAC,uDAFX;QAGE,IAAI,EAAG;MAHT,EADF;IAOD,CARD;IAUA,OAAOD,SAAP;EACD;;AA9BoB;;;gCAAVJ,S,aACMM,e;gCADNN,S,WAEI,E;gCAFJA,S,kBAGW,CAACO,kCAAD,EAAqBC,sBAArB,C;;AA8BxBC,kBAAA,CAAWC,UAAX,CAAsBV,SAAtB;;eAEeA,S"}
1
+ {"version":3,"names":["NodeEnvUI","provider","compositionsUI","testerUi","nodeEnvUI","registerEmptyState","UIRuntime","CompositionsAspect","TesterAspect","NodeAspect","addRuntime"],"sources":["node.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport { CompositionsAspect, CompositionsUI } from '@teambit/compositions';\nimport { UIRuntime } from '@teambit/ui';\nimport { TesterAspect, TesterUI } from '@teambit/tester';\nimport { EmptyBox } from '@teambit/design.ui.empty-box';\nimport { NodeAspect } from './node.aspect';\n\nexport class NodeEnvUI {\n static runtime = UIRuntime;\n static slots = [];\n static dependencies = [CompositionsAspect, TesterAspect];\n\n static async provider([compositionsUI, testerUi]: [CompositionsUI, TesterUI]) {\n const nodeEnvUI = new NodeEnvUI();\n // TODO: pass the docs url into here after fetch it from the community aspect\n testerUi.registerEmptyState(() => {\n return (\n <EmptyBox\n title=\"This component doesn’t have any tests.\"\n linkText=\"Learn how to add tests to your node components\"\n link={`https://bit.dev/docs/dev-services-overview/tester/tester-overview`}\n />\n );\n });\n\n // TODO: pass the docs url into here after fetch it from the community aspect\n compositionsUI.registerEmptyState(() => {\n return (\n <EmptyBox\n title=\"This component doesn’t have any compositions.\"\n linkText=\"Learn how to add compositions to your node components\"\n link={`https://bit.dev/docs/dev-services-overview/compositions/compositions-overview`}\n />\n );\n });\n\n return nodeEnvUI;\n }\n}\n\nNodeAspect.addRuntime(NodeEnvUI);\n\nexport default NodeEnvUI;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,SAAS,CAAC;EAKrB,aAAaC,QAAQ,CAAC,CAACC,cAAc,EAAEC,QAAQ,CAA6B,EAAE;IAC5E,MAAMC,SAAS,GAAG,IAAIJ,SAAS,EAAE;IACjC;IACAG,QAAQ,CAACE,kBAAkB,CAAC,MAAM;MAChC,oBACE,+BAAC,oBAAQ;QACP,KAAK,EAAC,6CAAwC;QAC9C,QAAQ,EAAC,gDAAgD;QACzD,IAAI,EAAG;MAAmE,EAC1E;IAEN,CAAC,CAAC;;IAEF;IACAH,cAAc,CAACG,kBAAkB,CAAC,MAAM;MACtC,oBACE,+BAAC,oBAAQ;QACP,KAAK,EAAC,oDAA+C;QACrD,QAAQ,EAAC,uDAAuD;QAChE,IAAI,EAAG;MAA+E,EACtF;IAEN,CAAC,CAAC;IAEF,OAAOD,SAAS;EAClB;AACF;AAAC;AAAA,gCA/BYJ,SAAS,aACHM,eAAS;AAAA,gCADfN,SAAS,WAEL,EAAE;AAAA,gCAFNA,SAAS,kBAGE,CAACO,kCAAkB,EAAEC,sBAAY,CAAC;AA8B1DC,kBAAU,CAACC,UAAU,CAACV,SAAS,CAAC;AAAC,eAElBA,SAAS;AAAA"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.appRoot = appRoot;
7
-
8
7
  function appRoot(context) {
9
8
  return {
10
9
  relativePath: `${context.name}.app-root.ts`,
@@ -1 +1 @@
1
- {"version":3,"names":["appRoot","context","relativePath","name","content"],"sources":["app-root.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function appRoot(context: ComponentContext) {\n return {\n relativePath: `${context.name}.app-root.ts`,\n content: `import Application from 'express';\nimport {getPort} from './get-port';\nimport {getMockRoute} from './mock-route';\n\nexport const expressApp = async () => {\n const app = Application();\n const port = await getPort();\n registerRoutes(app);\n app.listen(port, () => {\n console.log(\\`${context.name} app listening on port \\${port}\\`);\n });\n};\n\nfunction registerRoutes(app: Application.Application) {\n const mockRoute = getMockRoute();\n const routes = [mockRoute];\n routes.forEach(route => {\n app[route.method](route.route, route.middlewares);\n })\n}\n\nexpressApp().catch(err => {\n console.log('error from express', err);\n process.exit(1);\n});\n`,\n };\n}\n"],"mappings":";;;;;;;AAEO,SAASA,OAAT,CAAiBC,OAAjB,EAA4C;EACjD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,cADzB;IAELC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoBH,OAAO,CAACE,IAAK;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EA3BS,CAAP;AA6BD"}
1
+ {"version":3,"names":["appRoot","context","relativePath","name","content"],"sources":["app-root.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function appRoot(context: ComponentContext) {\n return {\n relativePath: `${context.name}.app-root.ts`,\n content: `import Application from 'express';\nimport {getPort} from './get-port';\nimport {getMockRoute} from './mock-route';\n\nexport const expressApp = async () => {\n const app = Application();\n const port = await getPort();\n registerRoutes(app);\n app.listen(port, () => {\n console.log(\\`${context.name} app listening on port \\${port}\\`);\n });\n};\n\nfunction registerRoutes(app: Application.Application) {\n const mockRoute = getMockRoute();\n const routes = [mockRoute];\n routes.forEach(route => {\n app[route.method](route.route, route.middlewares);\n })\n}\n\nexpressApp().catch(err => {\n console.log('error from express', err);\n process.exit(1);\n});\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAO,CAACC,OAAyB,EAAE;EACjD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,cAAa;IAC3CC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoBH,OAAO,CAACE,IAAK;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,CAAC;AACH"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.compositionFile = compositionFile;
7
-
8
7
  function compositionFile(context) {
9
8
  return {
10
9
  relativePath: `${context.name}.composition.tsx`,
@@ -1 +1 @@
1
- {"version":3,"names":["compositionFile","context","relativePath","name","content","nameCamelCase"],"sources":["composition.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function compositionFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.composition.tsx`,\n content: `import React from 'react';\nimport { ${context.nameCamelCase} } from './${context.name}';\n\nexport function ReturnsCorrectValue() {\n return <div>{${context.nameCamelCase}()}</div>;\n}\n`,\n };\n}\n"],"mappings":";;;;;;;AAEO,SAASA,eAAT,CAAyBC,OAAzB,EAAoD;EACzD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,kBADzB;IAELC,OAAO,EAAG;AACd,WAAWH,OAAO,CAACI,aAAc,cAAaJ,OAAO,CAACE,IAAK;AAC3D;AACA;AACA,iBAAiBF,OAAO,CAACI,aAAc;AACvC;AACA;EARS,CAAP;AAUD"}
1
+ {"version":3,"names":["compositionFile","context","relativePath","name","content","nameCamelCase"],"sources":["composition.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function compositionFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.composition.tsx`,\n content: `import React from 'react';\nimport { ${context.nameCamelCase} } from './${context.name}';\n\nexport function ReturnsCorrectValue() {\n return <div>{${context.nameCamelCase}()}</div>;\n}\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,eAAe,CAACC,OAAyB,EAAE;EACzD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,kBAAiB;IAC/CC,OAAO,EAAG;AACd,WAAWH,OAAO,CAACI,aAAc,cAAaJ,OAAO,CAACE,IAAK;AAC3D;AACA;AACA,iBAAiBF,OAAO,CAACI,aAAc;AACvC;AACA;EACE,CAAC;AACH"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.docFile = docFile;
7
-
8
7
  function docFile({
9
8
  name,
10
9
  componentId
@@ -1 +1 @@
1
- {"version":3,"names":["docFile","name","componentId","relativePath","content","toString"],"sources":["doc.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function docFile({ name, componentId }: ComponentContext) {\n return {\n relativePath: `${name}.docs.mdx`,\n content: `---\nlabels: ['express', 'node', 'service', 'app']\ndescription: 'A general purpose bit express application'\n---\n\nConfigure the app plugin on your workspace:\n\n\\`\\`\\`json\n\"${componentId.toString()}\": {},\n\\`\\`\\`\n\n### Run the application\n\nYou can run your application on a separate port to see it outside of the Bit workspace\n\n\\`\\`\\`bash\nbit run ${name}\n\\`\\`\\`\n`,\n };\n}\n"],"mappings":";;;;;;;AAEO,SAASA,OAAT,CAAiB;EAAEC,IAAF;EAAQC;AAAR,CAAjB,EAA0D;EAC/D,OAAO;IACLC,YAAY,EAAG,GAAEF,IAAK,WADjB;IAELG,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAGF,WAAW,CAACG,QAAZ,EAAuB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAUJ,IAAK;AACf;AACA;EApBS,CAAP;AAsBD"}
1
+ {"version":3,"names":["docFile","name","componentId","relativePath","content","toString"],"sources":["doc.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function docFile({ name, componentId }: ComponentContext) {\n return {\n relativePath: `${name}.docs.mdx`,\n content: `---\nlabels: ['express', 'node', 'service', 'app']\ndescription: 'A general purpose bit express application'\n---\n\nConfigure the app plugin on your workspace:\n\n\\`\\`\\`json\n\"${componentId.toString()}\": {},\n\\`\\`\\`\n\n### Run the application\n\nYou can run your application on a separate port to see it outside of the Bit workspace\n\n\\`\\`\\`bash\nbit run ${name}\n\\`\\`\\`\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAO,CAAC;EAAEC,IAAI;EAAEC;AAA8B,CAAC,EAAE;EAC/D,OAAO;IACLC,YAAY,EAAG,GAAEF,IAAK,WAAU;IAChCG,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAGF,WAAW,CAACG,QAAQ,EAAG;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAUJ,IAAK;AACf;AACA;EACE,CAAC;AACH"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getPort = getPort;
7
-
8
7
  function getPort() {
9
8
  return {
10
9
  relativePath: `get-port.ts`,
@@ -1 +1 @@
1
- {"version":3,"names":["getPort","relativePath","content"],"sources":["get-port.ts"],"sourcesContent":["export function getPort() {\n return {\n relativePath: `get-port.ts`,\n content: `export async function getPort() {\n if (process.env.PORT){\n return process.env.PORT;\n }\n const myArgs = process.argv.slice(2);\n return myArgs[0] || 3000;\n}\n`,\n };\n}\n"],"mappings":";;;;;;;AAAO,SAASA,OAAT,GAAmB;EACxB,OAAO;IACLC,YAAY,EAAG,aADV;IAELC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;EATS,CAAP;AAWD"}
1
+ {"version":3,"names":["getPort","relativePath","content"],"sources":["get-port.ts"],"sourcesContent":["export function getPort() {\n return {\n relativePath: `get-port.ts`,\n content: `export async function getPort() {\n if (process.env.PORT){\n return process.env.PORT;\n }\n const myArgs = process.argv.slice(2);\n return myArgs[0] || 3000;\n}\n`,\n };\n}\n"],"mappings":";;;;;;AAAO,SAASA,OAAO,GAAG;EACxB,OAAO;IACLC,YAAY,EAAG,aAAY;IAC3BC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;EACE,CAAC;AACH"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.indexFile = indexFile;
7
-
8
7
  function indexFile(context) {
9
8
  return {
10
9
  relativePath: 'index.ts',
@@ -1 +1 @@
1
- {"version":3,"names":["indexFile","context","relativePath","content","name","isMain"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function indexFile(context: ComponentContext) {\n return {\n relativePath: 'index.ts',\n content: `export { expressApp } from './${context.name}.app-root';\nexport type { Route } from './route';\n`,\n isMain: true,\n };\n}\n"],"mappings":";;;;;;;AAEO,SAASA,SAAT,CAAmBC,OAAnB,EAA8C;EACnD,OAAO;IACLC,YAAY,EAAE,UADT;IAELC,OAAO,EAAG,iCAAgCF,OAAO,CAACG,IAAK;AAC3D;AACA,CAJS;IAKLC,MAAM,EAAE;EALH,CAAP;AAOD"}
1
+ {"version":3,"names":["indexFile","context","relativePath","content","name","isMain"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function indexFile(context: ComponentContext) {\n return {\n relativePath: 'index.ts',\n content: `export { expressApp } from './${context.name}.app-root';\nexport type { Route } from './route';\n`,\n isMain: true,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAAS,CAACC,OAAyB,EAAE;EACnD,OAAO;IACLC,YAAY,EAAE,UAAU;IACxBC,OAAO,EAAG,iCAAgCF,OAAO,CAACG,IAAK;AAC3D;AACA,CAAC;IACGC,MAAM,EAAE;EACV,CAAC;AACH"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.mockRoute = mockRoute;
7
-
8
7
  function mockRoute() {
9
8
  return {
10
9
  relativePath: `mock-route.ts`,
@@ -1 +1 @@
1
- {"version":3,"names":["mockRoute","relativePath","content"],"sources":["mock-route.ts"],"sourcesContent":["export function mockRoute() {\n return {\n relativePath: `mock-route.ts`,\n content: `import type { Route } from './route';\n\nexport function getMockRoute(): Route {\n return {\n method: 'get',\n route: '/',\n middlewares: [async (req, res) => res.send('hello world')]\n }\n}\n`,\n };\n}\n"],"mappings":";;;;;;;AAAO,SAASA,SAAT,GAAqB;EAC1B,OAAO;IACLC,YAAY,EAAG,eADV;IAELC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAXS,CAAP;AAaD"}
1
+ {"version":3,"names":["mockRoute","relativePath","content"],"sources":["mock-route.ts"],"sourcesContent":["export function mockRoute() {\n return {\n relativePath: `mock-route.ts`,\n content: `import type { Route } from './route';\n\nexport function getMockRoute(): Route {\n return {\n method: 'get',\n route: '/',\n middlewares: [async (req, res) => res.send('hello world')]\n }\n}\n`,\n };\n}\n"],"mappings":";;;;;;AAAO,SAASA,SAAS,GAAG;EAC1B,OAAO;IACLC,YAAY,EAAG,eAAc;IAC7BC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,CAAC;AACH"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.nodeApp = nodeApp;
7
-
8
7
  function nodeApp(context) {
9
8
  return {
10
9
  relativePath: `${context.name}.node-app.ts`,
@@ -1 +1 @@
1
- {"version":3,"names":["nodeApp","context","relativePath","name","content","nameCamelCase"],"sources":["node-app.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function nodeApp(context: ComponentContext) {\n return {\n relativePath: `${context.name}.node-app.ts`,\n content: `import { NodeAppOptions } from '@teambit/node';\n\nexport const ${context.nameCamelCase}: NodeAppOptions = {\n name: '${context.name}',\n entry: require.resolve('./${context.name}.app-root'),\n portRange: [3000, 4000]\n};\n\nexport default ${context.nameCamelCase};\n`,\n };\n}\n"],"mappings":";;;;;;;AAEO,SAASA,OAAT,CAAiBC,OAAjB,EAA4C;EACjD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,cADzB;IAELC,OAAO,EAAG;AACd;AACA,eAAeH,OAAO,CAACI,aAAc;AACrC,WAAWJ,OAAO,CAACE,IAAK;AACxB,8BAA8BF,OAAO,CAACE,IAAK;AAC3C;AACA;AACA;AACA,iBAAiBF,OAAO,CAACI,aAAc;AACvC;EAXS,CAAP;AAaD"}
1
+ {"version":3,"names":["nodeApp","context","relativePath","name","content","nameCamelCase"],"sources":["node-app.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function nodeApp(context: ComponentContext) {\n return {\n relativePath: `${context.name}.node-app.ts`,\n content: `import { NodeAppOptions } from '@teambit/node';\n\nexport const ${context.nameCamelCase}: NodeAppOptions = {\n name: '${context.name}',\n entry: require.resolve('./${context.name}.app-root'),\n portRange: [3000, 4000]\n};\n\nexport default ${context.nameCamelCase};\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAO,CAACC,OAAyB,EAAE;EACjD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,cAAa;IAC3CC,OAAO,EAAG;AACd;AACA,eAAeH,OAAO,CAACI,aAAc;AACrC,WAAWJ,OAAO,CAACE,IAAK;AACxB,8BAA8BF,OAAO,CAACE,IAAK;AAC3C;AACA;AACA;AACA,iBAAiBF,OAAO,CAACI,aAAc;AACvC;EACE,CAAC;AACH"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.route = route;
7
-
8
7
  function route() {
9
8
  return {
10
9
  relativePath: `route.ts`,
@@ -1 +1 @@
1
- {"version":3,"names":["route","relativePath","content"],"sources":["route.ts"],"sourcesContent":["export function route() {\n return {\n relativePath: `route.ts`,\n content: `import express, { Request, Response } from 'express';\n\n/**\n * define express Middleware\n */\nexport type Middleware = (req: Request, res: Response, next: express.NextFunction) => Promise<any>;\n\n/**\n * express new Route\n */\nexport interface Route {\n method: string;\n route: string | RegExp;\n middlewares: Middleware[];\n}\n`,\n };\n}\n"],"mappings":";;;;;;;AAAO,SAASA,KAAT,GAAiB;EACtB,OAAO;IACLC,YAAY,EAAG,UADV;IAELC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAjBS,CAAP;AAmBD"}
1
+ {"version":3,"names":["route","relativePath","content"],"sources":["route.ts"],"sourcesContent":["export function route() {\n return {\n relativePath: `route.ts`,\n content: `import express, { Request, Response } from 'express';\n\n/**\n * define express Middleware\n */\nexport type Middleware = (req: Request, res: Response, next: express.NextFunction) => Promise<any>;\n\n/**\n * express new Route\n */\nexport interface Route {\n method: string;\n route: string | RegExp;\n middlewares: Middleware[];\n}\n`,\n };\n}\n"],"mappings":";;;;;;AAAO,SAASA,KAAK,GAAG;EACtB,OAAO;IACLC,YAAY,EAAG,UAAS;IACxBC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,CAAC;AACH"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.testFile = testFile;
7
-
8
7
  function testFile(context) {
9
8
  return {
10
9
  relativePath: `${context.name}.spec.ts`,
@@ -1 +1 @@
1
- {"version":3,"names":["testFile","context","relativePath","name","content","nameCamelCase"],"sources":["test.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function testFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.spec.ts`,\n content: `import { ${context.nameCamelCase} } from './${context.name}';\n\nit('should return the correct value', () => {\n expect(${context.nameCamelCase}()).toBe('Hello world!');\n});\n`,\n };\n}\n"],"mappings":";;;;;;;AAEO,SAASA,QAAT,CAAkBC,OAAlB,EAA6C;EAClD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,UADzB;IAELC,OAAO,EAAG,YAAWH,OAAO,CAACI,aAAc,cAAaJ,OAAO,CAACE,IAAK;AACzE;AACA;AACA,WAAWF,OAAO,CAACI,aAAc;AACjC;AACA;EAPS,CAAP;AASD"}
1
+ {"version":3,"names":["testFile","context","relativePath","name","content","nameCamelCase"],"sources":["test.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function testFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.spec.ts`,\n content: `import { ${context.nameCamelCase} } from './${context.name}';\n\nit('should return the correct value', () => {\n expect(${context.nameCamelCase}()).toBe('Hello world!');\n});\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,QAAQ,CAACC,OAAyB,EAAE;EAClD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,UAAS;IACvCC,OAAO,EAAG,YAAWH,OAAO,CAACI,aAAc,cAAaJ,OAAO,CAACE,IAAK;AACzE;AACA;AACA,WAAWF,OAAO,CAACI,aAAc;AACjC;AACA;EACE,CAAC;AACH"}