@teambit/node 0.0.881 → 0.0.882

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/artifacts/env-template/public/{238.c1f9da1cb2656218c1b2.js → 700.1acd4584914cac5d9064.js} +15 -15
  2. package/artifacts/env-template/public/assets-manifest.json +16 -16
  3. package/artifacts/env-template/public/{compositions.7800ffeb4c0c2a49a47b.js → compositions.f585ccb459e93e7ed228.js} +1 -1
  4. package/artifacts/env-template/public/compositions.html +1 -1
  5. package/artifacts/env-template/public/{overview.12a1a78394c3da5ea9d7.js → overview.b1cfdc5c24036d810af2.js} +1 -1
  6. package/artifacts/env-template/public/overview.html +1 -1
  7. package/artifacts/env-template/public/{peers.f040709ae6d35f0c2308.js → peers.5dff83ab024225e2a9b6.js} +0 -0
  8. package/artifacts/env-template/public/{preview-root.72df8802c9e617f63a64.js → preview-root.eebdddc2e40f752a9312.js} +1 -1
  9. package/artifacts/env-template/public/static/css/700.bd8655a5.css +1 -0
  10. package/artifacts/env-template/public/static/css/compositions.e163efe5.css +1 -0
  11. package/artifacts/env-template/public/static/css/{overview.367aeb5b.css → overview.18adf1ee.css} +1 -1
  12. package/artifacts/preview/teambit_harmony_node-preview.js +1 -1
  13. package/{compositions-1666409808293.js → compositions-1666496165706.js} +0 -0
  14. package/dist/index.js +0 -3
  15. package/dist/index.js.map +1 -1
  16. package/dist/jest/index.js +0 -4
  17. package/dist/jest/index.js.map +1 -1
  18. package/dist/jest/jest.config.js +0 -8
  19. package/dist/jest/jest.config.js.map +1 -1
  20. package/dist/node.app-type.js +0 -7
  21. package/dist/node.app-type.js.map +1 -1
  22. package/dist/node.application.js +0 -23
  23. package/dist/node.application.js.map +1 -1
  24. package/dist/node.aspect.js +0 -5
  25. package/dist/node.aspect.js.map +1 -1
  26. package/dist/node.composition.js +0 -6
  27. package/dist/node.composition.js.map +1 -1
  28. package/dist/node.env.js +2 -21
  29. package/dist/node.env.js.map +1 -1
  30. package/dist/node.main.runtime.js +2 -65
  31. package/dist/node.main.runtime.js.map +1 -1
  32. package/dist/node.ui.runtime.js +4 -32
  33. package/dist/node.ui.runtime.js.map +1 -1
  34. package/dist/templates/express-app/files/app-root.js +0 -1
  35. package/dist/templates/express-app/files/app-root.js.map +1 -1
  36. package/dist/templates/express-app/files/composition.js +0 -1
  37. package/dist/templates/express-app/files/composition.js.map +1 -1
  38. package/dist/templates/express-app/files/doc.js +0 -1
  39. package/dist/templates/express-app/files/doc.js.map +1 -1
  40. package/dist/templates/express-app/files/get-port.js +0 -1
  41. package/dist/templates/express-app/files/get-port.js.map +1 -1
  42. package/dist/templates/express-app/files/index.js +0 -1
  43. package/dist/templates/express-app/files/index.js.map +1 -1
  44. package/dist/templates/express-app/files/mock-route.js +0 -1
  45. package/dist/templates/express-app/files/mock-route.js.map +1 -1
  46. package/dist/templates/express-app/files/node-app.js +0 -1
  47. package/dist/templates/express-app/files/node-app.js.map +1 -1
  48. package/dist/templates/express-app/files/route.js +0 -1
  49. package/dist/templates/express-app/files/route.js.map +1 -1
  50. package/dist/templates/express-app/files/test.js +0 -1
  51. package/dist/templates/express-app/files/test.js.map +1 -1
  52. package/dist/templates/express-app/index.js +4 -23
  53. package/dist/templates/express-app/index.js.map +1 -1
  54. package/dist/templates/express-route/files/composition.js +0 -1
  55. package/dist/templates/express-route/files/composition.js.map +1 -1
  56. package/dist/templates/express-route/files/doc.js +0 -1
  57. package/dist/templates/express-route/files/doc.js.map +1 -1
  58. package/dist/templates/express-route/files/index.js +0 -1
  59. package/dist/templates/express-route/files/index.js.map +1 -1
  60. package/dist/templates/express-route/files/main.js +0 -1
  61. package/dist/templates/express-route/files/main.js.map +1 -1
  62. package/dist/templates/express-route/files/test.js +0 -1
  63. package/dist/templates/express-route/files/test.js.map +1 -1
  64. package/dist/templates/express-route/index.js +4 -11
  65. package/dist/templates/express-route/index.js.map +1 -1
  66. package/dist/templates/node/files/composition.js +0 -1
  67. package/dist/templates/node/files/composition.js.map +1 -1
  68. package/dist/templates/node/files/doc.js +0 -1
  69. package/dist/templates/node/files/doc.js.map +1 -1
  70. package/dist/templates/node/files/index.js +0 -1
  71. package/dist/templates/node/files/index.js.map +1 -1
  72. package/dist/templates/node/files/main.js +0 -1
  73. package/dist/templates/node/files/main.js.map +1 -1
  74. package/dist/templates/node/files/test.js +0 -1
  75. package/dist/templates/node/files/test.js.map +1 -1
  76. package/dist/templates/node/index.js +0 -16
  77. package/dist/templates/node/index.js.map +1 -1
  78. package/dist/templates/node-env/files/aspect.js +0 -1
  79. package/dist/templates/node-env/files/aspect.js.map +1 -1
  80. package/dist/templates/node-env/files/doc.js +0 -1
  81. package/dist/templates/node-env/files/doc.js.map +1 -1
  82. package/dist/templates/node-env/files/index.js +0 -1
  83. package/dist/templates/node-env/files/index.js.map +1 -1
  84. package/dist/templates/node-env/files/jest.config.js +0 -1
  85. package/dist/templates/node-env/files/jest.config.js.map +1 -1
  86. package/dist/templates/node-env/files/main.runtime.js +0 -1
  87. package/dist/templates/node-env/files/main.runtime.js.map +1 -1
  88. package/dist/templates/node-env/files/preview.runtime.js +0 -1
  89. package/dist/templates/node-env/files/preview.runtime.js.map +1 -1
  90. package/dist/templates/node-env/files/typescript/styles.js +0 -1
  91. package/dist/templates/node-env/files/typescript/styles.js.map +1 -1
  92. package/dist/templates/node-env/files/typescript/ts-transformer.js +0 -1
  93. package/dist/templates/node-env/files/typescript/ts-transformer.js.map +1 -1
  94. package/dist/templates/node-env/files/typescript/typescript.config.js +0 -1
  95. package/dist/templates/node-env/files/typescript/typescript.config.js.map +1 -1
  96. package/dist/templates/node-env/files/webpack.config.js +0 -1
  97. package/dist/templates/node-env/files/webpack.config.js.map +1 -1
  98. package/dist/templates/node-env/index.js +0 -31
  99. package/dist/templates/node-env/index.js.map +1 -1
  100. package/{overview-1666409808293.js → overview-1666496165706.js} +0 -0
  101. package/package-tar/teambit-node-0.0.882.tgz +0 -0
  102. package/package.json +14 -14
  103. package/{preview-1666409808293.js → preview-1666496165706.js} +2 -2
  104. package/artifacts/env-template/public/static/css/238.a0238c25.css +0 -1
  105. package/artifacts/env-template/public/static/css/compositions.6d8c7702.css +0 -1
  106. package/package-tar/teambit-node-0.0.881.tgz +0 -0
@@ -4,87 +4,68 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.expressAppTemplate = void 0;
7
-
8
7
  function _index() {
9
8
  const data = require("./files/index");
10
-
11
9
  _index = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  function _doc() {
19
15
  const data = require("./files/doc");
20
-
21
16
  _doc = function () {
22
17
  return data;
23
18
  };
24
-
25
19
  return data;
26
20
  }
27
-
28
21
  function _appRoot() {
29
22
  const data = require("./files/app-root");
30
-
31
23
  _appRoot = function () {
32
24
  return data;
33
25
  };
34
-
35
26
  return data;
36
27
  }
37
-
38
28
  function _nodeApp() {
39
29
  const data = require("./files/node-app");
40
-
41
30
  _nodeApp = function () {
42
31
  return data;
43
32
  };
44
-
45
33
  return data;
46
34
  }
47
-
48
35
  function _getPort() {
49
36
  const data = require("./files/get-port");
50
-
51
37
  _getPort = function () {
52
38
  return data;
53
39
  };
54
-
55
40
  return data;
56
41
  }
57
-
58
42
  function _mockRoute() {
59
43
  const data = require("./files/mock-route");
60
-
61
44
  _mockRoute = function () {
62
45
  return data;
63
46
  };
64
-
65
47
  return data;
66
48
  }
67
-
68
49
  function _route() {
69
50
  const data = require("./files/route");
70
-
71
51
  _route = function () {
72
52
  return data;
73
53
  };
74
-
75
54
  return data;
76
55
  }
77
-
78
56
  // import { testFile } from './files/test';
79
57
  // import { compositionFile } from './files/composition';
58
+
80
59
  const expressAppTemplate = {
81
60
  name: 'express-app',
82
61
  description: 'a bit express application',
83
62
  generateFiles: context => {
84
- return [(0, _index().indexFile)(context), (0, _doc().docFile)(context), (0, _appRoot().appRoot)(context), (0, _nodeApp().nodeApp)(context), (0, _getPort().getPort)(), (0, _mockRoute().mockRoute)(), (0, _route().route)() // compositionFile(context),
63
+ return [(0, _index().indexFile)(context), (0, _doc().docFile)(context), (0, _appRoot().appRoot)(context), (0, _nodeApp().nodeApp)(context), (0, _getPort().getPort)(), (0, _mockRoute().mockRoute)(), (0, _route().route)()
64
+ // compositionFile(context),
85
65
  // testFile(context),
86
66
  ];
87
67
  },
68
+
88
69
  config: {
89
70
  'teambit.harmony/aspect': {},
90
71
  'teambit.envs/envs': {
@@ -1 +1 @@
1
- {"version":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,aAD6C;EAEnDC,WAAW,EAAE,2BAFsC;EAGnDC,aAAa,EAAGC,OAAD,IAA+B;IAC5C,OAAO,CACL,IAAAC,kBAAA,EAAUD,OAAV,CADK,EAEL,IAAAE,cAAA,EAAQF,OAAR,CAFK,EAGL,IAAAG,kBAAA,EAAQH,OAAR,CAHK,EAIL,IAAAI,kBAAA,EAAQJ,OAAR,CAJK,EAKL,IAAAK,kBAAA,GALK,EAML,IAAAC,sBAAA,GANK,EAOL,IAAAC,cAAA,GAPK,CAQL;IACA;IATK,CAAP;EAWD,CAfkD;EAgBnDC,MAAM,EAAE;IACN,0BAA0B,EADpB;IAEN,qBAAqB;MACnBC,GAAG,EAAE;IADc;EAFf;AAhB2C,CAA9C"}
1
+ {"version":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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.compositionFile = compositionFile;
7
-
8
7
  function compositionFile(context) {
9
8
  return {
10
9
  relativePath: `${context.name}.composition.tsx`,
@@ -1 +1 @@
1
- {"version":3,"names":["compositionFile","context","relativePath","name","content","nameCamelCase"],"sources":["composition.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function compositionFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.composition.tsx`,\n content: `import React from 'react';\nimport { ${context.nameCamelCase} } from './${context.name}';\n\nexport function ReturnsCorrectValue() {\n return <div>{${context.nameCamelCase}()}</div>;\n}\n`,\n };\n}\n"],"mappings":";;;;;;;AAEO,SAASA,eAAT,CAAyBC,OAAzB,EAAoD;EACzD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,kBADzB;IAELC,OAAO,EAAG;AACd,WAAWH,OAAO,CAACI,aAAc,cAAaJ,OAAO,CAACE,IAAK;AAC3D;AACA;AACA,iBAAiBF,OAAO,CAACI,aAAc;AACvC;AACA;EARS,CAAP;AAUD"}
1
+ {"version":3,"names":["compositionFile","context","relativePath","name","content","nameCamelCase"],"sources":["composition.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function compositionFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.composition.tsx`,\n content: `import React from 'react';\nimport { ${context.nameCamelCase} } from './${context.name}';\n\nexport function ReturnsCorrectValue() {\n return <div>{${context.nameCamelCase}()}</div>;\n}\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,eAAe,CAACC,OAAyB,EAAE;EACzD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,kBAAiB;IAC/CC,OAAO,EAAG;AACd,WAAWH,OAAO,CAACI,aAAc,cAAaJ,OAAO,CAACE,IAAK;AAC3D;AACA;AACA,iBAAiBF,OAAO,CAACI,aAAc;AACvC;AACA;EACE,CAAC;AACH"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.docFile = docFile;
7
-
8
7
  function docFile(context) {
9
8
  return {
10
9
  relativePath: `${context.name}.docs.mdx`,
@@ -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,OAAT,CAAiBC,OAAjB,EAA4C;EACjD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,WADzB;IAELC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcH,OAAO,CAACI,cAAe;AACrC;AACA;EAZS,CAAP;AAcD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.indexFile = indexFile;
7
-
8
7
  function indexFile(context) {
9
8
  return {
10
9
  relativePath: 'index.ts',
@@ -1 +1 @@
1
- {"version":3,"names":["indexFile","context","relativePath","content","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,SAAT,CAAmBC,OAAnB,EAA8C;EACnD,OAAO;IACLC,YAAY,EAAE,UADT;IAELC,OAAO,EAAG,eAAcF,OAAO,CAACG,cAAe,mBAAkBH,OAAO,CAACI,IAAK;AAClF,CAHS;IAILC,MAAM,EAAE;EAJH,CAAP;AAMD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.mainFile = mainFile;
7
-
8
7
  function mainFile(context) {
9
8
  return {
10
9
  relativePath: `${context.name}.ts`,
@@ -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,QAAT,CAAkBC,OAAlB,EAA6C;EAClD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,KADzB;IAELC,OAAO,EAAG,sBAAqBH,OAAO,CAACI,cAAe;AAC1D;AACA;AACA,eAAeJ,OAAO,CAACE,IAAK;AAC5B,kDAAkDF,OAAO,CAACE,IAAK;AAC/D;AACA;AACA;EATS,CAAP;AAWD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.testFile = testFile;
7
-
8
7
  function testFile(context) {
9
8
  return {
10
9
  relativePath: `${context.name}.spec.ts`,
@@ -1 +1 @@
1
- {"version":3,"names":["testFile","context","relativePath","name","content","nameCamelCase"],"sources":["test.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function testFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.spec.ts`,\n content: `import { ${context.nameCamelCase} } from './${context.name}';\n\nit('should return the correct value', () => {\n expect(${context.nameCamelCase}()).toBe('Hello world!');\n});\n`,\n };\n}\n"],"mappings":";;;;;;;AAEO,SAASA,QAAT,CAAkBC,OAAlB,EAA6C;EAClD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,UADzB;IAELC,OAAO,EAAG,YAAWH,OAAO,CAACI,aAAc,cAAaJ,OAAO,CAACE,IAAK;AACzE;AACA;AACA,WAAWF,OAAO,CAACI,aAAc;AACjC;AACA;EAPS,CAAP;AASD"}
1
+ {"version":3,"names":["testFile","context","relativePath","name","content","nameCamelCase"],"sources":["test.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function testFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.spec.ts`,\n content: `import { ${context.nameCamelCase} } from './${context.name}';\n\nit('should return the correct value', () => {\n expect(${context.nameCamelCase}()).toBe('Hello world!');\n});\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,QAAQ,CAACC,OAAyB,EAAE;EAClD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,UAAS;IACvCC,OAAO,EAAG,YAAWH,OAAO,CAACI,aAAc,cAAaJ,OAAO,CAACE,IAAK;AACzE;AACA;AACA,WAAWF,OAAO,CAACI,aAAc;AACjC;AACA;EACE,CAAC;AACH"}
@@ -4,47 +4,40 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.expressRouteTemplate = void 0;
7
-
8
7
  function _index() {
9
8
  const data = require("./files/index");
10
-
11
9
  _index = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  function _doc() {
19
15
  const data = require("./files/doc");
20
-
21
16
  _doc = function () {
22
17
  return data;
23
18
  };
24
-
25
19
  return data;
26
20
  }
27
-
28
21
  function _main() {
29
22
  const data = require("./files/main");
30
-
31
23
  _main = function () {
32
24
  return data;
33
25
  };
34
-
35
26
  return data;
36
27
  }
37
-
38
28
  // import { testFile } from './files/test';
39
29
  // import { compositionFile } from './files/composition';
30
+
40
31
  const expressRouteTemplate = {
41
32
  name: 'express-route',
42
33
  description: 'an express route',
43
34
  generateFiles: context => {
44
- return [(0, _index().indexFile)(context), (0, _doc().docFile)(context), (0, _main().mainFile)(context) // compositionFile(context),
35
+ return [(0, _index().indexFile)(context), (0, _doc().docFile)(context), (0, _main().mainFile)(context)
36
+ // compositionFile(context),
45
37
  // testFile(context)
46
38
  ];
47
39
  },
40
+
48
41
  config: {
49
42
  'teambit.harmony/node': {},
50
43
  'teambit.envs/envs': {
@@ -1 +1 @@
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,eAD+C;EAErDC,WAAW,EAAE,kBAFwC;EAGrDC,aAAa,EAAGC,OAAD,IAA+B;IAC5C,OAAO,CACL,IAAAC,kBAAA,EAAUD,OAAV,CADK,EAEL,IAAAE,cAAA,EAAQF,OAAR,CAFK,EAGL,IAAAG,gBAAA,EAASH,OAAT,CAHK,CAIL;IACA;IALK,CAAP;EAOD,CAXoD;EAYrDI,MAAM,EAAE;IACN,wBAAwB,EADlB;IAEN,qBAAqB;MACnBC,GAAG,EAAE;IADc;EAFf;AAZ6C,CAAhD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.compositionFile = compositionFile;
7
-
8
7
  function compositionFile(context) {
9
8
  return {
10
9
  relativePath: `${context.name}.composition.tsx`,
@@ -1 +1 @@
1
- {"version":3,"names":["compositionFile","context","relativePath","name","content","nameCamelCase"],"sources":["composition.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function compositionFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.composition.tsx`,\n content: `import React from 'react';\nimport { ${context.nameCamelCase} } from './${context.name}';\n\nexport function ReturnsCorrectValue() {\n return <div>{${context.nameCamelCase}()}</div>;\n}\n`,\n };\n}\n"],"mappings":";;;;;;;AAEO,SAASA,eAAT,CAAyBC,OAAzB,EAAoD;EACzD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,kBADzB;IAELC,OAAO,EAAG;AACd,WAAWH,OAAO,CAACI,aAAc,cAAaJ,OAAO,CAACE,IAAK;AAC3D;AACA;AACA,iBAAiBF,OAAO,CAACI,aAAc;AACvC;AACA;EARS,CAAP;AAUD"}
1
+ {"version":3,"names":["compositionFile","context","relativePath","name","content","nameCamelCase"],"sources":["composition.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function compositionFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.composition.tsx`,\n content: `import React from 'react';\nimport { ${context.nameCamelCase} } from './${context.name}';\n\nexport function ReturnsCorrectValue() {\n return <div>{${context.nameCamelCase}()}</div>;\n}\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,eAAe,CAACC,OAAyB,EAAE;EACzD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,kBAAiB;IAC/CC,OAAO,EAAG;AACd,WAAWH,OAAO,CAACI,aAAc,cAAaJ,OAAO,CAACE,IAAK;AAC3D;AACA;AACA,iBAAiBF,OAAO,CAACI,aAAc;AACvC;AACA;EACE,CAAC;AACH"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.docFile = docFile;
7
-
8
7
  function docFile(context) {
9
8
  return {
10
9
  relativePath: `${context.name}.docs.mdx`,
@@ -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,OAAT,CAAiBC,OAAjB,EAA4C;EACjD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,WADzB;IAELC,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAWH,OAAO,CAACI,aAAc;AACjC;AACA;EAZS,CAAP;AAcD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.indexFile = indexFile;
7
-
8
7
  function indexFile(context) {
9
8
  return {
10
9
  relativePath: 'index.ts',
@@ -1 +1 @@
1
- {"version":3,"names":["indexFile","context","relativePath","content","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,SAAT,CAAmBC,OAAnB,EAA8C;EACnD,OAAO;IACLC,YAAY,EAAE,UADT;IAELC,OAAO,EAAG,YAAWF,OAAO,CAACG,aAAc,cAAaH,OAAO,CAACI,IAAK;AACzE,CAHS;IAILC,MAAM,EAAE;EAJH,CAAP;AAMD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.mainFile = mainFile;
7
-
8
7
  function mainFile(context) {
9
8
  return {
10
9
  relativePath: `${context.name}.ts`,
@@ -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,QAAT,CAAkBC,OAAlB,EAA6C;EAClD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,KADzB;IAELC,OAAO,EAAG,mBAAkBH,OAAO,CAACI,aAAc;AACtD;AACA;AACA;EALS,CAAP;AAOD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.testFile = testFile;
7
-
8
7
  function testFile(context) {
9
8
  return {
10
9
  relativePath: `${context.name}.spec.ts`,
@@ -1 +1 @@
1
- {"version":3,"names":["testFile","context","relativePath","name","content","nameCamelCase"],"sources":["test.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function testFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.spec.ts`,\n content: `import { ${context.nameCamelCase} } from './${context.name}';\n\nit('should return the correct value', () => {\n expect(${context.nameCamelCase}()).toBe('Hello world!');\n});\n`,\n };\n}\n"],"mappings":";;;;;;;AAEO,SAASA,QAAT,CAAkBC,OAAlB,EAA6C;EAClD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,UADzB;IAELC,OAAO,EAAG,YAAWH,OAAO,CAACI,aAAc,cAAaJ,OAAO,CAACE,IAAK;AACzE;AACA;AACA,WAAWF,OAAO,CAACI,aAAc;AACjC;AACA;EAPS,CAAP;AASD"}
1
+ {"version":3,"names":["testFile","context","relativePath","name","content","nameCamelCase"],"sources":["test.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function testFile(context: ComponentContext) {\n return {\n relativePath: `${context.name}.spec.ts`,\n content: `import { ${context.nameCamelCase} } from './${context.name}';\n\nit('should return the correct value', () => {\n expect(${context.nameCamelCase}()).toBe('Hello world!');\n});\n`,\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,QAAQ,CAACC,OAAyB,EAAE;EAClD,OAAO;IACLC,YAAY,EAAG,GAAED,OAAO,CAACE,IAAK,UAAS;IACvCC,OAAO,EAAG,YAAWH,OAAO,CAACI,aAAc,cAAaJ,OAAO,CAACE,IAAK;AACzE;AACA;AACA,WAAWF,OAAO,CAACI,aAAc;AACjC;AACA;EACE,CAAC;AACH"}
@@ -4,57 +4,41 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.nodeTemplate = void 0;
7
-
8
7
  function _index() {
9
8
  const data = require("./files/index");
10
-
11
9
  _index = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  function _doc() {
19
15
  const data = require("./files/doc");
20
-
21
16
  _doc = function () {
22
17
  return data;
23
18
  };
24
-
25
19
  return data;
26
20
  }
27
-
28
21
  function _main() {
29
22
  const data = require("./files/main");
30
-
31
23
  _main = function () {
32
24
  return data;
33
25
  };
34
-
35
26
  return data;
36
27
  }
37
-
38
28
  function _test() {
39
29
  const data = require("./files/test");
40
-
41
30
  _test = function () {
42
31
  return data;
43
32
  };
44
-
45
33
  return data;
46
34
  }
47
-
48
35
  function _composition() {
49
36
  const data = require("./files/composition");
50
-
51
37
  _composition = function () {
52
38
  return data;
53
39
  };
54
-
55
40
  return data;
56
41
  }
57
-
58
42
  const nodeTemplate = {
59
43
  name: 'node',
60
44
  description: 'a Node.js module',
@@ -1 +1 @@
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,MADuC;EAE7CC,WAAW,EAAE,kBAFgC;EAG7CC,aAAa,EAAGC,OAAD,IAA+B;IAC5C,OAAO,CAAC,IAAAC,kBAAA,EAAUD,OAAV,CAAD,EAAqB,IAAAE,cAAA,EAAQF,OAAR,CAArB,EAAuC,IAAAG,gBAAA,EAASH,OAAT,CAAvC,EAA0D,IAAAI,8BAAA,EAAgBJ,OAAhB,CAA1D,EAAoF,IAAAK,gBAAA,EAASL,OAAT,CAApF,CAAP;EACD,CAL4C;EAM7CM,MAAM,EAAE;IACN,wBAAwB,EADlB;IAEN,qBAAqB;MACnBC,GAAG,EAAE;IADc;EAFf;AANqC,CAAxC"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.aspectFile = aspectFile;
7
-
8
7
  function aspectFile({
9
8
  namePascalCase: Name,
10
9
  componentId
@@ -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,UAAT,CAAoB;EAAEC,cAAc,EAAEC,IAAlB;EAAwBC;AAAxB,CAApB,EAA6E;EAClF,OAAQ;AACV;AACA,eAAeD,IAAK;AACpB,SAASC,WAAY;AACrB;AACA,CALE;AAMD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.docFile = docFile;
7
-
8
7
  function docFile({
9
8
  name,
10
9
  componentId
@@ -1 +1 @@
1
- {"version":3,"names":["docFile","name","componentId"],"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,OAAT,CAAiB;EAAEC,IAAF;EAAQC;AAAR,CAAjB,EAA0D;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,CA7KE;AA8KD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.indexFile = indexFile;
7
-
8
7
  function indexFile({
9
8
  namePascalCase: Name,
10
9
  name
@@ -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,SAAT,CAAmB;EAAEC,cAAc,EAAEC,IAAlB;EAAwBC;AAAxB,CAAnB,EAAqE;EAC1E,OAAQ,YAAWD,IAAK,oBAAmBC,IAAK;AAClD;AACA,gBAAgBD,IAAK,kBAAiBC,IAAK;AAC3C,iBAAiBD,IAAK;AACtB,WAAWA,IAAK;AAChB,CALE;AAMD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.jestConfigFile = jestConfigFile;
7
-
8
7
  function jestConfigFile() {
9
8
  return `
10
9
  // Override the Jest config to ignore transpiling from specific folders
@@ -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,cAAT,GAA0B;EAC/B,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAlBE;AAmBD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.mainRuntimeFile = mainRuntimeFile;
7
-
8
7
  function mainRuntimeFile({
9
8
  namePascalCase: Name,
10
9
  name
@@ -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,eAAT,CAAyB;EAAEC,cAAc,EAAEC,IAAlB;EAAwBC;AAAxB,CAAzB,EAA2E;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,CA1FE;AA2FD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.previewRuntimeFile = previewRuntimeFile;
7
-
8
7
  function previewRuntimeFile({
9
8
  namePascalCase: Name,
10
9
  nameCamelCase: nameCamel,
@@ -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,kBAAT,CAA4B;EAAEC,cAAc,EAAEC,IAAlB;EAAwBC,aAAa,EAAEC,SAAvC;EAAkDC;AAAlD,CAA5B,EAAwG;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,CAtBE;AAuBD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.globalStylesFile = globalStylesFile;
7
-
8
7
  function globalStylesFile() {
9
8
  return `
10
9
  /*
@@ -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,gBAAT,GAA4B;EACjC,OAAQ;AACV;AACA;AACA;AACA,GAJE;AAKD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.tsTransformerFile = tsTransformerFile;
7
-
8
7
  function tsTransformerFile() {
9
8
  return `
10
9
  import * as path from 'path';
@@ -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,iBAAT,GAA6B;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,CA/CE;AAgDD"}
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"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.typescriptConfigFile = typescriptConfigFile;
7
-
8
7
  function typescriptConfigFile() {
9
8
  return `{
10
9
  // add your compiler options here