@teambit/node 1.0.41 → 1.0.42
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.
- package/artifacts/env-template/public/{29.aabccd461805a58cd99a.js → 29.ddc7bc194190fac98e8b.js} +18 -18
- package/artifacts/env-template/public/{238.64be32cc6d4bc396b35e.js → 293.4bce474b96c9eb955917.js} +4 -4
- package/artifacts/env-template/public/assets-manifest.json +12 -12
- package/artifacts/env-template/public/{compositions.2f6adb00de8250ec25bb.js → compositions.87d6238bc3f9ad09db15.js} +1 -1
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/{overview.6046b45c5c5ed35f09bb.js → overview.4bebd06a33f1cc723194.js} +1 -1
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/{peers.b59dd85dd7ea760e8208.js → peers.f9dd17dc213c6e0d0102.js} +1 -1
- package/artifacts/env-template/public/{preview-root.983463c786334e1fbaf1.js → preview-root.3b62d04b3a7f234bd8ca.js} +1 -1
- package/dist/node.aspect.js +2 -4
- package/dist/node.aspect.js.map +1 -1
- package/dist/node.env.js +1 -2
- package/dist/node.env.js.map +1 -1
- package/dist/node.main.runtime.d.ts +6 -3
- package/dist/node.main.runtime.js +21 -25
- package/dist/node.main.runtime.js.map +1 -1
- package/dist/node.templates.d.ts +3 -0
- package/dist/node.templates.js +33 -0
- package/dist/node.templates.js.map +1 -0
- package/dist/node.ui.runtime.js +1 -2
- package/dist/node.ui.runtime.js.map +1 -1
- package/dist/{preview-1698981534427.js → preview-1699364645970.js} +2 -2
- package/package.json +23 -20
- package/dist/templates/entity/index.d.ts +0 -0
- package/dist/templates/entity/index.js +0 -3
- package/dist/templates/entity/index.js.map +0 -1
- package/dist/templates/express-app/files/app-root.d.ts +0 -5
- package/dist/templates/express-app/files/app-root.js +0 -39
- package/dist/templates/express-app/files/app-root.js.map +0 -1
- package/dist/templates/express-app/files/composition.d.ts +0 -5
- package/dist/templates/express-app/files/composition.js +0 -20
- package/dist/templates/express-app/files/composition.js.map +0 -1
- package/dist/templates/express-app/files/doc.d.ts +0 -5
- package/dist/templates/express-app/files/doc.js +0 -35
- package/dist/templates/express-app/files/doc.js.map +0 -1
- package/dist/templates/express-app/files/get-port.d.ts +0 -4
- package/dist/templates/express-app/files/get-port.js +0 -21
- package/dist/templates/express-app/files/get-port.js.map +0 -1
- package/dist/templates/express-app/files/index.d.ts +0 -6
- package/dist/templates/express-app/files/index.js +0 -17
- package/dist/templates/express-app/files/index.js.map +0 -1
- package/dist/templates/express-app/files/mock-route.d.ts +0 -4
- package/dist/templates/express-app/files/mock-route.js +0 -23
- package/dist/templates/express-app/files/mock-route.js.map +0 -1
- package/dist/templates/express-app/files/node-app.d.ts +0 -5
- package/dist/templates/express-app/files/node-app.js +0 -23
- package/dist/templates/express-app/files/node-app.js.map +0 -1
- package/dist/templates/express-app/files/route.d.ts +0 -4
- package/dist/templates/express-app/files/route.js +0 -29
- package/dist/templates/express-app/files/route.js.map +0 -1
- package/dist/templates/express-app/files/test.d.ts +0 -5
- package/dist/templates/express-app/files/test.js +0 -19
- package/dist/templates/express-app/files/test.js.map +0 -1
- package/dist/templates/express-app/index.d.ts +0 -2
- package/dist/templates/express-app/index.js +0 -79
- package/dist/templates/express-app/index.js.map +0 -1
- package/dist/templates/express-route/files/composition.d.ts +0 -5
- package/dist/templates/express-route/files/composition.js +0 -20
- package/dist/templates/express-route/files/composition.js.map +0 -1
- package/dist/templates/express-route/files/doc.d.ts +0 -5
- package/dist/templates/express-route/files/doc.js +0 -24
- package/dist/templates/express-route/files/doc.js.map +0 -1
- package/dist/templates/express-route/files/index.d.ts +0 -6
- package/dist/templates/express-route/files/index.js +0 -16
- package/dist/templates/express-route/files/index.js.map +0 -1
- package/dist/templates/express-route/files/main.d.ts +0 -5
- package/dist/templates/express-route/files/main.js +0 -21
- package/dist/templates/express-route/files/main.js.map +0 -1
- package/dist/templates/express-route/files/test.d.ts +0 -5
- package/dist/templates/express-route/files/test.js +0 -19
- package/dist/templates/express-route/files/test.js.map +0 -1
- package/dist/templates/express-route/index.d.ts +0 -2
- package/dist/templates/express-route/index.js +0 -51
- package/dist/templates/express-route/index.js.map +0 -1
- package/dist/templates/node/files/composition.d.ts +0 -5
- package/dist/templates/node/files/composition.js +0 -20
- package/dist/templates/node/files/composition.js.map +0 -1
- package/dist/templates/node/files/doc.d.ts +0 -5
- package/dist/templates/node/files/doc.js +0 -24
- package/dist/templates/node/files/doc.js.map +0 -1
- package/dist/templates/node/files/index.d.ts +0 -6
- package/dist/templates/node/files/index.js +0 -16
- package/dist/templates/node/files/index.js.map +0 -1
- package/dist/templates/node/files/main.d.ts +0 -5
- package/dist/templates/node/files/main.js +0 -17
- package/dist/templates/node/files/main.js.map +0 -1
- package/dist/templates/node/files/test.d.ts +0 -5
- package/dist/templates/node/files/test.js +0 -19
- package/dist/templates/node/files/test.js.map +0 -1
- package/dist/templates/node/index.d.ts +0 -2
- package/dist/templates/node/index.js +0 -58
- package/dist/templates/node/index.js.map +0 -1
- package/dist/templates/node-env/files/aspect.d.ts +0 -2
- package/dist/templates/node-env/files/aspect.js +0 -19
- package/dist/templates/node-env/files/aspect.js.map +0 -1
- package/dist/templates/node-env/files/doc.d.ts +0 -2
- package/dist/templates/node-env/files/doc.js +0 -187
- package/dist/templates/node-env/files/doc.js.map +0 -1
- package/dist/templates/node-env/files/index.d.ts +0 -2
- package/dist/templates/node-env/files/index.js +0 -19
- package/dist/templates/node-env/files/index.js.map +0 -1
- package/dist/templates/node-env/files/jest.config.d.ts +0 -1
- package/dist/templates/node-env/files/jest.config.js +0 -29
- package/dist/templates/node-env/files/jest.config.js.map +0 -1
- package/dist/templates/node-env/files/main.runtime.d.ts +0 -2
- package/dist/templates/node-env/files/main.runtime.js +0 -104
- package/dist/templates/node-env/files/main.runtime.js.map +0 -1
- package/dist/templates/node-env/files/preview.runtime.d.ts +0 -2
- package/dist/templates/node-env/files/preview.runtime.js +0 -37
- package/dist/templates/node-env/files/preview.runtime.js.map +0 -1
- package/dist/templates/node-env/files/typescript/styles.d.ts +0 -1
- package/dist/templates/node-env/files/typescript/styles.js +0 -15
- package/dist/templates/node-env/files/typescript/styles.js.map +0 -1
- package/dist/templates/node-env/files/typescript/ts-transformer.d.ts +0 -1
- package/dist/templates/node-env/files/typescript/ts-transformer.js +0 -58
- package/dist/templates/node-env/files/typescript/ts-transformer.js.map +0 -1
- package/dist/templates/node-env/files/typescript/typescript.config.d.ts +0 -1
- package/dist/templates/node-env/files/typescript/typescript.config.js +0 -29
- package/dist/templates/node-env/files/typescript/typescript.config.js.map +0 -1
- package/dist/templates/node-env/files/webpack.config.d.ts +0 -1
- package/dist/templates/node-env/files/webpack.config.js +0 -56
- package/dist/templates/node-env/files/webpack.config.js.map +0 -1
- package/dist/templates/node-env/index.d.ts +0 -2
- package/dist/templates/node-env/index.js +0 -124
- package/dist/templates/node-env/index.js.map +0 -1
- package/templates/entity/index.ts +0 -0
- package/templates/express-app/files/app-root.ts +0 -33
- package/templates/express-app/files/composition.ts +0 -14
- package/templates/express-app/files/doc.ts +0 -26
- package/templates/express-app/files/get-port.ts +0 -13
- package/templates/express-app/files/index.ts +0 -11
- package/templates/express-app/files/mock-route.ts +0 -15
- package/templates/express-app/files/node-app.ts +0 -17
- package/templates/express-app/files/route.ts +0 -21
- package/templates/express-app/files/test.ts +0 -13
- package/templates/express-app/index.ts +0 -35
- package/templates/express-route/files/composition.ts +0 -14
- package/templates/express-route/files/doc.ts +0 -18
- package/templates/express-route/files/index.ts +0 -10
- package/templates/express-route/files/main.ts +0 -15
- package/templates/express-route/files/test.ts +0 -13
- package/templates/express-route/index.ts +0 -27
- package/templates/node/files/composition.ts +0 -14
- package/templates/node/files/doc.ts +0 -18
- package/templates/node/files/index.ts +0 -10
- package/templates/node/files/main.ts +0 -11
- package/templates/node/files/test.ts +0 -13
- package/templates/node/index.ts +0 -21
- package/templates/node-env/files/aspect.ts +0 -10
- package/templates/node-env/files/doc.ts +0 -178
- package/templates/node-env/files/index.ts +0 -10
- package/templates/node-env/files/jest.config.ts +0 -21
- package/templates/node-env/files/main.runtime.ts +0 -95
- package/templates/node-env/files/preview.runtime.ts +0 -27
- package/templates/node-env/files/typescript/styles.ts +0 -7
- package/templates/node-env/files/typescript/ts-transformer.ts +0 -50
- package/templates/node-env/files/typescript/typescript.config.ts +0 -21
- package/templates/node-env/files/webpack.config.ts +0 -48
- package/templates/node-env/index.ts +0 -68
- /package/{compositions-1698981534427.js → compositions-1699364645970.js} +0 -0
- /package/{overview-1698981534427.js → overview-1699364645970.js} +0 -0
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.mainRuntimeFile = mainRuntimeFile;
|
|
7
|
-
function mainRuntimeFile({
|
|
8
|
-
namePascalCase: Name,
|
|
9
|
-
name
|
|
10
|
-
}) {
|
|
11
|
-
return `import { MainRuntime } from '@teambit/cli';
|
|
12
|
-
import { NodeAspect, NodeMain } from '@teambit/node'
|
|
13
|
-
import { EnvsAspect, EnvsMain } from '@teambit/envs';
|
|
14
|
-
import type { UseTypescriptModifiers, UseWebpackModifiers } from '@teambit/react';
|
|
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-transformer";
|
|
24
|
-
|
|
25
|
-
export class ${Name}Main {
|
|
26
|
-
static slots = [];
|
|
27
|
-
|
|
28
|
-
static dependencies = [NodeAspect, EnvsAspect];
|
|
29
|
-
|
|
30
|
-
static runtime = MainRuntime;
|
|
31
|
-
|
|
32
|
-
static async provider([node, envs]: [NodeMain, EnvsMain]) {
|
|
33
|
-
|
|
34
|
-
//const webpackModifiers: UseWebpackModifiers = {
|
|
35
|
-
// previewConfig: [previewConfigTransformer],
|
|
36
|
-
// devServerConfig: [devServerConfigTransformer],
|
|
37
|
-
//};
|
|
38
|
-
|
|
39
|
-
//const tsModifiers: UseTypescriptModifiers = {
|
|
40
|
-
// devConfig: [devConfigTransformer],
|
|
41
|
-
// buildConfig: [buildConfigTransformer],
|
|
42
|
-
//};
|
|
43
|
-
|
|
44
|
-
const ${Name}Env = node.compose([
|
|
45
|
-
/**
|
|
46
|
-
* Uncomment to override the config files for TypeScript, Webpack or Jest
|
|
47
|
-
* Your config gets merged with the defaults
|
|
48
|
-
*/
|
|
49
|
-
|
|
50
|
-
// node.useTypescript(tsModifiers), // note: this cannot be used in conjunction with node.overrideCompiler
|
|
51
|
-
// node.useWebpack(webpackModifiers),
|
|
52
|
-
// node.overrideJestConfig(require.resolve('./jest/jest.config')),
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* override the ESLint default config here then check your files for lint errors
|
|
56
|
-
* @example
|
|
57
|
-
* bit lint
|
|
58
|
-
* bit lint --fix
|
|
59
|
-
*/
|
|
60
|
-
node.useEslint({
|
|
61
|
-
transformers: [
|
|
62
|
-
(config) => {
|
|
63
|
-
config.setRule('no-console', ['error']);
|
|
64
|
-
return config;
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
}),
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* override the Prettier default config here the check your formatting
|
|
71
|
-
* @example
|
|
72
|
-
* bit format --check
|
|
73
|
-
* bit format
|
|
74
|
-
*/
|
|
75
|
-
node.usePrettier({
|
|
76
|
-
transformers: [
|
|
77
|
-
(config) => {
|
|
78
|
-
config.setKey('tabWidth', 2);
|
|
79
|
-
return config;
|
|
80
|
-
}
|
|
81
|
-
]
|
|
82
|
-
}),
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* override dependencies here
|
|
86
|
-
* @example
|
|
87
|
-
* Uncomment types to include version 17.0.3 of the types package
|
|
88
|
-
*/
|
|
89
|
-
node.overrideDependencies({
|
|
90
|
-
devDependencies: {
|
|
91
|
-
// '@types/node': '16.11.7'
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
]);
|
|
95
|
-
envs.registerEnv(${Name}Env);
|
|
96
|
-
return new ${Name}Main();
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
${Name}Aspect.addRuntime(${Name}Main);
|
|
101
|
-
`;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
//# sourceMappingURL=main.runtime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["mainRuntimeFile","namePascalCase","Name","name"],"sources":["main.runtime.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function mainRuntimeFile({ namePascalCase: Name, name }: ComponentContext) {\n return `import { MainRuntime } from '@teambit/cli';\nimport { NodeAspect, NodeMain } from '@teambit/node'\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport type { UseTypescriptModifiers, UseWebpackModifiers } from '@teambit/react';\nimport { ${Name}Aspect } from './${name}.aspect';\n//import {\n// previewConfigTransformer,\n// devServerConfigTransformer\n//} from './webpack/webpack-transformers';\n//import {\n// devConfigTransformer,\n// buildConfigTransformer,\n//} from \"./typescript/ts-transformer\";\n\nexport class ${Name}Main {\n static slots = [];\n\n static dependencies = [NodeAspect, EnvsAspect];\n\n static runtime = MainRuntime;\n\n static async provider([node, envs]: [NodeMain, EnvsMain]) {\n\n //const webpackModifiers: UseWebpackModifiers = {\n // previewConfig: [previewConfigTransformer],\n // devServerConfig: [devServerConfigTransformer],\n //};\n\n //const tsModifiers: UseTypescriptModifiers = {\n // devConfig: [devConfigTransformer],\n // buildConfig: [buildConfigTransformer],\n //};\n\n const ${Name}Env = node.compose([\n /**\n * Uncomment to override the config files for TypeScript, Webpack or Jest\n * Your config gets merged with the defaults\n */\n\n // node.useTypescript(tsModifiers), // note: this cannot be used in conjunction with node.overrideCompiler\n // node.useWebpack(webpackModifiers),\n // node.overrideJestConfig(require.resolve('./jest/jest.config')),\n\n /**\n * override the ESLint default config here then check your files for lint errors\n * @example\n * bit lint\n * bit lint --fix\n */\n node.useEslint({\n transformers: [\n (config) => {\n config.setRule('no-console', ['error']);\n return config;\n }\n ]\n }),\n\n /**\n * override the Prettier default config here the check your formatting\n * @example\n * bit format --check\n * bit format\n */\n node.usePrettier({\n transformers: [\n (config) => {\n config.setKey('tabWidth', 2);\n return config;\n }\n ]\n }),\n\n /**\n * override dependencies here\n * @example\n * Uncomment types to include version 17.0.3 of the types package\n */\n node.overrideDependencies({\n devDependencies: {\n // '@types/node': '16.11.7'\n }\n })\n ]);\n envs.registerEnv(${Name}Env);\n return new ${Name}Main();\n }\n}\n\n${Name}Aspect.addRuntime(${Name}Main);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,eAAeA,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC;AAAuB,CAAC,EAAE;EAChF,OAAQ;AACV;AACA;AACA;AACA,WAAWD,IAAK,oBAAmBC,IAAK;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeD,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAYA,IAAK;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuBA,IAAK;AAC5B,iBAAiBA,IAAK;AACtB;AACA;AACA;AACA,EAAEA,IAAK,qBAAoBA,IAAK;AAChC,CAAC;AACD"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.previewRuntimeFile = previewRuntimeFile;
|
|
7
|
-
function previewRuntimeFile({
|
|
8
|
-
namePascalCase: Name,
|
|
9
|
-
nameCamelCase: nameCamel,
|
|
10
|
-
name
|
|
11
|
-
}) {
|
|
12
|
-
return `import { PreviewRuntime } from '@teambit/preview';
|
|
13
|
-
import { ReactAspect, ReactPreview } from '@teambit/react'; // the node env uses the react env's preview feature
|
|
14
|
-
// uncomment the line below and install the theme if you want to use our theme or create your own and import it here
|
|
15
|
-
// import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';
|
|
16
|
-
|
|
17
|
-
import { ${Name}Aspect } from './${name}.aspect';
|
|
18
|
-
|
|
19
|
-
export class ${Name}PreviewMain {
|
|
20
|
-
static runtime = PreviewRuntime;
|
|
21
|
-
|
|
22
|
-
static dependencies = [ReactAspect];
|
|
23
|
-
|
|
24
|
-
static async provider([react]: [ReactPreview]) {
|
|
25
|
-
const ${nameCamel}PreviewMain = new ${Name}PreviewMain();
|
|
26
|
-
// uncomment the line below to register a new provider to wrap all compositions using this environment with a custom theme.
|
|
27
|
-
// react.registerProvider([ThemeCompositions]);
|
|
28
|
-
|
|
29
|
-
return ${nameCamel}PreviewMain;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
${Name}Aspect.addRuntime(${Name}PreviewMain);
|
|
34
|
-
`;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=preview.runtime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["previewRuntimeFile","namePascalCase","Name","nameCamelCase","nameCamel","name"],"sources":["preview.runtime.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport function previewRuntimeFile({ namePascalCase: Name, nameCamelCase: nameCamel, name }: ComponentContext) {\n return `import { PreviewRuntime } from '@teambit/preview';\nimport { ReactAspect, ReactPreview } from '@teambit/react'; // the node env uses the react env's preview feature\n// uncomment the line below and install the theme if you want to use our theme or create your own and import it here\n// import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';\n\nimport { ${Name}Aspect } from './${name}.aspect';\n\nexport class ${Name}PreviewMain {\n static runtime = PreviewRuntime;\n\n static dependencies = [ReactAspect];\n\n static async provider([react]: [ReactPreview]) {\n const ${nameCamel}PreviewMain = new ${Name}PreviewMain();\n // uncomment the line below to register a new provider to wrap all compositions using this environment with a custom theme.\n // react.registerProvider([ThemeCompositions]);\n\n return ${nameCamel}PreviewMain;\n }\n}\n\n${Name}Aspect.addRuntime(${Name}PreviewMain);\n`;\n}\n"],"mappings":";;;;;;AAEO,SAASA,kBAAkBA,CAAC;EAAEC,cAAc,EAAEC,IAAI;EAAEC,aAAa,EAAEC,SAAS;EAAEC;AAAuB,CAAC,EAAE;EAC7G,OAAQ;AACV;AACA;AACA;AACA;AACA,WAAWH,IAAK,oBAAmBG,IAAK;AACxC;AACA,eAAeH,IAAK;AACpB;AACA;AACA;AACA;AACA;AACA,YAAYE,SAAU,qBAAoBF,IAAK;AAC/C;AACA;AACA;AACA,aAAaE,SAAU;AACvB;AACA;AACA;AACA,EAAEF,IAAK,qBAAoBA,IAAK;AAChC,CAAC;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function globalStylesFile(): string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.globalStylesFile = globalStylesFile;
|
|
7
|
-
function globalStylesFile() {
|
|
8
|
-
return `
|
|
9
|
-
/*
|
|
10
|
-
Add your global styles here to be added for any component using this env
|
|
11
|
-
*/
|
|
12
|
-
`;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["globalStylesFile"],"sources":["styles.ts"],"sourcesContent":["export function globalStylesFile() {\n return `\n /*\n Add your global styles here to be added for any component using this env\n */\n `;\n}\n"],"mappings":";;;;;;AAAO,SAASA,gBAAgBA,CAAA,EAAG;EACjC,OAAQ;AACV;AACA;AACA;AACA,GAAG;AACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tsTransformerFile(): string;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.tsTransformerFile = tsTransformerFile;
|
|
7
|
-
function tsTransformerFile() {
|
|
8
|
-
return `
|
|
9
|
-
import * as path from 'path';
|
|
10
|
-
import {
|
|
11
|
-
TsConfigTransformer,
|
|
12
|
-
TypescriptConfigMutator,
|
|
13
|
-
} from "@teambit/typescript";
|
|
14
|
-
|
|
15
|
-
const tsConfig = require('./tsconfig.json');
|
|
16
|
-
|
|
17
|
-
export const commonTransformer: TsConfigTransformer = (
|
|
18
|
-
config: TypescriptConfigMutator
|
|
19
|
-
) => {
|
|
20
|
-
const newConfig = config.addTypes([path.join(__dirname, 'styles.d.ts')])
|
|
21
|
-
newConfig.mergeTsConfig(tsConfig);
|
|
22
|
-
// Some examples of other built in mutator functions:
|
|
23
|
-
//newConfig.addExclude(['someExclude']);
|
|
24
|
-
//newConfig.setCompileJs(true)
|
|
25
|
-
return newConfig;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Transformation for the dev config only
|
|
30
|
-
* @param config
|
|
31
|
-
* @param context
|
|
32
|
-
* @returns
|
|
33
|
-
*/
|
|
34
|
-
export const devConfigTransformer: TsConfigTransformer = (
|
|
35
|
-
config: TypescriptConfigMutator,
|
|
36
|
-
) => {
|
|
37
|
-
const newConfig = commonTransformer(config, {});
|
|
38
|
-
return newConfig;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Transformation for the build only
|
|
43
|
-
* @param config
|
|
44
|
-
* @param context
|
|
45
|
-
* @returns
|
|
46
|
-
*/
|
|
47
|
-
export const buildConfigTransformer: TsConfigTransformer = (
|
|
48
|
-
config: TypescriptConfigMutator
|
|
49
|
-
) => {
|
|
50
|
-
const newConfig = commonTransformer(config, {});
|
|
51
|
-
newConfig.mergeTsConfig(tsConfig);
|
|
52
|
-
return newConfig;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
`;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
//# sourceMappingURL=ts-transformer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["tsTransformerFile"],"sources":["ts-transformer.ts"],"sourcesContent":["export function tsTransformerFile() {\n return `\n import * as path from 'path';\nimport {\n TsConfigTransformer,\n TypescriptConfigMutator,\n} from \"@teambit/typescript\";\n\nconst tsConfig = require('./tsconfig.json');\n\nexport const commonTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator\n) => {\n const newConfig = config.addTypes([path.join(__dirname, 'styles.d.ts')])\n newConfig.mergeTsConfig(tsConfig);\n // Some examples of other built in mutator functions:\n //newConfig.addExclude(['someExclude']);\n //newConfig.setCompileJs(true)\n return newConfig;\n};\n\n/**\n * Transformation for the dev config only\n * @param config\n * @param context\n * @returns\n */\nexport const devConfigTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator,\n) => {\n const newConfig = commonTransformer(config, {});\n return newConfig;\n};\n\n/**\n * Transformation for the build only\n * @param config\n * @param context\n * @returns\n */\nexport const buildConfigTransformer: TsConfigTransformer = (\n config: TypescriptConfigMutator\n) => {\n const newConfig = commonTransformer(config, {});\n newConfig.mergeTsConfig(tsConfig);\n return newConfig;\n};\n\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,iBAAiBA,CAAA,EAAG;EAClC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function typescriptConfigFile(): string;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.typescriptConfigFile = typescriptConfigFile;
|
|
7
|
-
function typescriptConfigFile() {
|
|
8
|
-
return `{
|
|
9
|
-
// add your compiler options here
|
|
10
|
-
|
|
11
|
-
"compilerOptions": {
|
|
12
|
-
// "target": "es2017",
|
|
13
|
-
// "module": "es2015",
|
|
14
|
-
// "moduleResolution": "node",
|
|
15
|
-
// "lib": ["es2017", "dom"],
|
|
16
|
-
// "experimentalDecorators": true,
|
|
17
|
-
// "esModuleInterop": true,
|
|
18
|
-
// "outDir": "dist",
|
|
19
|
-
// "sourceMap": true,
|
|
20
|
-
// "emitDecoratorMetadata": true,
|
|
21
|
-
// "allowJs": true,
|
|
22
|
-
// "baseUrl": ".",
|
|
23
|
-
// "jsx": "react"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
//# sourceMappingURL=typescript.config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["typescriptConfigFile"],"sources":["typescript.config.ts"],"sourcesContent":["export function typescriptConfigFile() {\n return `{\n // add your compiler options here\n\n \"compilerOptions\": {\n // \"target\": \"es2017\",\n // \"module\": \"es2015\",\n // \"moduleResolution\": \"node\",\n // \"lib\": [\"es2017\", \"dom\"],\n // \"experimentalDecorators\": true,\n // \"esModuleInterop\": true,\n // \"outDir\": \"dist\",\n // \"sourceMap\": true,\n // \"emitDecoratorMetadata\": true,\n // \"allowJs\": true,\n // \"baseUrl\": \".\",\n // \"jsx\": \"react\"\n }\n}\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,oBAAoBA,CAAA,EAAG;EACrC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function webpackConfigFile(): string;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.webpackConfigFile = webpackConfigFile;
|
|
7
|
-
function webpackConfigFile() {
|
|
8
|
-
return `
|
|
9
|
-
import { WebpackConfigTransformer, WebpackConfigMutator, WebpackConfigTransformContext } from '@teambit/webpack';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Transformation to apply for both preview and dev server
|
|
13
|
-
* @param config
|
|
14
|
-
* @param _context
|
|
15
|
-
*/
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
17
|
-
function commonTransformation(config: WebpackConfigMutator, _context: WebpackConfigTransformContext) {
|
|
18
|
-
// Merge config with the webpack.config.js file if you choose to import a module export format config.
|
|
19
|
-
// config.merge([webpackConfig]);
|
|
20
|
-
// config.addAliases({});
|
|
21
|
-
// config.addModuleRule(youRuleHere);
|
|
22
|
-
return config;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Transformation for the preview only
|
|
27
|
-
* @param config
|
|
28
|
-
* @param context
|
|
29
|
-
* @returns
|
|
30
|
-
*/
|
|
31
|
-
export const previewConfigTransformer: WebpackConfigTransformer = (
|
|
32
|
-
config: WebpackConfigMutator,
|
|
33
|
-
context: WebpackConfigTransformContext
|
|
34
|
-
) => {
|
|
35
|
-
const newConfig = commonTransformation(config, context);
|
|
36
|
-
return newConfig;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Transformation for the dev server only
|
|
41
|
-
* @param config
|
|
42
|
-
* @param context
|
|
43
|
-
* @returns
|
|
44
|
-
*/
|
|
45
|
-
export const devServerConfigTransformer: WebpackConfigTransformer = (
|
|
46
|
-
config: WebpackConfigMutator,
|
|
47
|
-
context: WebpackConfigTransformContext
|
|
48
|
-
) => {
|
|
49
|
-
const newConfig = commonTransformation(config, context);
|
|
50
|
-
return newConfig;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
`;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
//# sourceMappingURL=webpack.config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["webpackConfigFile"],"sources":["webpack.config.ts"],"sourcesContent":["export function webpackConfigFile() {\n return `\n import { WebpackConfigTransformer, WebpackConfigMutator, WebpackConfigTransformContext } from '@teambit/webpack';\n\n /**\n * Transformation to apply for both preview and dev server\n * @param config\n * @param _context\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n function commonTransformation(config: WebpackConfigMutator, _context: WebpackConfigTransformContext) {\n // Merge config with the webpack.config.js file if you choose to import a module export format config.\n // config.merge([webpackConfig]);\n // config.addAliases({});\n // config.addModuleRule(youRuleHere);\n return config;\n }\n\n /**\n * Transformation for the preview only\n * @param config\n * @param context\n * @returns\n */\n export const previewConfigTransformer: WebpackConfigTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigTransformContext\n ) => {\n const newConfig = commonTransformation(config, context);\n return newConfig;\n };\n\n /**\n * Transformation for the dev server only\n * @param config\n * @param context\n * @returns\n */\n export const devServerConfigTransformer: WebpackConfigTransformer = (\n config: WebpackConfigMutator,\n context: WebpackConfigTransformContext\n ) => {\n const newConfig = commonTransformation(config, context);\n return newConfig;\n };\n\n`;\n}\n"],"mappings":";;;;;;AAAO,SAASA,iBAAiBA,CAAA,EAAG;EAClC,OAAQ;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.nodeEnvTemplate = void 0;
|
|
7
|
-
function _index() {
|
|
8
|
-
const data = require("./files/index");
|
|
9
|
-
_index = function () {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _doc() {
|
|
15
|
-
const data = require("./files/doc");
|
|
16
|
-
_doc = function () {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
function _main() {
|
|
22
|
-
const data = require("./files/main.runtime");
|
|
23
|
-
_main = function () {
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
return data;
|
|
27
|
-
}
|
|
28
|
-
function _preview() {
|
|
29
|
-
const data = require("./files/preview.runtime");
|
|
30
|
-
_preview = function () {
|
|
31
|
-
return data;
|
|
32
|
-
};
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
|
-
function _aspect() {
|
|
36
|
-
const data = require("./files/aspect");
|
|
37
|
-
_aspect = function () {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
return data;
|
|
41
|
-
}
|
|
42
|
-
function _webpack() {
|
|
43
|
-
const data = require("./files/webpack.config");
|
|
44
|
-
_webpack = function () {
|
|
45
|
-
return data;
|
|
46
|
-
};
|
|
47
|
-
return data;
|
|
48
|
-
}
|
|
49
|
-
function _typescript() {
|
|
50
|
-
const data = require("./files/typescript/typescript.config");
|
|
51
|
-
_typescript = function () {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
return data;
|
|
55
|
-
}
|
|
56
|
-
function _styles() {
|
|
57
|
-
const data = require("./files/typescript/styles");
|
|
58
|
-
_styles = function () {
|
|
59
|
-
return data;
|
|
60
|
-
};
|
|
61
|
-
return data;
|
|
62
|
-
}
|
|
63
|
-
function _tsTransformer() {
|
|
64
|
-
const data = require("./files/typescript/ts-transformer");
|
|
65
|
-
_tsTransformer = function () {
|
|
66
|
-
return data;
|
|
67
|
-
};
|
|
68
|
-
return data;
|
|
69
|
-
}
|
|
70
|
-
function _jest() {
|
|
71
|
-
const data = require("./files/jest.config");
|
|
72
|
-
_jest = function () {
|
|
73
|
-
return data;
|
|
74
|
-
};
|
|
75
|
-
return data;
|
|
76
|
-
}
|
|
77
|
-
const nodeEnvTemplate = {
|
|
78
|
-
name: 'node-env',
|
|
79
|
-
description: 'customize the base Node env with your configs and tools',
|
|
80
|
-
hidden: true,
|
|
81
|
-
generateFiles: context => {
|
|
82
|
-
return [{
|
|
83
|
-
relativePath: 'index.ts',
|
|
84
|
-
content: (0, _index().indexFile)(context),
|
|
85
|
-
isMain: true
|
|
86
|
-
}, {
|
|
87
|
-
relativePath: `${context.name}.docs.mdx`,
|
|
88
|
-
content: (0, _doc().docFile)(context)
|
|
89
|
-
}, {
|
|
90
|
-
relativePath: `${context.name}.main.runtime.ts`,
|
|
91
|
-
content: (0, _main().mainRuntimeFile)(context)
|
|
92
|
-
}, {
|
|
93
|
-
relativePath: `${context.name}.preview.runtime.ts`,
|
|
94
|
-
content: (0, _preview().previewRuntimeFile)(context)
|
|
95
|
-
}, {
|
|
96
|
-
relativePath: `${context.name}.aspect.ts`,
|
|
97
|
-
content: (0, _aspect().aspectFile)(context)
|
|
98
|
-
}, {
|
|
99
|
-
relativePath: `webpack/webpack-transformers.ts`,
|
|
100
|
-
content: (0, _webpack().webpackConfigFile)()
|
|
101
|
-
}, {
|
|
102
|
-
relativePath: `typescript/tsconfig.json`,
|
|
103
|
-
content: (0, _typescript().typescriptConfigFile)()
|
|
104
|
-
}, {
|
|
105
|
-
relativePath: `typescript/styles.d.ts`,
|
|
106
|
-
content: (0, _styles().globalStylesFile)()
|
|
107
|
-
}, {
|
|
108
|
-
relativePath: `typescript/ts-transformer.ts`,
|
|
109
|
-
content: (0, _tsTransformer().tsTransformerFile)()
|
|
110
|
-
}, {
|
|
111
|
-
relativePath: `jest/jest.config.js`,
|
|
112
|
-
content: (0, _jest().jestConfigFile)()
|
|
113
|
-
}];
|
|
114
|
-
},
|
|
115
|
-
config: {
|
|
116
|
-
'teambit.envs/env': {},
|
|
117
|
-
'teambit.envs/envs': {
|
|
118
|
-
env: 'teambit.envs/env'
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
exports.nodeEnvTemplate = nodeEnvTemplate;
|
|
123
|
-
|
|
124
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_index","data","require","_doc","_main","_preview","_aspect","_webpack","_typescript","_styles","_tsTransformer","_jest","nodeEnvTemplate","name","description","hidden","generateFiles","context","relativePath","content","indexFile","isMain","docFile","mainRuntimeFile","previewRuntimeFile","aspectFile","webpackConfigFile","typescriptConfigFile","globalStylesFile","tsTransformerFile","jestConfigFile","config","env","exports"],"sources":["index.ts"],"sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { mainRuntimeFile } from './files/main.runtime';\nimport { previewRuntimeFile } from './files/preview.runtime';\nimport { aspectFile } from './files/aspect';\nimport { webpackConfigFile } from './files/webpack.config';\nimport { typescriptConfigFile } from './files/typescript/typescript.config';\nimport { globalStylesFile } from './files/typescript/styles';\nimport { tsTransformerFile } from './files/typescript/ts-transformer';\nimport { jestConfigFile } from './files/jest.config';\n\nexport const nodeEnvTemplate: ComponentTemplate = {\n name: 'node-env',\n description: 'customize the base Node env with your configs and tools',\n hidden: true,\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docFile(context),\n },\n {\n relativePath: `${context.name}.main.runtime.ts`,\n content: mainRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.preview.runtime.ts`,\n content: previewRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.aspect.ts`,\n content: aspectFile(context),\n },\n {\n relativePath: `webpack/webpack-transformers.ts`,\n content: webpackConfigFile(),\n },\n {\n relativePath: `typescript/tsconfig.json`,\n content: typescriptConfigFile(),\n },\n {\n relativePath: `typescript/styles.d.ts`,\n content: globalStylesFile(),\n },\n {\n relativePath: `typescript/ts-transformer.ts`,\n content: tsTransformerFile(),\n },\n {\n relativePath: `jest/jest.config.js`,\n content: jestConfigFile(),\n },\n ];\n },\n config: {\n 'teambit.envs/env': {},\n 'teambit.envs/envs': {\n env: 'teambit.envs/env',\n },\n },\n};\n"],"mappings":"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"}
|
|
File without changes
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ComponentContext } from '@teambit/generator';
|
|
2
|
-
|
|
3
|
-
export function appRoot(context: ComponentContext) {
|
|
4
|
-
return {
|
|
5
|
-
relativePath: `${context.name}.app-root.ts`,
|
|
6
|
-
content: `import Application from 'express';
|
|
7
|
-
import {getPort} from './get-port';
|
|
8
|
-
import {getMockRoute} from './mock-route';
|
|
9
|
-
|
|
10
|
-
export const expressApp = async () => {
|
|
11
|
-
const app = Application();
|
|
12
|
-
const port = await getPort();
|
|
13
|
-
registerRoutes(app);
|
|
14
|
-
app.listen(port, () => {
|
|
15
|
-
console.log(\`${context.name} app listening on port \${port}\`);
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
function registerRoutes(app: Application.Application) {
|
|
20
|
-
const mockRoute = getMockRoute();
|
|
21
|
-
const routes = [mockRoute];
|
|
22
|
-
routes.forEach(route => {
|
|
23
|
-
app[route.method](route.route, route.middlewares);
|
|
24
|
-
})
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
expressApp().catch(err => {
|
|
28
|
-
console.log('error from express', err);
|
|
29
|
-
process.exit(1);
|
|
30
|
-
});
|
|
31
|
-
`,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ComponentContext } from '@teambit/generator';
|
|
2
|
-
|
|
3
|
-
export function compositionFile(context: ComponentContext) {
|
|
4
|
-
return {
|
|
5
|
-
relativePath: `${context.name}.composition.tsx`,
|
|
6
|
-
content: `import React from 'react';
|
|
7
|
-
import { ${context.nameCamelCase} } from './${context.name}';
|
|
8
|
-
|
|
9
|
-
export function ReturnsCorrectValue() {
|
|
10
|
-
return <div>{${context.nameCamelCase}()}</div>;
|
|
11
|
-
}
|
|
12
|
-
`,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ComponentContext } from '@teambit/generator';
|
|
2
|
-
|
|
3
|
-
export function docFile({ name, componentId }: ComponentContext) {
|
|
4
|
-
return {
|
|
5
|
-
relativePath: `${name}.docs.mdx`,
|
|
6
|
-
content: `---
|
|
7
|
-
labels: ['express', 'node', 'service', 'app']
|
|
8
|
-
description: 'A general purpose bit express application'
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
Configure the app plugin on your workspace:
|
|
12
|
-
|
|
13
|
-
\`\`\`json
|
|
14
|
-
"${componentId.toString()}": {},
|
|
15
|
-
\`\`\`
|
|
16
|
-
|
|
17
|
-
### Run the application
|
|
18
|
-
|
|
19
|
-
You can run your application on a separate port to see it outside of the Bit workspace
|
|
20
|
-
|
|
21
|
-
\`\`\`bash
|
|
22
|
-
bit run ${name}
|
|
23
|
-
\`\`\`
|
|
24
|
-
`,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export function getPort() {
|
|
2
|
-
return {
|
|
3
|
-
relativePath: `get-port.ts`,
|
|
4
|
-
content: `export async function getPort() {
|
|
5
|
-
if (process.env.PORT){
|
|
6
|
-
return process.env.PORT;
|
|
7
|
-
}
|
|
8
|
-
const myArgs = process.argv.slice(2);
|
|
9
|
-
return myArgs[0] || 3000;
|
|
10
|
-
}
|
|
11
|
-
`,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ComponentContext } from '@teambit/generator';
|
|
2
|
-
|
|
3
|
-
export function indexFile(context: ComponentContext) {
|
|
4
|
-
return {
|
|
5
|
-
relativePath: 'index.ts',
|
|
6
|
-
content: `export { expressApp } from './${context.name}.app-root';
|
|
7
|
-
export type { Route } from './route';
|
|
8
|
-
`,
|
|
9
|
-
isMain: true,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export function mockRoute() {
|
|
2
|
-
return {
|
|
3
|
-
relativePath: `mock-route.ts`,
|
|
4
|
-
content: `import type { Route } from './route';
|
|
5
|
-
|
|
6
|
-
export function getMockRoute(): Route {
|
|
7
|
-
return {
|
|
8
|
-
method: 'get',
|
|
9
|
-
route: '/',
|
|
10
|
-
middlewares: [async (req, res) => res.send('hello world')]
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
`,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ComponentContext } from '@teambit/generator';
|
|
2
|
-
|
|
3
|
-
export function nodeApp(context: ComponentContext) {
|
|
4
|
-
return {
|
|
5
|
-
relativePath: `${context.name}.node-app.ts`,
|
|
6
|
-
content: `import { NodeAppOptions } from '@teambit/node';
|
|
7
|
-
|
|
8
|
-
export const ${context.nameCamelCase}: NodeAppOptions = {
|
|
9
|
-
name: '${context.name}',
|
|
10
|
-
entry: require.resolve('./${context.name}.app-root'),
|
|
11
|
-
portRange: [3000, 4000]
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default ${context.nameCamelCase};
|
|
15
|
-
`,
|
|
16
|
-
};
|
|
17
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function route() {
|
|
2
|
-
return {
|
|
3
|
-
relativePath: `route.ts`,
|
|
4
|
-
content: `import express, { Request, Response } from 'express';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* define express Middleware
|
|
8
|
-
*/
|
|
9
|
-
export type Middleware = (req: Request, res: Response, next: express.NextFunction) => Promise<any>;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* express new Route
|
|
13
|
-
*/
|
|
14
|
-
export interface Route {
|
|
15
|
-
method: string;
|
|
16
|
-
route: string | RegExp;
|
|
17
|
-
middlewares: Middleware[];
|
|
18
|
-
}
|
|
19
|
-
`,
|
|
20
|
-
};
|
|
21
|
-
}
|