@teambit/node 0.0.1110 → 0.0.1112

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 (61) hide show
  1. package/artifacts/env-template/public/{383.467873c94ffd6f6dc489.js → 182.d10a2300a3c6d2196e7b.js} +56 -49
  2. package/artifacts/env-template/public/{924.f496add3c3d5bdf0bc41.js → 924.acac6a784d5974a50d8a.js} +19 -19
  3. package/artifacts/env-template/public/assets-manifest.json +14 -14
  4. package/artifacts/env-template/public/{compositions.7af96ab73bf0ebb71bd2.js → compositions.8e59a440ff9e3d2c71f1.js} +3 -3
  5. package/artifacts/env-template/public/compositions.html +1 -1
  6. package/artifacts/env-template/public/{overview.cca318982930f8def773.js → overview.c0655db4d1c6e0b4d291.js} +1 -1
  7. package/artifacts/env-template/public/overview.html +1 -1
  8. package/artifacts/env-template/public/peers.8ae6db51f3ff67dbc8cb.js +1 -0
  9. package/artifacts/env-template/public/{preview-root.b1ea3fdc09f4983f7afd.js → preview-root.4193777f3c98e63dccba.js} +1 -1
  10. package/artifacts/env-template/public/static/css/{924.b8931f51.css → 924.491f0cdf.css} +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/jest/index.js.map +1 -1
  13. package/dist/jest/jest.config.js.map +1 -1
  14. package/dist/node.app-type.js.map +1 -1
  15. package/dist/node.application.js.map +1 -1
  16. package/dist/node.aspect.js.map +1 -1
  17. package/dist/node.composition.js.map +1 -1
  18. package/dist/node.env.js.map +1 -1
  19. package/dist/node.main.runtime.js +12 -41
  20. package/dist/node.main.runtime.js.map +1 -1
  21. package/dist/node.ui.runtime.js.map +1 -1
  22. package/dist/{preview-1689736586631.js → preview-1689909446382.js} +2 -2
  23. package/dist/templates/express-app/files/app-root.js.map +1 -1
  24. package/dist/templates/express-app/files/composition.js.map +1 -1
  25. package/dist/templates/express-app/files/doc.js.map +1 -1
  26. package/dist/templates/express-app/files/get-port.js.map +1 -1
  27. package/dist/templates/express-app/files/index.js.map +1 -1
  28. package/dist/templates/express-app/files/mock-route.js.map +1 -1
  29. package/dist/templates/express-app/files/node-app.js.map +1 -1
  30. package/dist/templates/express-app/files/route.js.map +1 -1
  31. package/dist/templates/express-app/files/test.js.map +1 -1
  32. package/dist/templates/express-app/index.js.map +1 -1
  33. package/dist/templates/express-route/files/composition.js.map +1 -1
  34. package/dist/templates/express-route/files/doc.js.map +1 -1
  35. package/dist/templates/express-route/files/index.js.map +1 -1
  36. package/dist/templates/express-route/files/main.js.map +1 -1
  37. package/dist/templates/express-route/files/test.js.map +1 -1
  38. package/dist/templates/express-route/index.js.map +1 -1
  39. package/dist/templates/node/files/composition.js.map +1 -1
  40. package/dist/templates/node/files/doc.js.map +1 -1
  41. package/dist/templates/node/files/index.js.map +1 -1
  42. package/dist/templates/node/files/main.js.map +1 -1
  43. package/dist/templates/node/files/test.js.map +1 -1
  44. package/dist/templates/node/index.js.map +1 -1
  45. package/dist/templates/node-env/files/aspect.js.map +1 -1
  46. package/dist/templates/node-env/files/doc.js.map +1 -1
  47. package/dist/templates/node-env/files/index.js.map +1 -1
  48. package/dist/templates/node-env/files/jest.config.js.map +1 -1
  49. package/dist/templates/node-env/files/main.runtime.js.map +1 -1
  50. package/dist/templates/node-env/files/preview.runtime.js.map +1 -1
  51. package/dist/templates/node-env/files/typescript/styles.js.map +1 -1
  52. package/dist/templates/node-env/files/typescript/ts-transformer.js.map +1 -1
  53. package/dist/templates/node-env/files/typescript/typescript.config.js.map +1 -1
  54. package/dist/templates/node-env/files/webpack.config.js.map +1 -1
  55. package/dist/templates/node-env/index.js.map +1 -1
  56. package/package-tar/teambit-node-0.0.1112.tgz +0 -0
  57. package/package.json +18 -18
  58. package/artifacts/env-template/public/peers.7189ef30cfa292af5c72.js +0 -1
  59. package/package-tar/teambit-node-0.0.1110.tgz +0 -0
  60. /package/{compositions-1689736586631.js → compositions-1689909446382.js} +0 -0
  61. /package/{overview-1689736586631.js → overview-1689909446382.js} +0 -0
@@ -125,64 +125,29 @@ class NodeMain {
125
125
  this.tsAspect = tsAspect;
126
126
  this.nodeEnv = nodeEnv;
127
127
  this.envs = envs;
128
- /**
129
- * @deprecated use useTypescript()
130
- * override the TS config of the environment.
131
- */
132
128
  (0, _defineProperty2().default)(this, "overrideTsConfig", this.react.overrideTsConfig.bind(this.react));
133
- /**
134
- * override the jest config of the environment.
135
- */
136
129
  (0, _defineProperty2().default)(this, "overrideJestConfig", this.react.overrideJestConfig.bind(this.react));
137
- /**
138
- * override the env build pipeline.
139
- */
140
130
  (0, _defineProperty2().default)(this, "overrideBuildPipe", this.react.overrideBuildPipe.bind(this.react));
141
- /**
142
- * override the env compilers list.
143
- */
144
131
  (0, _defineProperty2().default)(this, "overrideCompiler", this.react.overrideCompiler.bind(this.react));
145
- /**
146
- * override the env compilers tasks in the build pipe.
147
- */
148
132
  (0, _defineProperty2().default)(this, "overrideCompilerTasks", this.react.overrideCompilerTasks.bind(this.react));
149
- /**
150
- * @deprecated use useTypescript()
151
- * override the build ts config.
152
- */
153
133
  (0, _defineProperty2().default)(this, "overrideBuildTsConfig", this.react.overrideBuildTsConfig.bind(this.react));
154
- /**
155
- * override package json properties.
156
- */
157
134
  (0, _defineProperty2().default)(this, "overridePackageJsonProps", this.react.overridePackageJsonProps.bind(this.react));
158
- /**
159
- * @deprecated - use useWebpack
160
- * override the preview config in the env.
161
- */
162
135
  (0, _defineProperty2().default)(this, "overridePreviewConfig", this.react.overridePreviewConfig.bind(this.react));
163
- /**
164
- * @deprecated - use useWebpack
165
- * override the dev server configuration.
166
- */
167
136
  (0, _defineProperty2().default)(this, "overrideDevServerConfig", this.react.overrideDevServerConfig.bind(this.react));
168
- /**
169
- * override the env's dev server and preview webpack configurations.
170
- * Replaces both overrideDevServerConfig and overridePreviewConfig
171
- */
172
137
  (0, _defineProperty2().default)(this, "useWebpack", this.react.useWebpack.bind(this.react));
173
- /**
174
- * An API to mutate the prettier config
175
- */
176
138
  (0, _defineProperty2().default)(this, "usePrettier", this.react.usePrettier.bind(this.react));
177
- /**
178
- * An API to mutate the eslint config
179
- */
180
139
  (0, _defineProperty2().default)(this, "useEslint", this.react.useEslint.bind(this.react));
181
140
  (0, _defineProperty2().default)(this, "overrideMounter", this.react.overrideMounter.bind(this.react));
182
141
  }
183
142
  icon() {
184
143
  return 'https://static.bit.dev/extensions-icons/nodejs.svg';
185
144
  }
145
+
146
+ /**
147
+ * @deprecated use useTypescript()
148
+ * override the TS config of the environment.
149
+ */
150
+
186
151
  /**
187
152
  * override the env's typescript config for both dev and build time.
188
153
  * Replaces both overrideTsConfig (devConfig) and overrideBuildTsConfig (buildConfig)
@@ -205,6 +170,12 @@ class NodeMain {
205
170
  }
206
171
  return this.envs.override(overrides);
207
172
  }
173
+
174
+ /**
175
+ * override the env's dev server and preview webpack configurations.
176
+ * Replaces both overrideDevServerConfig and overridePreviewConfig
177
+ */
178
+
208
179
  /**
209
180
  * override the dependency configuration of the component environment.
210
181
  */
@@ -1 +1 @@
1
- {"version":3,"names":["_mergeDeepLeft","data","_interopRequireDefault","require","_typescript","_application","_logger","_cli","_generator","_envs","_react","_node","_node2","_nodeEnv","_node3","_node4","_expressApp","_expressRoute","NodeMain","constructor","react","tsAspect","nodeEnv","envs","_defineProperty2","default","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","exports","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 if (generator)\n generator.registerComponentTemplate([nodeEnvTemplate, nodeTemplate, expressAppTemplate, expressRouteTemplate]);\n return new NodeMain(react, tsAspect, nodeEnv, envs);\n }\n}\n\nNodeAspect.addRuntime(NodeMain);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,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AACI,YAAY,CAACC,kBAAU,CAACC,EAAE,CAAC;IACvD,MAAMhD,OAAO,GAAGC,IAAI,CAACuC,KAAK,CAAoB,KAAIS,gBAAO,EAAClD,QAAQ,EAAED,KAAK,CAAC,EAAEA,KAAK,CAACoD,QAAQ,CAAC;IAC3FjD,IAAI,CAACkD,WAAW,CAACnD,OAAO,CAAC;IACzB,MAAMoD,WAAW,GAAG,KAAIC,oBAAW,EAAC,UAAU,EAAErD,OAAO,EAAE6C,MAAM,CAAC;IAChEF,WAAW,CAACW,eAAe,CAACF,WAAW,CAAC;IACxC,IAAIR,SAAS,EACXA,SAAS,CAACW,yBAAyB,CAAC,CAACC,0BAAe,EAAEC,qBAAY,EAAEC,gCAAkB,EAAEC,oCAAoB,CAAC,CAAC;IAChH,OAAO,IAAI/D,QAAQ,CAACE,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,IAAI,CAAC;EACrD;AACF;AAAC2D,OAAA,CAAAhE,QAAA,GAAAA,QAAA;AAAA,IAAAM,gBAAA,GAAAC,OAAA,EAtJYP,QAAQ,aAkIFiE,kBAAW;AAAA,IAAA3D,gBAAA,GAAAC,OAAA,EAlIjBP,QAAQ,kBAmIG,CAACkE,sBAAY,EAAEC,kBAAU,EAAEC,gCAAiB,EAAEC,oBAAW,EAAEC,4BAAe,EAAEC,8BAAgB,CAAC;AAqBrHpB,kBAAU,CAACqB,UAAU,CAACxE,QAAQ,CAAC"}
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 if (generator)\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;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IAChH,OAAO,IAAI7D,QAAQ,CAACE,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,IAAI,CAAC;EACrD;AACF;AAAC;AAAA,gCAtJYL,QAAQ,aAkIF8D,kBAAW;AAAA,gCAlIjB9D,QAAQ,kBAmIG,CAAC+D,sBAAY,EAAEC,kBAAU,EAAEC,gCAAiB,EAAEC,oBAAW,EAAEC,4BAAe,EAAEC,8BAAgB,CAAC;AAqBrHnB,kBAAU,CAACoB,UAAU,CAACrE,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["_react","data","_interopRequireDefault","require","_compositions","_ui","_tester","_designUi","_node","NodeEnvUI","provider","compositionsUI","testerUi","nodeEnvUI","registerEmptyState","default","createElement","EmptyBox","title","linkText","link","exports","_defineProperty2","UIRuntime","CompositionsAspect","TesterAspect","NodeAspect","addRuntime","_default"],"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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AAG;MAAmE,CAC3E,CAAC;IAEN,CAAC,CAAC;;IAEF;IACAT,cAAc,CAACG,kBAAkB,CAAC,MAAM;MACtC,oBACEd,MAAA,GAAAe,OAAA,CAAAC,aAAA,CAACT,SAAA,GAAAU,QAAQ;QACPC,KAAK,EAAC,oDAA+C;QACrDC,QAAQ,EAAC,uDAAuD;QAChEC,IAAI,EAAG;MAA+E,CACvF,CAAC;IAEN,CAAC,CAAC;IAEF,OAAOP,SAAS;EAClB;AACF;AAACQ,OAAA,CAAAZ,SAAA,GAAAA,SAAA;AAAA,IAAAa,gBAAA,GAAAP,OAAA,EA/BYN,SAAS,aACHc,eAAS;AAAA,IAAAD,gBAAA,GAAAP,OAAA,EADfN,SAAS,WAEL,EAAE;AAAA,IAAAa,gBAAA,GAAAP,OAAA,EAFNN,SAAS,kBAGE,CAACe,kCAAkB,EAAEC,sBAAY,CAAC;AA8B1DC,kBAAU,CAACC,UAAU,CAAClB,SAAS,CAAC;AAAC,IAAAmB,QAAA,GAElBnB,SAAS;AAAAY,OAAA,CAAAN,OAAA,GAAAa,QAAA"}
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"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_node@0.0.1110/dist/node.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_node@0.0.1110/dist/node.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_node@0.0.1112/dist/node.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_node@0.0.1112/dist/node.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -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,OAAOA,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"}
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"}
@@ -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,eAAeA,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"}
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"}
@@ -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,OAAOA,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,CAAC,CAAE;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAUJ,IAAK;AACf;AACA;EACE,CAAC;AACH"}
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"}
@@ -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,OAAOA,CAAA,EAAG;EACxB,OAAO;IACLC,YAAY,EAAG,aAAY;IAC3BC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;EACE,CAAC;AACH"}
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"}
@@ -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,SAASA,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"}
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"}
@@ -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,SAASA,CAAA,EAAG;EAC1B,OAAO;IACLC,YAAY,EAAG,eAAc;IAC7BC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,CAAC;AACH"}
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"}
@@ -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,OAAOA,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"}
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"}
@@ -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,KAAKA,CAAA,EAAG;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"}
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"}
@@ -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,QAAQA,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"}
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"}
@@ -1 +1 @@
1
- {"version":3,"names":["_index","data","require","_doc","_appRoot","_nodeApp","_getPort","_mockRoute","_route","expressAppTemplate","name","description","generateFiles","context","indexFile","docFile","appRoot","nodeApp","getPort","mockRoute","route","config","env","exports"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { appRoot } from './files/app-root';\nimport { nodeApp } from './files/node-app';\nimport { getPort } from './files/get-port';\nimport { mockRoute } from './files/mock-route';\nimport { route } from './files/route';\n// import { testFile } from './files/test';\n// import { compositionFile } from './files/composition';\n\nexport const expressAppTemplate: ComponentTemplate = {\n name: 'express-app',\n description: 'a bit express application',\n generateFiles: (context: ComponentContext) => {\n return [\n indexFile(context),\n docFile(context),\n appRoot(context),\n nodeApp(context),\n getPort(),\n mockRoute(),\n route(),\n // compositionFile(context),\n // testFile(context),\n ];\n },\n config: {\n 'teambit.harmony/aspect': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/aspect',\n },\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OA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":3,"names":["expressAppTemplate","name","description","generateFiles","context","indexFile","docFile","appRoot","nodeApp","getPort","mockRoute","route","config","env"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { appRoot } from './files/app-root';\nimport { nodeApp } from './files/node-app';\nimport { getPort } from './files/get-port';\nimport { mockRoute } from './files/mock-route';\nimport { route } from './files/route';\n// import { testFile } from './files/test';\n// import { compositionFile } from './files/composition';\n\nexport const expressAppTemplate: ComponentTemplate = {\n name: 'express-app',\n description: 'a bit express application',\n generateFiles: (context: ComponentContext) => {\n return [\n indexFile(context),\n docFile(context),\n appRoot(context),\n nodeApp(context),\n getPort(),\n mockRoute(),\n route(),\n // compositionFile(context),\n // testFile(context),\n ];\n },\n config: {\n 'teambit.harmony/aspect': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/aspect',\n },\n },\n};\n"],"mappings":";;;;;;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;AACA;;AAEO,MAAMA,kBAAqC,GAAG;EACnDC,IAAI,EAAE,aAAa;EACnBC,WAAW,EAAE,2BAA2B;EACxCC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CACL,IAAAC,kBAAS,EAACD,OAAO,CAAC,EAClB,IAAAE,cAAO,EAACF,OAAO,CAAC,EAChB,IAAAG,kBAAO,EAACH,OAAO,CAAC,EAChB,IAAAI,kBAAO,EAACJ,OAAO,CAAC,EAChB,IAAAK,kBAAO,GAAE,EACT,IAAAC,sBAAS,GAAE,EACX,IAAAC,cAAK;IACL;IACA;IAAA,CACD;EACH,CAAC;;EACDC,MAAM,EAAE;IACN,wBAAwB,EAAE,CAAC,CAAC;IAC5B,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAAC"}
@@ -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,eAAeA,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"}
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"}
@@ -1 +1 @@
1
- {"version":3,"names":["docFile","context","relativePath","name","content","namePascalCase"],"sources":["doc.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function docFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.docs.mdx`,\n content: `---\nlabels: ['express', 'node', 'route']\ndescription: 'An express route'\n---\n\nAPI:\n\n\\`\\`\\`ts\nfunction get${context.namePascalCase}Route()\n\\`\\`\\`\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAOA,CAACC,OAAyB,EAAE;EACjD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,WAAU;IACxCC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcH,OAAO,CAACI,cAAe;AACrC;AACA;EACE,CAAC;AACH"}
1
+ {"version":3,"names":["docFile","context","relativePath","name","content","namePascalCase"],"sources":["doc.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function docFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.docs.mdx`,\n content: `---\nlabels: ['express', 'node', 'route']\ndescription: 'An express route'\n---\n\nAPI:\n\n\\`\\`\\`ts\nfunction get${context.namePascalCase}Route()\n\\`\\`\\`\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAO,CAACC,OAAyB,EAAE;EACjD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,WAAU;IACxCC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcH,OAAO,CAACI,cAAe;AACrC;AACA;EACE,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"names":["indexFile","context","relativePath","content","namePascalCase","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 { get${context.namePascalCase}Route } from './${context.name}';\n`,\n isMain: true,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAACC,OAAyB,EAAE;EACnD,OAAO;IACLC,YAAY,EAAE,UAAU;IACxBC,OAAO,EAAG,eAAcF,OAAO,CAACG,cAAe,mBAAkBH,OAAO,CAACI,IAAK;AAClF,CAAC;IACGC,MAAM,EAAE;EACV,CAAC;AACH"}
1
+ {"version":3,"names":["indexFile","context","relativePath","content","namePascalCase","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 { get${context.namePascalCase}Route } from './${context.name}';\n`,\n isMain: true,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAAS,CAACC,OAAyB,EAAE;EACnD,OAAO;IACLC,YAAY,EAAE,UAAU;IACxBC,OAAO,EAAG,eAAcF,OAAO,CAACG,cAAe,mBAAkBH,OAAO,CAACI,IAAK;AAClF,CAAC;IACGC,MAAM,EAAE;EACV,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"names":["mainFile","context","relativePath","name","content","namePascalCase"],"sources":["main.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function mainFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.ts`,\n content: `export function get${context.namePascalCase}Route() {\n return {\n method: 'get',\n route: '/${context.name}',\n middlewares: [async (req, res) => res.send('${context.name} response')]\n }\n}\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,QAAQA,CAACC,OAAyB,EAAE;EAClD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,KAAI;IAClCC,OAAO,EAAG,sBAAqBH,OAAO,CAACI,cAAe;AAC1D;AACA;AACA,eAAeJ,OAAO,CAACE,IAAK;AAC5B,kDAAkDF,OAAO,CAACE,IAAK;AAC/D;AACA;AACA;EACE,CAAC;AACH"}
1
+ {"version":3,"names":["mainFile","context","relativePath","name","content","namePascalCase"],"sources":["main.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function mainFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.ts`,\n content: `export function get${context.namePascalCase}Route() {\n return {\n method: 'get',\n route: '/${context.name}',\n middlewares: [async (req, res) => res.send('${context.name} response')]\n }\n}\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,QAAQ,CAACC,OAAyB,EAAE;EAClD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,KAAI;IAClCC,OAAO,EAAG,sBAAqBH,OAAO,CAACI,cAAe;AAC1D;AACA;AACA,eAAeJ,OAAO,CAACE,IAAK;AAC5B,kDAAkDF,OAAO,CAACE,IAAK;AAC/D;AACA;AACA;EACE,CAAC;AACH"}
@@ -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,QAAQA,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"}
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"}
@@ -1 +1 @@
1
- {"version":3,"names":["_index","data","require","_doc","_main","expressRouteTemplate","name","description","generateFiles","context","indexFile","docFile","mainFile","config","env","exports"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { mainFile } from './files/main';\n// import { testFile } from './files/test';\n// import { compositionFile } from './files/composition';\n\nexport const expressRouteTemplate: ComponentTemplate = {\n name: 'express-route',\n description: 'an express route',\n generateFiles: (context: ComponentContext) => {\n return [\n indexFile(context),\n docFile(context),\n mainFile(context),\n // compositionFile(context),\n // testFile(context)\n ];\n },\n config: {\n 'teambit.harmony/node': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/node',\n },\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA;AACA;;AAEO,MAAMI,oBAAuC,GAAG;EACrDC,IAAI,EAAE,eAAe;EACrBC,WAAW,EAAE,kBAAkB;EAC/BC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CACL,IAAAC,kBAAS,EAACD,OAAO,CAAC,EAClB,IAAAE,cAAO,EAACF,OAAO,CAAC,EAChB,IAAAG,gBAAQ,EAACH,OAAO;IAChB;IACA;IAAA,CACD;EACH,CAAC;;EACDI,MAAM,EAAE;IACN,sBAAsB,EAAE,CAAC,CAAC;IAC1B,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAACC,OAAA,CAAAV,oBAAA,GAAAA,oBAAA"}
1
+ {"version":3,"names":["expressRouteTemplate","name","description","generateFiles","context","indexFile","docFile","mainFile","config","env"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { mainFile } from './files/main';\n// import { testFile } from './files/test';\n// import { compositionFile } from './files/composition';\n\nexport const expressRouteTemplate: ComponentTemplate = {\n name: 'express-route',\n description: 'an express route',\n generateFiles: (context: ComponentContext) => {\n return [\n indexFile(context),\n docFile(context),\n mainFile(context),\n // compositionFile(context),\n // testFile(context)\n ];\n },\n config: {\n 'teambit.harmony/node': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/node',\n },\n },\n};\n"],"mappings":";;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AACA;;AAEO,MAAMA,oBAAuC,GAAG;EACrDC,IAAI,EAAE,eAAe;EACrBC,WAAW,EAAE,kBAAkB;EAC/BC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CACL,IAAAC,kBAAS,EAACD,OAAO,CAAC,EAClB,IAAAE,cAAO,EAACF,OAAO,CAAC,EAChB,IAAAG,gBAAQ,EAACH,OAAO;IAChB;IACA;IAAA,CACD;EACH,CAAC;;EACDI,MAAM,EAAE;IACN,sBAAsB,EAAE,CAAC,CAAC;IAC1B,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAAC"}
@@ -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,eAAeA,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"}
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"}
@@ -1 +1 @@
1
- {"version":3,"names":["docFile","context","relativePath","name","content","nameCamelCase"],"sources":["doc.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function docFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.docs.mdx`,\n content: `---\nlabels: ['module']\ndescription: 'A general purpose node module'\n---\n\nAPI:\n\n\\`\\`\\`ts\nfunction ${context.nameCamelCase}(): string;\n\\`\\`\\`\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAOA,CAACC,OAAyB,EAAE;EACjD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,WAAU;IACxCC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAWH,OAAO,CAACI,aAAc;AACjC;AACA;EACE,CAAC;AACH"}
1
+ {"version":3,"names":["docFile","context","relativePath","name","content","nameCamelCase"],"sources":["doc.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function docFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.docs.mdx`,\n content: `---\nlabels: ['module']\ndescription: 'A general purpose node module'\n---\n\nAPI:\n\n\\`\\`\\`ts\nfunction ${context.nameCamelCase}(): string;\n\\`\\`\\`\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAO,CAACC,OAAyB,EAAE;EACjD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,WAAU;IACxCC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAWH,OAAO,CAACI,aAAc;AACjC;AACA;EACE,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"names":["indexFile","context","relativePath","content","nameCamelCase","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 { ${context.nameCamelCase} } from './${context.name}';\n`,\n isMain: true,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAACC,OAAyB,EAAE;EACnD,OAAO;IACLC,YAAY,EAAE,UAAU;IACxBC,OAAO,EAAG,YAAWF,OAAO,CAACG,aAAc,cAAaH,OAAO,CAACI,IAAK;AACzE,CAAC;IACGC,MAAM,EAAE;EACV,CAAC;AACH"}
1
+ {"version":3,"names":["indexFile","context","relativePath","content","nameCamelCase","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 { ${context.nameCamelCase} } from './${context.name}';\n`,\n isMain: true,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAAS,CAACC,OAAyB,EAAE;EACnD,OAAO;IACLC,YAAY,EAAE,UAAU;IACxBC,OAAO,EAAG,YAAWF,OAAO,CAACG,aAAc,cAAaH,OAAO,CAACI,IAAK;AACzE,CAAC;IACGC,MAAM,EAAE;EACV,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"names":["mainFile","context","relativePath","name","content","nameCamelCase"],"sources":["main.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function mainFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.ts`,\n content: `export function ${context.nameCamelCase}() {\n return 'Hello world!';\n}\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,QAAQA,CAACC,OAAyB,EAAE;EAClD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,KAAI;IAClCC,OAAO,EAAG,mBAAkBH,OAAO,CAACI,aAAc;AACtD;AACA;AACA;EACE,CAAC;AACH"}
1
+ {"version":3,"names":["mainFile","context","relativePath","name","content","nameCamelCase"],"sources":["main.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function mainFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.ts`,\n content: `export function ${context.nameCamelCase}() {\n return 'Hello world!';\n}\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,QAAQ,CAACC,OAAyB,EAAE;EAClD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,KAAI;IAClCC,OAAO,EAAG,mBAAkBH,OAAO,CAACI,aAAc;AACtD;AACA;AACA;EACE,CAAC;AACH"}
@@ -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,QAAQA,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"}
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"}
@@ -1 +1 @@
1
- {"version":3,"names":["_index","data","require","_doc","_main","_test","_composition","nodeTemplate","name","description","generateFiles","context","indexFile","docFile","mainFile","compositionFile","testFile","config","env","exports"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { mainFile } from './files/main';\nimport { testFile } from './files/test';\nimport { compositionFile } from './files/composition';\n\nexport const nodeTemplate: ComponentTemplate = {\n name: 'node',\n description: 'a Node.js module',\n generateFiles: (context: ComponentContext) => {\n return [indexFile(context), docFile(context), mainFile(context), compositionFile(context), testFile(context)];\n },\n config: {\n 'teambit.harmony/node': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/node',\n },\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMM,YAA+B,GAAG;EAC7CC,IAAI,EAAE,MAAM;EACZC,WAAW,EAAE,kBAAkB;EAC/BC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CAAC,IAAAC,kBAAS,EAACD,OAAO,CAAC,EAAE,IAAAE,cAAO,EAACF,OAAO,CAAC,EAAE,IAAAG,gBAAQ,EAACH,OAAO,CAAC,EAAE,IAAAI,8BAAe,EAACJ,OAAO,CAAC,EAAE,IAAAK,gBAAQ,EAACL,OAAO,CAAC,CAAC;EAC/G,CAAC;EACDM,MAAM,EAAE;IACN,sBAAsB,EAAE,CAAC,CAAC;IAC1B,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAACC,OAAA,CAAAZ,YAAA,GAAAA,YAAA"}
1
+ {"version":3,"names":["nodeTemplate","name","description","generateFiles","context","indexFile","docFile","mainFile","compositionFile","testFile","config","env"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { mainFile } from './files/main';\nimport { testFile } from './files/test';\nimport { compositionFile } from './files/composition';\n\nexport const nodeTemplate: ComponentTemplate = {\n name: 'node',\n description: 'a Node.js module',\n generateFiles: (context: ComponentContext) => {\n return [indexFile(context), docFile(context), mainFile(context), compositionFile(context), testFile(context)];\n },\n config: {\n 'teambit.harmony/node': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/node',\n },\n },\n};\n"],"mappings":";;;;;;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,YAA+B,GAAG;EAC7CC,IAAI,EAAE,MAAM;EACZC,WAAW,EAAE,kBAAkB;EAC/BC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CAAC,IAAAC,kBAAS,EAACD,OAAO,CAAC,EAAE,IAAAE,cAAO,EAACF,OAAO,CAAC,EAAE,IAAAG,gBAAQ,EAACH,OAAO,CAAC,EAAE,IAAAI,8BAAe,EAACJ,OAAO,CAAC,EAAE,IAAAK,gBAAQ,EAACL,OAAO,CAAC,CAAC;EAC/G,CAAC;EACDM,MAAM,EAAE;IACN,sBAAsB,EAAE,CAAC,CAAC;IAC1B,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["aspectFile","namePascalCase","Name","componentId"],"sources":["aspect.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function aspectFile({ namePascalCase: Name, componentId }: ComponentContext) {\n return `import { Aspect } from '@teambit/harmony';\n\nexport const ${Name}Aspect = Aspect.create({\n id: '${componentId}',\n});\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,UAAUA,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC;AAA8B,CAAC,EAAE;EAClF,OAAQ;AACV;AACA,eAAeD,IAAK;AACpB,SAASC,WAAY;AACrB;AACA,CAAC;AACD"}
1
+ {"version":3,"names":["aspectFile","namePascalCase","Name","componentId"],"sources":["aspect.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function aspectFile({ namePascalCase: Name, componentId }: ComponentContext) {\n return `import { Aspect } from '@teambit/harmony';\n\nexport const ${Name}Aspect = Aspect.create({\n id: '${componentId}',\n});\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,UAAU,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC;AAA8B,CAAC,EAAE;EAClF,OAAQ;AACV;AACA,eAAeD,IAAK;AACpB,SAASC,WAAY;AACrB;AACA,CAAC;AACD"}
@@ -1 +1 @@
1
- {"version":3,"names":["docFile","name","componentId"],"sources":["doc.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function docFile({ name, componentId }: ComponentContext) {\n return `---\ndescription: 'A standard Node component development environment'\nlabels: ['node', 'typescript', 'env', 'extension']\n---\n\n## Overview\n\nA customized version which extends the default Node component development environment created by teambit.\n\nThis environment can be applied to all your components or a set of components via the command \\`bit env set <pattern or component_id> ${componentId}\\`, or under the variants of your \\`workspace.json\\` file.\nThat means they will use your custom environment instead of the default environment. Environment components are just like any other Bit components in that they can be\nexported and then shared and used in various projects which makes it easier to create standards when working with many teams.\n\n### Usage instructions\n\n#### Recommended usage:\n\nRun the command \\`bit env set <\"pattern\" or component_id> ${componentId}\\` where the pattern is a glob pattern to select multiple components. This will put the env\nconfig in your component's entry in the \\`.bitmap\\` file.\n\n:::Note - this will override any variants policy that tries to set an env for this component in the workspace.jsonc\n:::\n\n#### Alternative Usage\nUnder the **variant** section of your \\`workspace.json\\` file choose which components you want to have the custom environment set. You can find the id of the extension in the \\`${name}.aspect.ts\\` file.\n\n\\`\\`\\`json\n{\n \"teambit.workspace/variants\": {\n \"{ui/**}, {pages/**}\": {\n \"${componentId}\": {}\n }\n }\n}\n\\`\\`\\`\n\nThis usage may be deprecated in future in favour of the recommended usage above\n\n## Runtime Configurations\n\nExtend the \\`main.runtime\\` file when you want to add custom configurations at runtime.\n\n### Compilation\n\nBy default, Component compilation is done with the TypeScript compiler. Target format is \\`ES2015\\` which\nsupports execution from both NodeJS and browser runtimes for server-side rendering. You can modify the \\`tsconfig.json\\` file to add your own compiler options which will then be merged with the default configs set by teambit.\n\nExample:\n\n\\`\\`\\`json\n{\n \"compilerOptions\": {\n \"target\": \"es2017\",\n \"module\": \"es2015\",\n \"moduleResolution\": \"node\",\n \"lib\": [\"es2017\", \"dom\"],\n \"experimentalDecorators\": true,\n \"esModuleInterop\": true,\n \"outDir\": \"dist\",\n \"sourceMap\": true,\n \"emitDecoratorMetadata\": true,\n \"allowJs\": true,\n \"baseUrl\": \".\",\n \"jsx\": \"react\"\n }\n}\n\\`\\`\\`\n\n### Testing\n\nComponent testing is done through [Jest](https://jestjs.io/) with the default \\`teambit.react/react\\` environment. You can modify the \\`jestconfig.js\\` file to add your own configurations which will then be merged with the default configs set by teambit.\n\nExample:\n\nTo Override the Jest config to ignore transpiling from specific folders add this to the \\`jestconfig.js\\` file:\n\n\\`\\`\\`js\nconst reactJestConfig = require('@teambit/react/jest/jest.config');\nmodule.exports = {\n ...reactJestConfig,\n transformIgnorePatterns: ['/node_modules/(?!(prop-types|@teambit))']\n};\n\\`\\`\\`\n\n### Webpack\n\nBit uses webpack 5 to bundle components. You can modify the \\`webpack.config.js\\` file to add your own configurations which will then be merged with the default configs set by teambit.\n\nExample:\n\n\\`\\`\\`ts\nmodule.exports = {\n module: {\n // add your custom rules here\n rules: []\n }\n};\n\\`\\`\\`\n\n### ESLint\n\nBit uses ESLint to lint your components. You can add your own rules in the \\`${name}.main.runtime\\` file.\n\nExample:\n\n\\`\\`\\`ts\nreact.useEslint({\n transformers: [\n (config) => {\n config.setRule('no-console', ['error']);\n // add more rules here\n return config;\n }\n ]\n}),\n\\`\\`\\`\n\nTo use ESLint:\n\n\\`\\`\\`bash\nbit lint\nbit lint --fix\n\\`\\`\\`\n\n### Formatting\n\nBit uses Prettier to format your components. You can add your own rules in the \\`${name}.main.runtime\\` file.\n\nExample:\n\n\\`\\`\\`ts\nreact.usePrettier({\n transformers: [\n (config) => {\n config.setKey('tabWidth', 2);\n // add more rules here\n return config;\n }\n ]\n}),\n\\`\\`\\`\n\nTo use Prettier:\n\n\\`\\`\\`bash\nbit format --check\nbit format\n\\`\\`\\`\n\n### Dependencies\n\nOverride the default dependencies in the \\`${name}.main.runtime\\` file to include react types of a different version for example.\n\n\\`\\`\\`ts\nreact.overrideDependencies({\n devDependencies: {\n '@types/react': '17.0.3'\n }\n});\n\\`\\`\\`\n\n## Preview Configurations\n\nExtend the \\`${name}.preview.runtime\\` file when you want to add your own customizations only for previewing in the Bit UI.\n\n### Adding a Theme\n\nA custom theme has been added to the env which wraps all the composition files with the required theme so they can be developed with the correct themeing rather than the browsers default. This is added only in the preview runtime and not in the main runtime meaning it is only applied to compositions and not when consuming components. Adding a theme when consuming should be done at App level as you component may be consumed in various apps and have different themes applied depending on where it is consumed.\n\nExample:\n\n\\`\\`\\`ts\nreact.registerProvider([ThemeCompositions]);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAOA,CAAC;EAAEC,IAAI;EAAEC;AAA8B,CAAC,EAAE;EAC/D,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wIAAwIA,WAAY;AACpJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4DA,WAAY;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,mLAAmLD,IAAK;AACxL;AACA;AACA;AACA;AACA;AACA,SAASC,WAAY;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+ED,IAAK;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmFA,IAAK;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6CA,IAAK;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
1
+ {"version":3,"names":["docFile","name","componentId"],"sources":["doc.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function docFile({ name, componentId }: ComponentContext) {\n return `---\ndescription: 'A standard Node component development environment'\nlabels: ['node', 'typescript', 'env', 'extension']\n---\n\n## Overview\n\nA customized version which extends the default Node component development environment created by teambit.\n\nThis environment can be applied to all your components or a set of components via the command \\`bit env set <pattern or component_id> ${componentId}\\`, or under the variants of your \\`workspace.json\\` file.\nThat means they will use your custom environment instead of the default environment. Environment components are just like any other Bit components in that they can be\nexported and then shared and used in various projects which makes it easier to create standards when working with many teams.\n\n### Usage instructions\n\n#### Recommended usage:\n\nRun the command \\`bit env set <\"pattern\" or component_id> ${componentId}\\` where the pattern is a glob pattern to select multiple components. This will put the env\nconfig in your component's entry in the \\`.bitmap\\` file.\n\n:::Note - this will override any variants policy that tries to set an env for this component in the workspace.jsonc\n:::\n\n#### Alternative Usage\nUnder the **variant** section of your \\`workspace.json\\` file choose which components you want to have the custom environment set. You can find the id of the extension in the \\`${name}.aspect.ts\\` file.\n\n\\`\\`\\`json\n{\n \"teambit.workspace/variants\": {\n \"{ui/**}, {pages/**}\": {\n \"${componentId}\": {}\n }\n }\n}\n\\`\\`\\`\n\nThis usage may be deprecated in future in favour of the recommended usage above\n\n## Runtime Configurations\n\nExtend the \\`main.runtime\\` file when you want to add custom configurations at runtime.\n\n### Compilation\n\nBy default, Component compilation is done with the TypeScript compiler. Target format is \\`ES2015\\` which\nsupports execution from both NodeJS and browser runtimes for server-side rendering. You can modify the \\`tsconfig.json\\` file to add your own compiler options which will then be merged with the default configs set by teambit.\n\nExample:\n\n\\`\\`\\`json\n{\n \"compilerOptions\": {\n \"target\": \"es2017\",\n \"module\": \"es2015\",\n \"moduleResolution\": \"node\",\n \"lib\": [\"es2017\", \"dom\"],\n \"experimentalDecorators\": true,\n \"esModuleInterop\": true,\n \"outDir\": \"dist\",\n \"sourceMap\": true,\n \"emitDecoratorMetadata\": true,\n \"allowJs\": true,\n \"baseUrl\": \".\",\n \"jsx\": \"react\"\n }\n}\n\\`\\`\\`\n\n### Testing\n\nComponent testing is done through [Jest](https://jestjs.io/) with the default \\`teambit.react/react\\` environment. You can modify the \\`jestconfig.js\\` file to add your own configurations which will then be merged with the default configs set by teambit.\n\nExample:\n\nTo Override the Jest config to ignore transpiling from specific folders add this to the \\`jestconfig.js\\` file:\n\n\\`\\`\\`js\nconst reactJestConfig = require('@teambit/react/jest/jest.config');\nmodule.exports = {\n ...reactJestConfig,\n transformIgnorePatterns: ['/node_modules/(?!(prop-types|@teambit))']\n};\n\\`\\`\\`\n\n### Webpack\n\nBit uses webpack 5 to bundle components. You can modify the \\`webpack.config.js\\` file to add your own configurations which will then be merged with the default configs set by teambit.\n\nExample:\n\n\\`\\`\\`ts\nmodule.exports = {\n module: {\n // add your custom rules here\n rules: []\n }\n};\n\\`\\`\\`\n\n### ESLint\n\nBit uses ESLint to lint your components. You can add your own rules in the \\`${name}.main.runtime\\` file.\n\nExample:\n\n\\`\\`\\`ts\nreact.useEslint({\n transformers: [\n (config) => {\n config.setRule('no-console', ['error']);\n // add more rules here\n return config;\n }\n ]\n}),\n\\`\\`\\`\n\nTo use ESLint:\n\n\\`\\`\\`bash\nbit lint\nbit lint --fix\n\\`\\`\\`\n\n### Formatting\n\nBit uses Prettier to format your components. You can add your own rules in the \\`${name}.main.runtime\\` file.\n\nExample:\n\n\\`\\`\\`ts\nreact.usePrettier({\n transformers: [\n (config) => {\n config.setKey('tabWidth', 2);\n // add more rules here\n return config;\n }\n ]\n}),\n\\`\\`\\`\n\nTo use Prettier:\n\n\\`\\`\\`bash\nbit format --check\nbit format\n\\`\\`\\`\n\n### Dependencies\n\nOverride the default dependencies in the \\`${name}.main.runtime\\` file to include react types of a different version for example.\n\n\\`\\`\\`ts\nreact.overrideDependencies({\n devDependencies: {\n '@types/react': '17.0.3'\n }\n});\n\\`\\`\\`\n\n## Preview Configurations\n\nExtend the \\`${name}.preview.runtime\\` file when you want to add your own customizations only for previewing in the Bit UI.\n\n### Adding a Theme\n\nA custom theme has been added to the env which wraps all the composition files with the required theme so they can be developed with the correct themeing rather than the browsers default. This is added only in the preview runtime and not in the main runtime meaning it is only applied to compositions and not when consuming components. Adding a theme when consuming should be done at App level as you component may be consumed in various apps and have different themes applied depending on where it is consumed.\n\nExample:\n\n\\`\\`\\`ts\nreact.registerProvider([ThemeCompositions]);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,OAAO,CAAC;EAAEC,IAAI;EAAEC;AAA8B,CAAC,EAAE;EAC/D,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wIAAwIA,WAAY;AACpJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4DA,WAAY;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,mLAAmLD,IAAK;AACxL;AACA;AACA;AACA;AACA;AACA,SAASC,WAAY;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+ED,IAAK;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmFA,IAAK;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6CA,IAAK;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
@@ -1 +1 @@
1
- {"version":3,"names":["indexFile","namePascalCase","Name","name"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function indexFile({ namePascalCase: Name, name }: ComponentContext) {\n return `import { ${Name}Aspect } from './${name}.aspect';\n\nexport type { ${Name}Main } from './${name}.main.runtime';\nexport default ${Name}Aspect;\nexport { ${Name}Aspect };\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAASA,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC;AAAuB,CAAC,EAAE;EAC1E,OAAQ,YAAWD,IAAK,oBAAmBC,IAAK;AAClD;AACA,gBAAgBD,IAAK,kBAAiBC,IAAK;AAC3C,iBAAiBD,IAAK;AACtB,WAAWA,IAAK;AAChB,CAAC;AACD"}
1
+ {"version":3,"names":["indexFile","namePascalCase","Name","name"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function indexFile({ namePascalCase: Name, name }: ComponentContext) {\n return `import { ${Name}Aspect } from './${name}.aspect';\n\nexport type { ${Name}Main } from './${name}.main.runtime';\nexport default ${Name}Aspect;\nexport { ${Name}Aspect };\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,SAAS,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC;AAAuB,CAAC,EAAE;EAC1E,OAAQ,YAAWD,IAAK,oBAAmBC,IAAK;AAClD;AACA,gBAAgBD,IAAK,kBAAiBC,IAAK;AAC3C,iBAAiBD,IAAK;AACtB,WAAWA,IAAK;AAChB,CAAC;AACD"}
@@ -1 +1 @@
1
- {"version":3,"names":["jestConfigFile"],"sources":["jest.config.ts"],"sourcesContent":["export function jestConfigFile() {\n return `\n // Override the Jest config to ignore transpiling from specific folders\n // See the base Jest config: https://bit.cloud/teambit/react/react/~code/jest/jest.config.js\n\n // const reactJestConfig = require('@teambit/react/jest/jest.config');\n // uncomment the line below and install the package if you want to use this function\n // const {\n // generateNodeModulesPattern,\n // } = require('@teambit/dependencies.modules.packages-excluder');\n // const packagesToExclude = ['@my-org', 'my-package-name'];\n\n // module.exports = {\n // ...reactJestConfig,\n // transformIgnorePatterns: [\n // '^.+\\\\.module\\\\.(css|sass|scss)$',\n // generateNodeModulesPattern({ packages: packagesToExclude }),\n // ],\n // };\n `;\n}\n"],"mappings":";;;;;;AAAO,SAASA,cAAcA,CAAA,EAAG;EAC/B,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH"}
1
+ {"version":3,"names":["jestConfigFile"],"sources":["jest.config.ts"],"sourcesContent":["export function jestConfigFile() {\n return `\n // Override the Jest config to ignore transpiling from specific folders\n // See the base Jest config: https://bit.cloud/teambit/react/react/~code/jest/jest.config.js\n\n // const reactJestConfig = require('@teambit/react/jest/jest.config');\n // uncomment the line below and install the package if you want to use this function\n // const {\n // generateNodeModulesPattern,\n // } = require('@teambit/dependencies.modules.packages-excluder');\n // const packagesToExclude = ['@my-org', 'my-package-name'];\n\n // module.exports = {\n // ...reactJestConfig,\n // transformIgnorePatterns: [\n // '^.+\\\\.module\\\\.(css|sass|scss)$',\n // generateNodeModulesPattern({ packages: packagesToExclude }),\n // ],\n // };\n `;\n}\n"],"mappings":";;;;;;AAAO,SAASA,cAAc,GAAG;EAC/B,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH"}
@@ -1 +1 @@
1
- {"version":3,"names":["mainRuntimeFile","namePascalCase","Name","name"],"sources":["main.runtime.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function mainRuntimeFile({ namePascalCase: Name, name }: ComponentContext) {\n return `import { MainRuntime } from '@teambit/cli';\nimport { NodeAspect, NodeMain } from '@teambit/node'\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport type { UseTypescriptModifiers, UseWebpackModifiers } from '@teambit/react';\nimport { ${Name}Aspect } from './${name}.aspect';\n//import {\n// previewConfigTransformer,\n// devServerConfigTransformer\n//} from './webpack/webpack-transformers';\n//import {\n// devConfigTransformer,\n// buildConfigTransformer,\n//} from \"./typescript/ts-transformer\";\n\nexport class ${Name}Main {\n static slots = [];\n\n static dependencies = [NodeAspect, EnvsAspect];\n\n static runtime = MainRuntime;\n\n static async provider([node, envs]: [NodeMain, EnvsMain]) {\n\n //const webpackModifiers: UseWebpackModifiers = {\n // previewConfig: [previewConfigTransformer],\n // devServerConfig: [devServerConfigTransformer],\n //};\n\n //const tsModifiers: UseTypescriptModifiers = {\n // devConfig: [devConfigTransformer],\n // buildConfig: [buildConfigTransformer],\n //};\n\n const ${Name}Env = node.compose([\n /**\n * Uncomment to override the config files for TypeScript, Webpack or Jest\n * Your config gets merged with the defaults\n */\n\n // node.useTypescript(tsModifiers), // note: this cannot be used in conjunction with node.overrideCompiler\n // node.useWebpack(webpackModifiers),\n // node.overrideJestConfig(require.resolve('./jest/jest.config')),\n\n /**\n * override the ESLint default config here then check your files for lint errors\n * @example\n * bit lint\n * bit lint --fix\n */\n node.useEslint({\n transformers: [\n (config) => {\n config.setRule('no-console', ['error']);\n return config;\n }\n ]\n }),\n\n /**\n * override the Prettier default config here the check your formatting\n * @example\n * bit format --check\n * bit format\n */\n node.usePrettier({\n transformers: [\n (config) => {\n config.setKey('tabWidth', 2);\n return config;\n }\n ]\n }),\n\n /**\n * override dependencies here\n * @example\n * Uncomment types to include version 17.0.3 of the types package\n */\n node.overrideDependencies({\n devDependencies: {\n // '@types/node': '16.11.7'\n }\n })\n ]);\n envs.registerEnv(${Name}Env);\n return new ${Name}Main();\n }\n}\n\n${Name}Aspect.addRuntime(${Name}Main);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,eAAeA,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC;AAAuB,CAAC,EAAE;EAChF,OAAQ;AACV;AACA;AACA;AACA,WAAWD,IAAK,oBAAmBC,IAAK;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeD,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAYA,IAAK;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuBA,IAAK;AAC5B,iBAAiBA,IAAK;AACtB;AACA;AACA;AACA,EAAEA,IAAK,qBAAoBA,IAAK;AAChC,CAAC;AACD"}
1
+ {"version":3,"names":["mainRuntimeFile","namePascalCase","Name","name"],"sources":["main.runtime.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function mainRuntimeFile({ namePascalCase: Name, name }: ComponentContext) {\n return `import { MainRuntime } from '@teambit/cli';\nimport { NodeAspect, NodeMain } from '@teambit/node'\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport type { UseTypescriptModifiers, UseWebpackModifiers } from '@teambit/react';\nimport { ${Name}Aspect } from './${name}.aspect';\n//import {\n// previewConfigTransformer,\n// devServerConfigTransformer\n//} from './webpack/webpack-transformers';\n//import {\n// devConfigTransformer,\n// buildConfigTransformer,\n//} from \"./typescript/ts-transformer\";\n\nexport class ${Name}Main {\n static slots = [];\n\n static dependencies = [NodeAspect, EnvsAspect];\n\n static runtime = MainRuntime;\n\n static async provider([node, envs]: [NodeMain, EnvsMain]) {\n\n //const webpackModifiers: UseWebpackModifiers = {\n // previewConfig: [previewConfigTransformer],\n // devServerConfig: [devServerConfigTransformer],\n //};\n\n //const tsModifiers: UseTypescriptModifiers = {\n // devConfig: [devConfigTransformer],\n // buildConfig: [buildConfigTransformer],\n //};\n\n const ${Name}Env = node.compose([\n /**\n * Uncomment to override the config files for TypeScript, Webpack or Jest\n * Your config gets merged with the defaults\n */\n\n // node.useTypescript(tsModifiers), // note: this cannot be used in conjunction with node.overrideCompiler\n // node.useWebpack(webpackModifiers),\n // node.overrideJestConfig(require.resolve('./jest/jest.config')),\n\n /**\n * override the ESLint default config here then check your files for lint errors\n * @example\n * bit lint\n * bit lint --fix\n */\n node.useEslint({\n transformers: [\n (config) => {\n config.setRule('no-console', ['error']);\n return config;\n }\n ]\n }),\n\n /**\n * override the Prettier default config here the check your formatting\n * @example\n * bit format --check\n * bit format\n */\n node.usePrettier({\n transformers: [\n (config) => {\n config.setKey('tabWidth', 2);\n return config;\n }\n ]\n }),\n\n /**\n * override dependencies here\n * @example\n * Uncomment types to include version 17.0.3 of the types package\n */\n node.overrideDependencies({\n devDependencies: {\n // '@types/node': '16.11.7'\n }\n })\n ]);\n envs.registerEnv(${Name}Env);\n return new ${Name}Main();\n }\n}\n\n${Name}Aspect.addRuntime(${Name}Main);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,eAAe,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC;AAAuB,CAAC,EAAE;EAChF,OAAQ;AACV;AACA;AACA;AACA,WAAWD,IAAK,oBAAmBC,IAAK;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeD,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAYA,IAAK;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuBA,IAAK;AAC5B,iBAAiBA,IAAK;AACtB;AACA;AACA;AACA,EAAEA,IAAK,qBAAoBA,IAAK;AAChC,CAAC;AACD"}
@@ -1 +1 @@
1
- {"version":3,"names":["previewRuntimeFile","namePascalCase","Name","nameCamelCase","nameCamel","name"],"sources":["preview.runtime.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function previewRuntimeFile({ namePascalCase: Name, nameCamelCase: nameCamel, name }: ComponentContext) {\n return `import { PreviewRuntime } from '@teambit/preview';\nimport { ReactAspect, ReactPreview } from '@teambit/react'; // the node env uses the react env's preview feature\n// uncomment the line below and install the theme if you want to use our theme or create your own and import it here\n// import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';\n\nimport { ${Name}Aspect } from './${name}.aspect';\n\nexport class ${Name}PreviewMain {\n static runtime = PreviewRuntime;\n\n static dependencies = [ReactAspect];\n\n static async provider([react]: [ReactPreview]) {\n const ${nameCamel}PreviewMain = new ${Name}PreviewMain();\n // uncomment the line below to register a new provider to wrap all compositions using this environment with a custom theme.\n // react.registerProvider([ThemeCompositions]);\n\n return ${nameCamel}PreviewMain;\n }\n}\n\n${Name}Aspect.addRuntime(${Name}PreviewMain);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,kBAAkBA,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC,aAAa,EAAEC,SAAS;EAAEC;AAAuB,CAAC,EAAE;EAC7G,OAAQ;AACV;AACA;AACA;AACA;AACA,WAAWH,IAAK,oBAAmBG,IAAK;AACxC;AACA,eAAeH,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA,YAAYE,SAAU,qBAAoBF,IAAK;AAC/C;AACA;AACA;AACA,aAAaE,SAAU;AACvB;AACA;AACA;AACA,EAAEF,IAAK,qBAAoBA,IAAK;AAChC,CAAC;AACD"}
1
+ {"version":3,"names":["previewRuntimeFile","namePascalCase","Name","nameCamelCase","nameCamel","name"],"sources":["preview.runtime.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function previewRuntimeFile({ namePascalCase: Name, nameCamelCase: nameCamel, name }: ComponentContext) {\n return `import { PreviewRuntime } from '@teambit/preview';\nimport { ReactAspect, ReactPreview } from '@teambit/react'; // the node env uses the react env's preview feature\n// uncomment the line below and install the theme if you want to use our theme or create your own and import it here\n// import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';\n\nimport { ${Name}Aspect } from './${name}.aspect';\n\nexport class ${Name}PreviewMain {\n static runtime = PreviewRuntime;\n\n static dependencies = [ReactAspect];\n\n static async provider([react]: [ReactPreview]) {\n const ${nameCamel}PreviewMain = new ${Name}PreviewMain();\n // uncomment the line below to register a new provider to wrap all compositions using this environment with a custom theme.\n // react.registerProvider([ThemeCompositions]);\n\n return ${nameCamel}PreviewMain;\n }\n}\n\n${Name}Aspect.addRuntime(${Name}PreviewMain);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,kBAAkB,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC,aAAa,EAAEC,SAAS;EAAEC;AAAuB,CAAC,EAAE;EAC7G,OAAQ;AACV;AACA;AACA;AACA;AACA,WAAWH,IAAK,oBAAmBG,IAAK;AACxC;AACA,eAAeH,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA,YAAYE,SAAU,qBAAoBF,IAAK;AAC/C;AACA;AACA;AACA,aAAaE,SAAU;AACvB;AACA;AACA;AACA,EAAEF,IAAK,qBAAoBA,IAAK;AAChC,CAAC;AACD"}
@@ -1 +1 @@
1
- {"version":3,"names":["globalStylesFile"],"sources":["styles.ts"],"sourcesContent":["export function globalStylesFile() {\n return `\n /*\n Add your global styles here to be added for any component using this env\n */\n `;\n}\n"],"mappings":";;;;;;AAAO,SAASA,gBAAgBA,CAAA,EAAG;EACjC,OAAQ;AACV;AACA;AACA;AACA,GAAG;AACH"}
1
+ {"version":3,"names":["globalStylesFile"],"sources":["styles.ts"],"sourcesContent":["export function globalStylesFile() {\n return `\n /*\n Add your global styles here to be added for any component using this env\n */\n `;\n}\n"],"mappings":";;;;;;AAAO,SAASA,gBAAgB,GAAG;EACjC,OAAQ;AACV;AACA;AACA;AACA,GAAG;AACH"}
@@ -1 +1 @@
1
- {"version":3,"names":["tsTransformerFile"],"sources":["ts-transformer.ts"],"sourcesContent":["export function tsTransformerFile() {\n return `\n import * as path from 'path';\nimport {\n TsConfigTransformer,\n TypescriptConfigMutator,\n} from \"@teambit/typescript\";\n\nconst tsConfig = require('./tsconfig.json');\n\nexport const commonTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator\n) => {\n const newConfig = config.addTypes([path.join(__dirname, 'styles.d.ts')])\n newConfig.mergeTsConfig(tsConfig);\n // Some examples of other built in mutator functions:\n //newConfig.addExclude(['someExclude']);\n //newConfig.setCompileJs(true)\n return newConfig;\n};\n\n/**\n * Transformation for the dev config only\n * @param config\n * @param context\n * @returns\n */\nexport const devConfigTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator,\n) => {\n const newConfig = commonTransformer(config, {});\n return newConfig;\n};\n\n/**\n * Transformation for the build only\n * @param config\n * @param context\n * @returns\n */\nexport const buildConfigTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator\n) => {\n const newConfig = commonTransformer(config, {});\n newConfig.mergeTsConfig(tsConfig);\n return newConfig;\n};\n\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,iBAAiBA,CAAA,EAAG;EAClC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
1
+ {"version":3,"names":["tsTransformerFile"],"sources":["ts-transformer.ts"],"sourcesContent":["export function tsTransformerFile() {\n return `\n import * as path from 'path';\nimport {\n TsConfigTransformer,\n TypescriptConfigMutator,\n} from \"@teambit/typescript\";\n\nconst tsConfig = require('./tsconfig.json');\n\nexport const commonTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator\n) => {\n const newConfig = config.addTypes([path.join(__dirname, 'styles.d.ts')])\n newConfig.mergeTsConfig(tsConfig);\n // Some examples of other built in mutator functions:\n //newConfig.addExclude(['someExclude']);\n //newConfig.setCompileJs(true)\n return newConfig;\n};\n\n/**\n * Transformation for the dev config only\n * @param config\n * @param context\n * @returns\n */\nexport const devConfigTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator,\n) => {\n const newConfig = commonTransformer(config, {});\n return newConfig;\n};\n\n/**\n * Transformation for the build only\n * @param config\n * @param context\n * @returns\n */\nexport const buildConfigTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator\n) => {\n const newConfig = commonTransformer(config, {});\n newConfig.mergeTsConfig(tsConfig);\n return newConfig;\n};\n\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,iBAAiB,GAAG;EAClC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
@@ -1 +1 @@
1
- {"version":3,"names":["typescriptConfigFile"],"sources":["typescript.config.ts"],"sourcesContent":["export function typescriptConfigFile() {\n return `{\n // add your compiler options here\n\n \"compilerOptions\": {\n // \"target\": \"es2017\",\n // \"module\": \"es2015\",\n // \"moduleResolution\": \"node\",\n // \"lib\": [\"es2017\", \"dom\"],\n // \"experimentalDecorators\": true,\n // \"esModuleInterop\": true,\n // \"outDir\": \"dist\",\n // \"sourceMap\": true,\n // \"emitDecoratorMetadata\": true,\n // \"allowJs\": true,\n // \"baseUrl\": \".\",\n // \"jsx\": \"react\"\n }\n}\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,oBAAoBA,CAAA,EAAG;EACrC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
1
+ {"version":3,"names":["typescriptConfigFile"],"sources":["typescript.config.ts"],"sourcesContent":["export function typescriptConfigFile() {\n return `{\n // add your compiler options here\n\n \"compilerOptions\": {\n // \"target\": \"es2017\",\n // \"module\": \"es2015\",\n // \"moduleResolution\": \"node\",\n // \"lib\": [\"es2017\", \"dom\"],\n // \"experimentalDecorators\": true,\n // \"esModuleInterop\": true,\n // \"outDir\": \"dist\",\n // \"sourceMap\": true,\n // \"emitDecoratorMetadata\": true,\n // \"allowJs\": true,\n // \"baseUrl\": \".\",\n // \"jsx\": \"react\"\n }\n}\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,oBAAoB,GAAG;EACrC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
@@ -1 +1 @@
1
- {"version":3,"names":["webpackConfigFile"],"sources":["webpack.config.ts"],"sourcesContent":["export function webpackConfigFile() {\n return `\n import { WebpackConfigTransformer, WebpackConfigMutator, WebpackConfigTransformContext } from '@teambit/webpack';\n\n /**\n * Transformation to apply for both preview and dev server\n * @param config\n * @param _context\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n function commonTransformation(config: WebpackConfigMutator, _context: WebpackConfigTransformContext) {\n // Merge config with the webpack.config.js file if you choose to import a module export format config.\n // config.merge([webpackConfig]);\n // config.addAliases({});\n // config.addModuleRule(youRuleHere);\n return config;\n }\n\n /**\n * Transformation for the preview only\n * @param config\n * @param context\n * @returns\n */\n export const previewConfigTransformer: WebpackConfigTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigTransformContext\n ) => {\n const newConfig = commonTransformation(config, context);\n return newConfig;\n };\n\n /**\n * Transformation for the dev server only\n * @param config\n * @param context\n * @returns\n */\n export const devServerConfigTransformer: WebpackConfigTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigTransformContext\n ) => {\n const newConfig = commonTransformation(config, context);\n return newConfig;\n };\n\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,iBAAiBA,CAAA,EAAG;EAClC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
1
+ {"version":3,"names":["webpackConfigFile"],"sources":["webpack.config.ts"],"sourcesContent":["export function webpackConfigFile() {\n return `\n import { WebpackConfigTransformer, WebpackConfigMutator, WebpackConfigTransformContext } from '@teambit/webpack';\n\n /**\n * Transformation to apply for both preview and dev server\n * @param config\n * @param _context\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n function commonTransformation(config: WebpackConfigMutator, _context: WebpackConfigTransformContext) {\n // Merge config with the webpack.config.js file if you choose to import a module export format config.\n // config.merge([webpackConfig]);\n // config.addAliases({});\n // config.addModuleRule(youRuleHere);\n return config;\n }\n\n /**\n * Transformation for the preview only\n * @param config\n * @param context\n * @returns\n */\n export const previewConfigTransformer: WebpackConfigTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigTransformContext\n ) => {\n const newConfig = commonTransformation(config, context);\n return newConfig;\n };\n\n /**\n * Transformation for the dev server only\n * @param config\n * @param context\n * @returns\n */\n export const devServerConfigTransformer: WebpackConfigTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigTransformContext\n ) => {\n const newConfig = commonTransformation(config, context);\n return newConfig;\n };\n\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,iBAAiB,GAAG;EAClC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
@@ -1 +1 @@
1
- {"version":3,"names":["_index","data","require","_doc","_main","_preview","_aspect","_webpack","_typescript","_styles","_tsTransformer","_jest","nodeEnvTemplate","name","description","generateFiles","context","relativePath","content","indexFile","isMain","docFile","mainRuntimeFile","previewRuntimeFile","aspectFile","webpackConfigFile","typescriptConfigFile","globalStylesFile","tsTransformerFile","jestConfigFile","config","env","exports"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { mainRuntimeFile } from './files/main.runtime';\nimport { previewRuntimeFile } from './files/preview.runtime';\nimport { aspectFile } from './files/aspect';\nimport { webpackConfigFile } from './files/webpack.config';\nimport { typescriptConfigFile } from './files/typescript/typescript.config';\nimport { globalStylesFile } from './files/typescript/styles';\nimport { tsTransformerFile } from './files/typescript/ts-transformer';\nimport { jestConfigFile } from './files/jest.config';\n\nexport const nodeEnvTemplate: ComponentTemplate = {\n name: 'node-env',\n description: 'customize the base Node env with your configs and tools',\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docFile(context),\n },\n {\n relativePath: `${context.name}.main.runtime.ts`,\n content: mainRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.preview.runtime.ts`,\n content: previewRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.aspect.ts`,\n content: aspectFile(context),\n },\n {\n relativePath: `webpack/webpack-transformers.ts`,\n content: webpackConfigFile(),\n },\n {\n relativePath: `typescript/tsconfig.json`,\n content: typescriptConfigFile(),\n },\n {\n relativePath: `typescript/styles.d.ts`,\n content: globalStylesFile(),\n },\n {\n relativePath: `typescript/ts-transformer.ts`,\n content: tsTransformerFile(),\n },\n {\n relativePath: `jest/jest.config.js`,\n content: jestConfigFile(),\n },\n ];\n },\n config: {\n 'teambit.envs/env': {},\n 'teambit.envs/envs': {\n env: 'teambit.envs/env',\n },\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,YAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,WAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,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EACD;MACET,YAAY,EAAG,wBAAuB;MACtCC,OAAO,EAAE,IAAAS,0BAAgB,EAAC;IAC5B,CAAC,EACD;MACEV,YAAY,EAAG,8BAA6B;MAC5CC,OAAO,EAAE,IAAAU,kCAAiB,EAAC;IAC7B,CAAC,EACD;MACEX,YAAY,EAAG,qBAAoB;MACnCC,OAAO,EAAE,IAAAW,sBAAc,EAAC;IAC1B,CAAC,CACF;EACH,CAAC;EACDC,MAAM,EAAE;IACN,kBAAkB,EAAE,CAAC,CAAC;IACtB,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAACC,OAAA,CAAApB,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"names":["nodeEnvTemplate","name","description","generateFiles","context","relativePath","content","indexFile","isMain","docFile","mainRuntimeFile","previewRuntimeFile","aspectFile","webpackConfigFile","typescriptConfigFile","globalStylesFile","tsTransformerFile","jestConfigFile","config","env"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { mainRuntimeFile } from './files/main.runtime';\nimport { previewRuntimeFile } from './files/preview.runtime';\nimport { aspectFile } from './files/aspect';\nimport { webpackConfigFile } from './files/webpack.config';\nimport { typescriptConfigFile } from './files/typescript/typescript.config';\nimport { globalStylesFile } from './files/typescript/styles';\nimport { tsTransformerFile } from './files/typescript/ts-transformer';\nimport { jestConfigFile } from './files/jest.config';\n\nexport const nodeEnvTemplate: ComponentTemplate = {\n name: 'node-env',\n description: 'customize the base Node env with your configs and tools',\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docFile(context),\n },\n {\n relativePath: `${context.name}.main.runtime.ts`,\n content: mainRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.preview.runtime.ts`,\n content: previewRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.aspect.ts`,\n content: aspectFile(context),\n },\n {\n relativePath: `webpack/webpack-transformers.ts`,\n content: webpackConfigFile(),\n },\n {\n relativePath: `typescript/tsconfig.json`,\n content: typescriptConfigFile(),\n },\n {\n relativePath: `typescript/styles.d.ts`,\n content: globalStylesFile(),\n },\n {\n relativePath: `typescript/ts-transformer.ts`,\n content: tsTransformerFile(),\n },\n {\n relativePath: `jest/jest.config.js`,\n content: jestConfigFile(),\n },\n ];\n },\n config: {\n 'teambit.envs/env': {},\n 'teambit.envs/envs': {\n env: 'teambit.envs/env',\n },\n },\n};\n"],"mappings":";;;;;;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;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,eAAkC,GAAG;EAChDC,IAAI,EAAE,UAAU;EAChBC,WAAW,EAAE,yDAAyD;EACtEC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,OAAO,CACL;MACEC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAE,IAAAC,kBAAS,EAACH,OAAO,CAAC;MAC3BI,MAAM,EAAE;IACV,CAAC,EACD;MACEH,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,WAAU;MACxCK,OAAO,EAAE,IAAAG,cAAO,EAACL,OAAO;IAC1B,CAAC,EACD;MACEC,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,kBAAiB;MAC/CK,OAAO,EAAE,IAAAI,uBAAe,EA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