@teambit/node 0.0.705 → 0.0.708

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 (65) hide show
  1. package/artifacts/env-template/public/162.js +3 -3
  2. package/artifacts/env-template/public/{293.js → 409.js} +4 -4
  3. package/artifacts/env-template/public/793.js +15 -15
  4. package/artifacts/env-template/public/assets-manifest.json +8 -8
  5. package/artifacts/env-template/public/compositions.8959789ca47081999359.js +1 -0
  6. package/artifacts/env-template/public/compositions.html +1 -1
  7. package/artifacts/env-template/public/overview.4a936a7079ceb467c326.js +5 -0
  8. package/artifacts/env-template/public/overview.html +1 -1
  9. package/artifacts/env-template/public/{preview-root.7fa4ffe4af7efa108b9b.js → preview-root.c553137fdb9c4727d022.js} +1 -1
  10. package/artifacts/env-template/public/service-worker.js +1 -1
  11. package/artifacts/preview/teambit_harmony_node-preview.js +2 -2
  12. package/{compositions-1649474602488.js → compositions-1649820303295.js} +0 -0
  13. package/dist/templates/node-env/files/aspect.d.ts +2 -0
  14. package/dist/templates/node-env/files/aspect.js +20 -0
  15. package/dist/templates/node-env/files/aspect.js.map +1 -0
  16. package/dist/templates/node-env/files/doc.d.ts +2 -1
  17. package/dist/templates/node-env/files/doc.js +173 -5
  18. package/dist/templates/node-env/files/doc.js.map +1 -1
  19. package/dist/templates/node-env/files/index.js +5 -3
  20. package/dist/templates/node-env/files/index.js.map +1 -1
  21. package/dist/templates/node-env/files/jest.config.d.ts +1 -0
  22. package/dist/templates/node-env/files/jest.config.js +30 -0
  23. package/dist/templates/node-env/files/jest.config.js.map +1 -0
  24. package/dist/templates/node-env/files/main.runtime.d.ts +2 -0
  25. package/dist/templates/node-env/files/main.runtime.js +103 -0
  26. package/dist/templates/node-env/files/main.runtime.js.map +1 -0
  27. package/dist/templates/node-env/files/preview.runtime.d.ts +2 -0
  28. package/dist/templates/node-env/files/preview.runtime.js +38 -0
  29. package/dist/templates/node-env/files/preview.runtime.js.map +1 -0
  30. package/dist/templates/node-env/files/typescript/styles.d.ts +1 -0
  31. package/dist/templates/node-env/files/typescript/styles.js +16 -0
  32. package/dist/templates/node-env/files/typescript/styles.js.map +1 -0
  33. package/dist/templates/node-env/files/typescript/ts-transformer.d.ts +1 -0
  34. package/dist/templates/node-env/files/typescript/ts-transformer.js +59 -0
  35. package/dist/templates/node-env/files/typescript/ts-transformer.js.map +1 -0
  36. package/dist/templates/node-env/files/typescript/typescript.config.d.ts +1 -0
  37. package/dist/templates/node-env/files/typescript/typescript.config.js +30 -0
  38. package/dist/templates/node-env/files/typescript/typescript.config.js.map +1 -0
  39. package/dist/templates/node-env/files/webpack.config.d.ts +1 -0
  40. package/dist/templates/node-env/files/webpack.config.js +57 -0
  41. package/dist/templates/node-env/files/webpack.config.js.map +1 -0
  42. package/dist/templates/node-env/index.js +99 -8
  43. package/dist/templates/node-env/index.js.map +1 -1
  44. package/{overview-1649474602488.js → overview-1649820303295.js} +0 -0
  45. package/package-tar/teambit-node-0.0.708.tgz +0 -0
  46. package/package.json +17 -17
  47. package/{preview-1649474602488.js → preview-1649820303295.js} +2 -2
  48. package/templates/node-env/files/aspect.ts +10 -0
  49. package/templates/node-env/files/doc.ts +172 -5
  50. package/templates/node-env/files/index.ts +5 -3
  51. package/templates/node-env/files/jest.config.ts +21 -0
  52. package/templates/node-env/files/main.runtime.ts +93 -0
  53. package/templates/node-env/files/preview.runtime.ts +27 -0
  54. package/templates/node-env/files/typescript/styles.ts +7 -0
  55. package/templates/node-env/files/typescript/ts-transformer.ts +50 -0
  56. package/templates/node-env/files/typescript/typescript.config.ts +21 -0
  57. package/templates/node-env/files/webpack.config.ts +48 -0
  58. package/templates/node-env/index.ts +41 -6
  59. package/artifacts/env-template/public/compositions.5f9059d1d4743e891c86.js +0 -1
  60. package/artifacts/env-template/public/overview.a568cd5fd4ec0772b58c.js +0 -5
  61. package/dist/templates/node-env/files/extension.d.ts +0 -2
  62. package/dist/templates/node-env/files/extension.js +0 -34
  63. package/dist/templates/node-env/files/extension.js.map +0 -1
  64. package/package-tar/teambit-node-0.0.705.tgz +0 -0
  65. package/templates/node-env/files/extension.ts +0 -25
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.mainRuntimeFile = mainRuntimeFile;
7
+
8
+ function mainRuntimeFile({
9
+ namePascalCase: Name,
10
+ name
11
+ }) {
12
+ return `import { MainRuntime } from '@teambit/cli';
13
+ import { NodeAspect, NodeMain } from '@teambit/node'
14
+ import { EnvsAspect, EnvsMain } from '@teambit/envs';
15
+ import { ${Name}Aspect } from './${name}.aspect';
16
+ //import {
17
+ // previewConfigTransformer,
18
+ // devServerConfigTransformer
19
+ //} from './webpack/webpack-transformers';
20
+ //import {
21
+ // devConfigTransformer,
22
+ // buildConfigTransformer,
23
+ //} from "./typescript/ts-transformers";
24
+
25
+ export class ${Name}Main {
26
+ static slots = [];
27
+
28
+ static dependencies = [NodeAspect, EnvsAspect];
29
+
30
+ static runtime = MainRuntime;
31
+
32
+ //const webpackModifiers: UseWebpackModifiers = {
33
+ // previewConfig: [previewConfigTransformer],
34
+ // devServerConfig: [devServerConfigTransformer],
35
+ //};
36
+
37
+ //const tsModifiers: UseTypescriptModifiers = {
38
+ // devConfig: [devConfigTransformer],
39
+ // buildConfig: [buildConfigTransformer],
40
+ //};
41
+
42
+ static async provider([node, envs]: [NodeMain, EnvsMain]) {
43
+ const ${Name}Env = node.compose([
44
+ /**
45
+ * Uncomment to override the config files for TypeScript, Webpack or Jest
46
+ * Your config gets merged with the defaults
47
+ */
48
+
49
+ // node.useTypescript(tsModifiers), // note: this cannot be used in conjunction with node.overrideCompiler
50
+ // node.useWebpack(webpackModifiers),
51
+ // node.overrideJestConfig(require.resolve('./jest/jest.config')),
52
+
53
+ /**
54
+ * override the ESLint default config here then check your files for lint errors
55
+ * @example
56
+ * bit lint
57
+ * bit lint --fix
58
+ */
59
+ node.useEslint({
60
+ transformers: [
61
+ (config) => {
62
+ config.setRule('no-console', ['error']);
63
+ return config;
64
+ }
65
+ ]
66
+ }),
67
+
68
+ /**
69
+ * override the Prettier default config here the check your formatting
70
+ * @example
71
+ * bit format --check
72
+ * bit format
73
+ */
74
+ node.usePrettier({
75
+ transformers: [
76
+ (config) => {
77
+ config.setKey('tabWidth', 2);
78
+ return config;
79
+ }
80
+ ]
81
+ }),
82
+
83
+ /**
84
+ * override dependencies here
85
+ * @example
86
+ * Uncomment types to include version 17.0.3 of the types package
87
+ */
88
+ node.overrideDependencies({
89
+ devDependencies: {
90
+ // '@types/node': '16.11.7'
91
+ }
92
+ })
93
+ ]);
94
+ envs.registerEnv(${Name}Env);
95
+ return new ${Name}Main();
96
+ }
97
+ }
98
+
99
+ ${Name}Aspect.addRuntime(${Name}Main);
100
+ `;
101
+ }
102
+
103
+ //# sourceMappingURL=main.runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["main.runtime.ts"],"names":["mainRuntimeFile","namePascalCase","Name","name"],"mappings":";;;;;;;AAEO,SAASA,eAAT,CAAyB;AAAEC,EAAAA,cAAc,EAAEC,IAAlB;AAAwBC,EAAAA;AAAxB,CAAzB,EAA2E;AAChF,SAAQ;AACV;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,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,CAxFE;AAyFD","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 { ${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-transformers\";\n\nexport class ${Name}Main {\n static slots = [];\n\n static dependencies = [NodeAspect, EnvsAspect];\n\n static runtime = MainRuntime;\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 static async provider([node, envs]: [NodeMain, EnvsMain]) {\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"]}
@@ -0,0 +1,2 @@
1
+ import { ComponentContext } from '@teambit/generator';
2
+ export declare function previewRuntimeFile({ namePascalCase: Name, nameCamelCase: nameCamel, name }: ComponentContext): string;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.previewRuntimeFile = previewRuntimeFile;
7
+
8
+ function previewRuntimeFile({
9
+ namePascalCase: Name,
10
+ nameCamelCase: nameCamel,
11
+ name
12
+ }) {
13
+ return `import { PreviewRuntime } from '@teambit/preview';
14
+ import { ReactAspect, ReactPreview } from '@teambit/react'; // the node env uses the react env's preview feature
15
+ // uncomment the line below and install the theme if you want to use our theme or create your own and import it here
16
+ // import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';
17
+
18
+ import { ${Name}Aspect } from './${name}.aspect';
19
+
20
+ export class ${Name}PreviewMain {
21
+ static runtime = PreviewRuntime;
22
+
23
+ static dependencies = [ReactAspect];
24
+
25
+ static async provider([react]: [ReactPreview]) {
26
+ const ${nameCamel}PreviewMain = new ${Name}PreviewMain();
27
+ // uncomment the line below to register a new provider to wrap all compositions using this environment with a custom theme.
28
+ // react.registerProvider([ThemeCompositions]);
29
+
30
+ return ${nameCamel}PreviewMain;
31
+ }
32
+ }
33
+
34
+ ${Name}Aspect.addRuntime(${Name}PreviewMain);
35
+ `;
36
+ }
37
+
38
+ //# sourceMappingURL=preview.runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["preview.runtime.ts"],"names":["previewRuntimeFile","namePascalCase","Name","nameCamelCase","nameCamel","name"],"mappings":";;;;;;;AAEO,SAASA,kBAAT,CAA4B;AAAEC,EAAAA,cAAc,EAAEC,IAAlB;AAAwBC,EAAAA,aAAa,EAAEC,SAAvC;AAAkDC,EAAAA;AAAlD,CAA5B,EAAwG;AAC7G,SAAQ;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","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"]}
@@ -0,0 +1 @@
1
+ export declare function globalStylesFile(): string;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.globalStylesFile = globalStylesFile;
7
+
8
+ function globalStylesFile() {
9
+ return `
10
+ /*
11
+ Add your global styles here to be added for any component using this env
12
+ */
13
+ `;
14
+ }
15
+
16
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["styles.ts"],"names":["globalStylesFile"],"mappings":";;;;;;;AAAO,SAASA,gBAAT,GAA4B;AACjC,SAAQ;AACV;AACA;AACA;AACA,GAJE;AAKD","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"]}
@@ -0,0 +1 @@
1
+ export declare function tsTransformerFile(): string;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.tsTransformerFile = tsTransformerFile;
7
+
8
+ function tsTransformerFile() {
9
+ return `
10
+ import * as path from 'path';
11
+ import {
12
+ TsConfigTransformer,
13
+ TypescriptConfigMutator,
14
+ } from "@teambit/typescript";
15
+
16
+ const tsConfig = require('./tsconfig.json');
17
+
18
+ export const commonTransformer: TsConfigTransformer = (
19
+ config: TypescriptConfigMutator
20
+ ) => {
21
+ const newConfig = config.addTypes([path.join(__dirname, 'styles.d.ts')])
22
+ newConfig.mergeTsConfig(tsConfig);
23
+ // Some examples of other built in mutator functions:
24
+ //newConfig.addExclude(['someExclude']);
25
+ //newConfig.setCompileJs(true)
26
+ return newConfig;
27
+ };
28
+
29
+ /**
30
+ * Transformation for the dev config only
31
+ * @param config
32
+ * @param context
33
+ * @returns
34
+ */
35
+ export const devConfigTransformer: TsConfigTransformer = (
36
+ config: TypescriptConfigMutator,
37
+ ) => {
38
+ const newConfig = commonTransformer(config, {});
39
+ return newConfig;
40
+ };
41
+
42
+ /**
43
+ * Transformation for the build only
44
+ * @param config
45
+ * @param context
46
+ * @returns
47
+ */
48
+ export const buildConfigTransformer: TsConfigTransformer = (
49
+ config: TypescriptConfigMutator
50
+ ) => {
51
+ const newConfig = commonTransformer(config, {});
52
+ newConfig.mergeTsConfig(tsConfig);
53
+ return newConfig;
54
+ };
55
+
56
+ `;
57
+ }
58
+
59
+ //# sourceMappingURL=ts-transformer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ts-transformer.ts"],"names":["tsTransformerFile"],"mappings":";;;;;;;AAAO,SAASA,iBAAT,GAA6B;AAClC,SAAQ;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","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"]}
@@ -0,0 +1 @@
1
+ export declare function typescriptConfigFile(): string;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.typescriptConfigFile = typescriptConfigFile;
7
+
8
+ function typescriptConfigFile() {
9
+ return `{
10
+ // add your compiler options here
11
+
12
+ "compilerOptions": {
13
+ // "target": "es2017",
14
+ // "module": "es2015",
15
+ // "moduleResolution": "node",
16
+ // "lib": ["es2017", "dom"],
17
+ // "experimentalDecorators": true,
18
+ // "esModuleInterop": true,
19
+ // "outDir": "dist",
20
+ // "sourceMap": true,
21
+ // "emitDecoratorMetadata": true,
22
+ // "allowJs": true,
23
+ // "baseUrl": ".",
24
+ // "jsx": "react"
25
+ }
26
+ }
27
+ `;
28
+ }
29
+
30
+ //# sourceMappingURL=typescript.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["typescript.config.ts"],"names":["typescriptConfigFile"],"mappings":";;;;;;;AAAO,SAASA,oBAAT,GAAgC;AACrC,SAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAlBE;AAmBD","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"]}
@@ -0,0 +1 @@
1
+ export declare function webpackConfigFile(): string;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.webpackConfigFile = webpackConfigFile;
7
+
8
+ function webpackConfigFile() {
9
+ return `
10
+ import { WebpackConfigTransformer, WebpackConfigMutator, WebpackConfigTransformContext } from '@teambit/webpack';
11
+
12
+ /**
13
+ * Transformation to apply for both preview and dev server
14
+ * @param config
15
+ * @param _context
16
+ */
17
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
18
+ function commonTransformation(config: WebpackConfigMutator, _context: WebpackConfigTransformContext) {
19
+ // Merge config with the webpack.config.js file if you choose to import a module export format config.
20
+ // config.merge([webpackConfig]);
21
+ // config.addAliases({});
22
+ // config.addModuleRule(youRuleHere);
23
+ return config;
24
+ }
25
+
26
+ /**
27
+ * Transformation for the preview only
28
+ * @param config
29
+ * @param context
30
+ * @returns
31
+ */
32
+ export const previewConfigTransformer: WebpackConfigTransformer = (
33
+ config: WebpackConfigMutator,
34
+ context: WebpackConfigTransformContext
35
+ ) => {
36
+ const newConfig = commonTransformation(config, context);
37
+ return newConfig;
38
+ };
39
+
40
+ /**
41
+ * Transformation for the dev server only
42
+ * @param config
43
+ * @param context
44
+ * @returns
45
+ */
46
+ export const devServerConfigTransformer: WebpackConfigTransformer = (
47
+ config: WebpackConfigMutator,
48
+ context: WebpackConfigTransformContext
49
+ ) => {
50
+ const newConfig = commonTransformation(config, context);
51
+ return newConfig;
52
+ };
53
+
54
+ `;
55
+ }
56
+
57
+ //# sourceMappingURL=webpack.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack.config.ts"],"names":["webpackConfigFile"],"mappings":";;;;;;;AAAO,SAASA,iBAAT,GAA6B;AAClC,SAAQ;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,CA7CE;AA8CD","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"]}
@@ -25,10 +25,80 @@ function _doc() {
25
25
  return data;
26
26
  }
27
27
 
28
- function _extension() {
29
- const data = require("./files/extension");
28
+ function _main() {
29
+ const data = require("./files/main.runtime");
30
30
 
31
- _extension = function () {
31
+ _main = function () {
32
+ return data;
33
+ };
34
+
35
+ return data;
36
+ }
37
+
38
+ function _preview() {
39
+ const data = require("./files/preview.runtime");
40
+
41
+ _preview = function () {
42
+ return data;
43
+ };
44
+
45
+ return data;
46
+ }
47
+
48
+ function _aspect() {
49
+ const data = require("./files/aspect");
50
+
51
+ _aspect = function () {
52
+ return data;
53
+ };
54
+
55
+ return data;
56
+ }
57
+
58
+ function _webpack() {
59
+ const data = require("./files/webpack.config");
60
+
61
+ _webpack = function () {
62
+ return data;
63
+ };
64
+
65
+ return data;
66
+ }
67
+
68
+ function _typescript() {
69
+ const data = require("./files/typescript/typescript.config");
70
+
71
+ _typescript = function () {
72
+ return data;
73
+ };
74
+
75
+ return data;
76
+ }
77
+
78
+ function _styles() {
79
+ const data = require("./files/typescript/styles");
80
+
81
+ _styles = function () {
82
+ return data;
83
+ };
84
+
85
+ return data;
86
+ }
87
+
88
+ function _tsTransformer() {
89
+ const data = require("./files/typescript/ts-transformer");
90
+
91
+ _tsTransformer = function () {
92
+ return data;
93
+ };
94
+
95
+ return data;
96
+ }
97
+
98
+ function _jest() {
99
+ const data = require("./files/jest.config");
100
+
101
+ _jest = function () {
32
102
  return data;
33
103
  };
34
104
 
@@ -45,16 +115,37 @@ const nodeEnvTemplate = {
45
115
  isMain: true
46
116
  }, {
47
117
  relativePath: `${context.name}.docs.mdx`,
48
- content: (0, _doc().docFile)()
118
+ content: (0, _doc().docFile)(context)
119
+ }, {
120
+ relativePath: `${context.name}.main.runtime.ts`,
121
+ content: (0, _main().mainRuntimeFile)(context)
122
+ }, {
123
+ relativePath: `${context.name}.preview.runtime.ts`,
124
+ content: (0, _preview().previewRuntimeFile)(context)
125
+ }, {
126
+ relativePath: `${context.name}.aspect.ts`,
127
+ content: (0, _aspect().aspectFile)(context)
128
+ }, {
129
+ relativePath: `webpack/webpack-transformers.ts`,
130
+ content: (0, _webpack().webpackConfigFile)()
131
+ }, {
132
+ relativePath: `typescript/tsconfig.json`,
133
+ content: (0, _typescript().typescriptConfigFile)()
134
+ }, {
135
+ relativePath: `typescript/styles.d.ts`,
136
+ content: (0, _styles().globalStylesFile)()
137
+ }, {
138
+ relativePath: `typescript/ts-transformer.ts`,
139
+ content: (0, _tsTransformer().tsTransformerFile)()
49
140
  }, {
50
- relativePath: `${context.name}.extension.ts`,
51
- content: (0, _extension().extensionFile)(context)
141
+ relativePath: `jest/jest.config.js`,
142
+ content: (0, _jest().jestConfigFile)()
52
143
  }];
53
144
  },
54
145
  config: {
55
- 'teambit.harmony/aspect': {},
146
+ 'teambit.envs/env': {},
56
147
  'teambit.envs/envs': {
57
- env: 'teambit.harmony/aspect'
148
+ env: 'teambit.envs/env'
58
149
  }
59
150
  }
60
151
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["nodeEnvTemplate","name","description","generateFiles","context","relativePath","content","isMain","config","env"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,eAAkC,GAAG;AAChDC,EAAAA,IAAI,EAAE,UAD0C;AAEhDC,EAAAA,WAAW,EAAE,yDAFmC;AAGhDC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,WAAO,CACL;AACEC,MAAAA,YAAY,EAAE,UADhB;AAEEC,MAAAA,OAAO,EAAE,wBAAUF,OAAV,CAFX;AAGEG,MAAAA,MAAM,EAAE;AAHV,KADK,EAML;AACEF,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,WADhC;AAEEK,MAAAA,OAAO,EAAE;AAFX,KANK,EAUL;AACED,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,eADhC;AAEEK,MAAAA,OAAO,EAAE,gCAAcF,OAAd;AAFX,KAVK,CAAP;AAeD,GAnB+C;AAoBhDI,EAAAA,MAAM,EAAE;AACN,8BAA0B,EADpB;AAEN,yBAAqB;AACnBC,MAAAA,GAAG,EAAE;AADc;AAFf;AApBwC,CAA3C","sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { extensionFile } from './files/extension';\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(),\n },\n {\n relativePath: `${context.name}.extension.ts`,\n content: extensionFile(context),\n },\n ];\n },\n config: {\n 'teambit.harmony/aspect': {},\n 'teambit.envs/envs': {\n env: 'teambit.harmony/aspect',\n },\n },\n};\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["nodeEnvTemplate","name","description","generateFiles","context","relativePath","content","isMain","config","env"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,eAAkC,GAAG;AAChDC,EAAAA,IAAI,EAAE,UAD0C;AAEhDC,EAAAA,WAAW,EAAE,yDAFmC;AAGhDC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,WAAO,CACL;AACEC,MAAAA,YAAY,EAAE,UADhB;AAEEC,MAAAA,OAAO,EAAE,wBAAUF,OAAV,CAFX;AAGEG,MAAAA,MAAM,EAAE;AAHV,KADK,EAML;AACEF,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,WADhC;AAEEK,MAAAA,OAAO,EAAE,oBAAQF,OAAR;AAFX,KANK,EAUL;AACEC,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,kBADhC;AAEEK,MAAAA,OAAO,EAAE,6BAAgBF,OAAhB;AAFX,KAVK,EAcL;AACEC,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,qBADhC;AAEEK,MAAAA,OAAO,EAAE,mCAAmBF,OAAnB;AAFX,KAdK,EAkBL;AACEC,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,YADhC;AAEEK,MAAAA,OAAO,EAAE,0BAAWF,OAAX;AAFX,KAlBK,EAsBL;AACEC,MAAAA,YAAY,EAAG,iCADjB;AAEEC,MAAAA,OAAO,EAAE;AAFX,KAtBK,EA0BL;AACED,MAAAA,YAAY,EAAG,0BADjB;AAEEC,MAAAA,OAAO,EAAE;AAFX,KA1BK,EA8BL;AACED,MAAAA,YAAY,EAAG,wBADjB;AAEEC,MAAAA,OAAO,EAAE;AAFX,KA9BK,EAkCL;AACED,MAAAA,YAAY,EAAG,8BADjB;AAEEC,MAAAA,OAAO,EAAE;AAFX,KAlCK,EAsCL;AACED,MAAAA,YAAY,EAAG,qBADjB;AAEEC,MAAAA,OAAO,EAAE;AAFX,KAtCK,CAAP;AA2CD,GA/C+C;AAgDhDE,EAAAA,MAAM,EAAE;AACN,wBAAoB,EADd;AAEN,yBAAqB;AACnBC,MAAAA,GAAG,EAAE;AADc;AAFf;AAhDwC,CAA3C","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"]}
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
1
  {
2
2
  "name": "@teambit/node",
3
- "version": "0.0.705",
3
+ "version": "0.0.708",
4
4
  "homepage": "https://bit.dev/teambit/harmony/node",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.harmony",
8
8
  "name": "node",
9
- "version": "0.0.705"
9
+ "version": "0.0.708"
10
10
  },
11
11
  "dependencies": {
12
- "@teambit/harmony": "0.2.11",
13
12
  "lodash": "4.17.21",
14
13
  "typescript": "4.4.2",
15
14
  "jest-environment-node": "27.5.1",
16
15
  "@babel/runtime": "7.12.18",
17
16
  "core-js": "^3.0.0",
18
- "@teambit/application": "0.0.347",
19
- "@teambit/logger": "0.0.561",
20
- "@teambit/react": "0.0.705",
21
- "@teambit/builder": "0.0.705",
22
- "@teambit/dependency-resolver": "0.0.705",
23
- "@teambit/envs": "0.0.705",
24
- "@teambit/tester": "0.0.705",
25
- "@teambit/typescript": "0.0.705",
26
- "@teambit/cli": "0.0.469",
27
- "@teambit/compiler": "0.0.705",
28
- "@teambit/generator": "0.0.705",
29
- "@teambit/pkg": "0.0.705",
30
- "@teambit/compositions": "0.0.705",
17
+ "@teambit/harmony": "0.3.3",
18
+ "@teambit/application": "0.0.350",
19
+ "@teambit/logger": "0.0.563",
20
+ "@teambit/react": "0.0.708",
21
+ "@teambit/builder": "0.0.708",
22
+ "@teambit/dependency-resolver": "0.0.708",
23
+ "@teambit/envs": "0.0.708",
24
+ "@teambit/tester": "0.0.708",
25
+ "@teambit/typescript": "0.0.708",
26
+ "@teambit/cli": "0.0.471",
27
+ "@teambit/compiler": "0.0.708",
28
+ "@teambit/generator": "0.0.708",
29
+ "@teambit/pkg": "0.0.708",
30
+ "@teambit/compositions": "0.0.708",
31
31
  "@teambit/design.ui.empty-box": "0.0.353",
32
- "@teambit/ui": "0.0.705"
32
+ "@teambit/ui": "0.0.708"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/react": "^17.0.8",
@@ -1,2 +1,2 @@
1
- export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_node@0.0.705/dist/node.composition.js')]
2
- export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_node@0.0.705/dist/node.docs.mdx')]
1
+ export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_node@0.0.708/dist/node.composition.js')]
2
+ export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_node@0.0.708/dist/node.docs.mdx')]
@@ -0,0 +1,10 @@
1
+ import { ComponentContext } from '@teambit/generator';
2
+
3
+ export function aspectFile({ namePascalCase: Name, componentId }: ComponentContext) {
4
+ return `import { Aspect } from '@teambit/harmony';
5
+
6
+ export const ${Name}Aspect = Aspect.create({
7
+ id: '${componentId}',
8
+ });
9
+ `;
10
+ }