@teambit/node 0.0.591 → 0.0.595
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/dist/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/dist/node-app-options.d.ts +24 -0
- package/dist/node-app-options.js +3 -0
- package/dist/node-app-options.js.map +1 -0
- package/dist/node.app-type.d.ts +13 -0
- package/dist/node.app-type.js +33 -0
- package/dist/node.app-type.js.map +1 -0
- package/dist/node.application.d.ts +19 -0
- package/dist/node.application.js +84 -0
- package/dist/node.application.js.map +1 -0
- package/dist/node.main.runtime.d.ts +9 -1
- package/dist/node.main.runtime.js +35 -2
- package/dist/node.main.runtime.js.map +1 -1
- package/dist/templates/node-env/index.js +6 -0
- package/dist/templates/node-env/index.js.map +1 -1
- package/package-tar/teambit-node-0.0.595.tgz +0 -0
- package/package.json +20 -17
- package/templates/node-env/index.ts +6 -0
- package/package-tar/teambit-node-0.0.591.tgz +0 -0
package/dist/index.d.ts
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA","sourcesContent":["export type { NodeMain } from './node.main.runtime';\nexport type { NodeAppOptions, DeployContext } from './node-app-options';\nexport { NodeAspect, NodeAspect as default } from './node.aspect';\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Capsule } from '@teambit/isolator';
|
|
2
|
+
import { BuildContext } from '@teambit/builder';
|
|
3
|
+
export interface DeployContext extends BuildContext {
|
|
4
|
+
entry: string;
|
|
5
|
+
}
|
|
6
|
+
export declare type NodeAppOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* name of the application.
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* path to entry file of the application.
|
|
13
|
+
* e.g: '/index.js'
|
|
14
|
+
*/
|
|
15
|
+
entry: string;
|
|
16
|
+
/**
|
|
17
|
+
* ranges of ports to use to run the app server.
|
|
18
|
+
*/
|
|
19
|
+
portRange?: number[];
|
|
20
|
+
/**
|
|
21
|
+
* deploy function.
|
|
22
|
+
*/
|
|
23
|
+
deploy?: (context: DeployContext, capsule: Capsule) => Promise<void>;
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Logger } from '@teambit/logger';
|
|
2
|
+
import { ApplicationType } from '@teambit/application';
|
|
3
|
+
import { ReactEnv } from '@teambit/react';
|
|
4
|
+
import { NodeEnv } from './node.env';
|
|
5
|
+
import { NodeApp } from './node.application';
|
|
6
|
+
import type { NodeAppOptions } from './node-app-options';
|
|
7
|
+
export declare class NodeAppType implements ApplicationType<NodeAppOptions> {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
private nodeEnv;
|
|
10
|
+
private logger;
|
|
11
|
+
constructor(name: string, nodeEnv: NodeEnv & ReactEnv, logger: Logger);
|
|
12
|
+
createApp(options: NodeAppOptions): NodeApp;
|
|
13
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NodeAppType = void 0;
|
|
7
|
+
|
|
8
|
+
function _node() {
|
|
9
|
+
const data = require("./node.application");
|
|
10
|
+
|
|
11
|
+
_node = function () {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class NodeAppType {
|
|
19
|
+
constructor(name, nodeEnv, logger) {
|
|
20
|
+
this.name = name;
|
|
21
|
+
this.nodeEnv = nodeEnv;
|
|
22
|
+
this.logger = logger;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
createApp(options) {
|
|
26
|
+
return new (_node().NodeApp)(options.name, options.entry, options.portRange || [3000, 4000], this.nodeEnv, this.logger, options.deploy);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
exports.NodeAppType = NodeAppType;
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=node.app-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["node.app-type.ts"],"names":["NodeAppType","constructor","name","nodeEnv","logger","createApp","options","NodeApp","entry","portRange","deploy"],"mappings":";;;;;;;AAIA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,WAAN,CAA6D;AAClEC,EAAAA,WAAW,CAAUC,IAAV,EAAgCC,OAAhC,EAAqEC,MAArE,EAAqF;AAAA,SAA3EF,IAA2E,GAA3EA,IAA2E;AAAA,SAArDC,OAAqD,GAArDA,OAAqD;AAAA,SAAhBC,MAAgB,GAAhBA,MAAgB;AAAE;;AAElGC,EAAAA,SAAS,CAACC,OAAD,EAA0B;AACjC,WAAO,KAAIC,eAAJ,EACLD,OAAO,CAACJ,IADH,EAELI,OAAO,CAACE,KAFH,EAGLF,OAAO,CAACG,SAAR,IAAqB,CAAC,IAAD,EAAO,IAAP,CAHhB,EAIL,KAAKN,OAJA,EAKL,KAAKC,MALA,EAMLE,OAAO,CAACI,MANH,CAAP;AAQD;;AAZiE","sourcesContent":["import { Logger } from '@teambit/logger';\nimport { ApplicationType } from '@teambit/application';\nimport { ReactEnv } from '@teambit/react';\nimport { NodeEnv } from './node.env';\nimport { NodeApp } from './node.application';\nimport type { NodeAppOptions } from './node-app-options';\n\nexport class NodeAppType implements ApplicationType<NodeAppOptions> {\n constructor(readonly name: string, private nodeEnv: NodeEnv & ReactEnv, private logger: Logger) {}\n\n createApp(options: NodeAppOptions) {\n return new NodeApp(\n options.name,\n options.entry,\n options.portRange || [3000, 4000],\n this.nodeEnv,\n this.logger,\n options.deploy\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Logger } from '@teambit/logger';
|
|
2
|
+
import { Capsule } from '@teambit/isolator';
|
|
3
|
+
import { ReactEnv } from '@teambit/react';
|
|
4
|
+
import { Application } from '@teambit/application';
|
|
5
|
+
import { BuildContext } from '@teambit/builder';
|
|
6
|
+
import { NodeEnv } from './node.env';
|
|
7
|
+
import { DeployContext } from './node-app-options';
|
|
8
|
+
export declare class NodeApp implements Application {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly entry: string;
|
|
11
|
+
readonly portRange: number[];
|
|
12
|
+
readonly nodeEnv: NodeEnv & ReactEnv;
|
|
13
|
+
readonly logger: Logger;
|
|
14
|
+
readonly deploy?: ((context: DeployContext, capsule: Capsule) => Promise<void>) | undefined;
|
|
15
|
+
constructor(name: string, entry: string, portRange: number[], nodeEnv: NodeEnv & ReactEnv, logger: Logger, deploy?: ((context: DeployContext, capsule: Capsule) => Promise<void>) | undefined);
|
|
16
|
+
applicationType: string;
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
build(context: BuildContext): Promise<DeployContext>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.promise.js");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.NodeApp = void 0;
|
|
11
|
+
|
|
12
|
+
function _defineProperty2() {
|
|
13
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
+
|
|
15
|
+
_defineProperty2 = function () {
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function _child_process() {
|
|
23
|
+
const data = require("child_process");
|
|
24
|
+
|
|
25
|
+
_child_process = function () {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function _path() {
|
|
33
|
+
const data = require("path");
|
|
34
|
+
|
|
35
|
+
_path = function () {
|
|
36
|
+
return data;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return data;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
class NodeApp {
|
|
43
|
+
constructor(name, entry, portRange, nodeEnv, logger, deploy) {
|
|
44
|
+
this.name = name;
|
|
45
|
+
this.entry = entry;
|
|
46
|
+
this.portRange = portRange;
|
|
47
|
+
this.nodeEnv = nodeEnv;
|
|
48
|
+
this.logger = logger;
|
|
49
|
+
this.deploy = deploy;
|
|
50
|
+
(0, _defineProperty2().default)(this, "applicationType", 'node');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async run() {
|
|
54
|
+
var _child$stdout;
|
|
55
|
+
|
|
56
|
+
const logger = this.logger;
|
|
57
|
+
const child = (0, _child_process().execFile)('node', [this.entry], error => {
|
|
58
|
+
if (error) {
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
(_child$stdout = child.stdout) === null || _child$stdout === void 0 ? void 0 : _child$stdout.on('data', function (data) {
|
|
63
|
+
logger.console(data.toString());
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async build(context) {
|
|
68
|
+
const {
|
|
69
|
+
base
|
|
70
|
+
} = (0, _path().parse)(this.entry);
|
|
71
|
+
const {
|
|
72
|
+
distDir
|
|
73
|
+
} = this.nodeEnv.getCompiler();
|
|
74
|
+
const entry = (0, _path().join)(distDir, base);
|
|
75
|
+
return Object.assign(context, {
|
|
76
|
+
entry
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
exports.NodeApp = NodeApp;
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=node.application.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["node.application.ts"],"names":["NodeApp","constructor","name","entry","portRange","nodeEnv","logger","deploy","run","child","error","stdout","on","data","console","toString","build","context","base","distDir","getCompiler","Object","assign"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AASO,MAAMA,OAAN,CAAqC;AAC1CC,EAAAA,WAAW,CACAC,IADA,EAEAC,KAFA,EAGAC,SAHA,EAIAC,OAJA,EAKAC,MALA,EAMAC,MANA,EAOT;AAAA,SANSL,IAMT,GANSA,IAMT;AAAA,SALSC,KAKT,GALSA,KAKT;AAAA,SAJSC,SAIT,GAJSA,SAIT;AAAA,SAHSC,OAGT,GAHSA,OAGT;AAAA,SAFSC,MAET,GAFSA,MAET;AAAA,SADSC,MACT,GADSA,MACT;AAAA,6DAEgB,MAFhB;AAAE;;AAIK,QAAHC,GAAG,GAAkB;AAAA;;AACzB,UAAMF,MAAM,GAAG,KAAKA,MAApB;AACA,UAAMG,KAAK,GAAG,+BAAS,MAAT,EAAiB,CAAC,KAAKN,KAAN,CAAjB,EAAgCO,KAAD,IAAW;AACtD,UAAIA,KAAJ,EAAW;AACT,cAAMA,KAAN;AACD;AACF,KAJa,CAAd;AAKA,qBAAAD,KAAK,CAACE,MAAN,gEAAcC,EAAd,CAAiB,MAAjB,EAAyB,UAAUC,IAAV,EAAgB;AACvCP,MAAAA,MAAM,CAACQ,OAAP,CAAeD,IAAI,CAACE,QAAL,EAAf;AACD,KAFD;AAGD;;AAEU,QAALC,KAAK,CAACC,OAAD,EAAgD;AACzD,UAAM;AAAEC,MAAAA;AAAF,QAAW,mBAAM,KAAKf,KAAX,CAAjB;AACA,UAAM;AAAEgB,MAAAA;AAAF,QAAc,KAAKd,OAAL,CAAae,WAAb,EAApB;AACA,UAAMjB,KAAK,GAAG,kBAAKgB,OAAL,EAAcD,IAAd,CAAd;AACA,WAAOG,MAAM,CAACC,MAAP,CAAcL,OAAd,EAAuB;AAAEd,MAAAA;AAAF,KAAvB,CAAP;AACD;;AA7ByC","sourcesContent":["import { execFile } from 'child_process';\nimport { parse, join } from 'path';\nimport { Logger } from '@teambit/logger';\nimport { Capsule } from '@teambit/isolator';\nimport { ReactEnv } from '@teambit/react';\nimport { Application } from '@teambit/application';\nimport { BuildContext } from '@teambit/builder';\nimport { NodeEnv } from './node.env';\nimport { DeployContext } from './node-app-options';\n\nexport class NodeApp implements Application {\n constructor(\n readonly name: string,\n readonly entry: string,\n readonly portRange: number[],\n readonly nodeEnv: NodeEnv & ReactEnv,\n readonly logger: Logger,\n readonly deploy?: (context: DeployContext, capsule: Capsule) => Promise<void>\n ) {}\n\n applicationType = 'node';\n\n async run(): Promise<void> {\n const logger = this.logger;\n const child = execFile('node', [this.entry], (error) => {\n if (error) {\n throw error;\n }\n });\n child.stdout?.on('data', function (data) {\n logger.console(data.toString());\n });\n }\n\n async build(context: BuildContext): Promise<DeployContext> {\n const { base } = parse(this.entry);\n const { distDir } = this.nodeEnv.getCompiler();\n const entry = join(distDir, base);\n return Object.assign(context, { entry });\n }\n}\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { VariantPolicyConfigObject } from '@teambit/dependency-resolver';
|
|
2
2
|
import { TsConfigSourceFile } from 'typescript';
|
|
3
3
|
import type { TsCompilerOptionsWithoutTsConfig } from '@teambit/typescript';
|
|
4
|
+
import { ApplicationMain } from '@teambit/application';
|
|
5
|
+
import { LoggerMain } from '@teambit/logger';
|
|
4
6
|
import { GeneratorMain } from '@teambit/generator';
|
|
5
7
|
import { BuildTask } from '@teambit/builder';
|
|
6
8
|
import { Compiler } from '@teambit/compiler';
|
|
@@ -83,5 +85,11 @@ export declare class NodeMain {
|
|
|
83
85
|
compose(transformers: EnvTransformer[], targetEnv?: Environment): Environment;
|
|
84
86
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
85
87
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
86
|
-
static provider([envs, react, generator]: [
|
|
88
|
+
static provider([loggerAspect, envs, application, react, generator]: [
|
|
89
|
+
LoggerMain,
|
|
90
|
+
EnvsMain,
|
|
91
|
+
ApplicationMain,
|
|
92
|
+
ReactMain,
|
|
93
|
+
GeneratorMain
|
|
94
|
+
]): Promise<NodeMain>;
|
|
87
95
|
}
|
|
@@ -31,6 +31,26 @@ function _lodash() {
|
|
|
31
31
|
return data;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
function _application() {
|
|
35
|
+
const data = require("@teambit/application");
|
|
36
|
+
|
|
37
|
+
_application = function () {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function _logger() {
|
|
45
|
+
const data = require("@teambit/logger");
|
|
46
|
+
|
|
47
|
+
_logger = function () {
|
|
48
|
+
return data;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return data;
|
|
52
|
+
}
|
|
53
|
+
|
|
34
54
|
function _cli() {
|
|
35
55
|
const data = require("@teambit/cli");
|
|
36
56
|
|
|
@@ -111,6 +131,16 @@ function _node3() {
|
|
|
111
131
|
return data;
|
|
112
132
|
}
|
|
113
133
|
|
|
134
|
+
function _node4() {
|
|
135
|
+
const data = require("./node.app-type");
|
|
136
|
+
|
|
137
|
+
_node4 = function () {
|
|
138
|
+
return data;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
return data;
|
|
142
|
+
}
|
|
143
|
+
|
|
114
144
|
class NodeMain {
|
|
115
145
|
constructor(react, nodeEnv, envs) {
|
|
116
146
|
this.react = react;
|
|
@@ -157,9 +187,12 @@ class NodeMain {
|
|
|
157
187
|
return this.envs.compose(this.envs.merge(targetEnv, this.nodeEnv), transformers);
|
|
158
188
|
}
|
|
159
189
|
|
|
160
|
-
static async provider([envs, react, generator]) {
|
|
190
|
+
static async provider([loggerAspect, envs, application, react, generator]) {
|
|
191
|
+
const logger = loggerAspect.createLogger(_node().NodeAspect.id);
|
|
161
192
|
const nodeEnv = envs.merge(new (_node2().NodeEnv)(), react.reactEnv);
|
|
162
193
|
envs.registerEnv(nodeEnv);
|
|
194
|
+
const nodeAppType = new (_node4().NodeAppType)('node-app', nodeEnv, logger);
|
|
195
|
+
application.registerAppType(nodeAppType);
|
|
163
196
|
generator.registerComponentTemplate([_nodeEnv().nodeEnvTemplate, _node3().nodeTemplate]);
|
|
164
197
|
return new NodeMain(react, nodeEnv, envs);
|
|
165
198
|
}
|
|
@@ -168,7 +201,7 @@ class NodeMain {
|
|
|
168
201
|
|
|
169
202
|
exports.NodeMain = NodeMain;
|
|
170
203
|
(0, _defineProperty2().default)(NodeMain, "runtime", _cli().MainRuntime);
|
|
171
|
-
(0, _defineProperty2().default)(NodeMain, "dependencies", [_envs().EnvsAspect, _react().ReactAspect, _generator().GeneratorAspect]);
|
|
204
|
+
(0, _defineProperty2().default)(NodeMain, "dependencies", [_logger().LoggerAspect, _envs().EnvsAspect, _application().ApplicationAspect, _react().ReactAspect, _generator().GeneratorAspect]);
|
|
172
205
|
|
|
173
206
|
_node().NodeAspect.addRuntime(NodeMain);
|
|
174
207
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["node.main.runtime.ts"],"names":["NodeMain","constructor","react","nodeEnv","envs","overrideTsConfig","bind","overrideJestConfig","overrideBuildPipe","overrideCompiler","overrideCompilerTasks","overrideBuildTsConfig","overridePackageJsonProps","overridePreviewConfig","overrideDevServerConfig","useTypescript","useWebpack","usePrettier","useEslint","overrideMounter","icon","overrideDependencies","dependencyPolicy","override","getDependencies","compose","transformers","targetEnv","merge","provider","generator","NodeEnv","reactEnv","registerEnv","registerComponentTemplate","nodeEnvTemplate","nodeTemplate","MainRuntime","EnvsAspect","
|
|
1
|
+
{"version":3,"sources":["node.main.runtime.ts"],"names":["NodeMain","constructor","react","nodeEnv","envs","overrideTsConfig","bind","overrideJestConfig","overrideBuildPipe","overrideCompiler","overrideCompilerTasks","overrideBuildTsConfig","overridePackageJsonProps","overridePreviewConfig","overrideDevServerConfig","useTypescript","useWebpack","usePrettier","useEslint","overrideMounter","icon","overrideDependencies","dependencyPolicy","override","getDependencies","compose","transformers","targetEnv","merge","provider","loggerAspect","application","generator","logger","createLogger","NodeAspect","id","NodeEnv","reactEnv","registerEnv","nodeAppType","NodeAppType","registerAppType","registerComponentTemplate","nodeEnvTemplate","nodeTemplate","MainRuntime","LoggerAspect","EnvsAspect","ApplicationAspect","ReactAspect","GeneratorAspect","addRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;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;;AAIA;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,QAAN,CAAe;AACpBC,EAAAA,WAAW,CACDC,KADC,EAGAC,OAHA,EAKDC,IALC,EAMT;AAAA,SALQF,KAKR,GALQA,KAKR;AAAA,SAHSC,OAGT,G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P;AACD;;AAhImB;;;gCAATJ,Q,aA+GM8C,kB;gCA/GN9C,Q,kBAgHW,CAAC+C,sBAAD,EAAeC,kBAAf,EAA2BC,gCAA3B,EAA8CC,oBAA9C,EAA2DC,4BAA3D,C;;AAmBxBhB,mBAAWiB,UAAX,CAAsBpD,QAAtB","sourcesContent":["import { VariantPolicyConfigObject } from '@teambit/dependency-resolver';\nimport { merge } from 'lodash';\nimport { TsConfigSourceFile } from 'typescript';\nimport type { TsCompilerOptionsWithoutTsConfig } from '@teambit/typescript';\nimport { ApplicationAspect, ApplicationMain } from '@teambit/application';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { MainRuntime } from '@teambit/cli';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { BuildTask } from '@teambit/builder';\nimport { Compiler } from '@teambit/compiler';\nimport { PackageJsonProps } from '@teambit/pkg';\nimport { EnvsAspect, EnvsMain, EnvTransformer, Environment } from '@teambit/envs';\nimport { ReactAspect, ReactEnv, ReactMain } from '@teambit/react';\nimport { NodeAspect } from './node.aspect';\nimport { NodeEnv } from './node.env';\nimport { nodeEnvTemplate } from './templates/node-env';\nimport { nodeTemplate } from './templates/node';\nimport { NodeAppType } from './node.app-type';\n\nexport class NodeMain {\n constructor(\n private react: ReactMain,\n\n readonly nodeEnv: NodeEnv,\n\n private envs: EnvsMain\n ) {}\n\n icon() {\n return 'https://static.bit.dev/extensions-icons/nodejs.svg';\n }\n\n /**\n * @deprecated use useTypescript()\n * override the TS config of the environment.\n */\n overrideTsConfig: (\n tsconfig: TsConfigSourceFile,\n compilerOptions?: Partial<TsCompilerOptionsWithoutTsConfig>,\n tsModule?: any\n ) => EnvTransformer = this.react.overrideTsConfig.bind(this.react);\n\n /**\n * override the jest config of the environment.\n */\n overrideJestConfig = this.react.overrideJestConfig.bind(this.react);\n\n /**\n * override the env build pipeline.\n */\n overrideBuildPipe: (tasks: BuildTask[]) => EnvTransformer = this.react.overrideBuildPipe.bind(this.react);\n\n /**\n * override the env compilers list.\n */\n overrideCompiler: (compiler: Compiler) => EnvTransformer = this.react.overrideCompiler.bind(this.react);\n\n /**\n * override the env compilers tasks in the build pipe.\n */\n overrideCompilerTasks: (tasks: BuildTask[]) => EnvTransformer = this.react.overrideCompilerTasks.bind(this.react);\n\n /**\n * @deprecated use useTypescript()\n * override the build ts config.\n */\n overrideBuildTsConfig: (\n tsconfig: any,\n compilerOptions?: Partial<TsCompilerOptionsWithoutTsConfig>\n ) => EnvTransformer = this.react.overrideBuildTsConfig.bind(this.react);\n\n /**\n * override package json properties.\n */\n overridePackageJsonProps: (props: PackageJsonProps) => EnvTransformer = this.react.overridePackageJsonProps.bind(\n this.react\n );\n\n /**\n * @deprecated - use useWebpack\n * override the preview config in the env.\n */\n overridePreviewConfig = this.react.overridePreviewConfig.bind(this.react);\n\n /**\n * @deprecated - use useWebpack\n * override the dev server configuration.\n */\n overrideDevServerConfig = this.react.overrideDevServerConfig.bind(this.react);\n\n /**\n * override the env's typescript config for both dev and build time.\n * Replaces both overrideTsConfig (devConfig) and overrideBuildTsConfig (buildConfig)\n */\n useTypescript = this.react.useTypescript.bind(this.react);\n\n /**\n * override the env's dev server and preview webpack configurations.\n * Replaces both overrideDevServerConfig and overridePreviewConfig\n */\n useWebpack = this.react.useWebpack.bind(this.react);\n\n /**\n * An API to mutate the prettier config\n */\n usePrettier = this.react.usePrettier.bind(this.react);\n\n /**\n * An API to mutate the eslint config\n */\n useEslint = this.react.useEslint.bind(this.react);\n\n /**\n * override the dependency configuration of the component environment.\n */\n overrideDependencies(dependencyPolicy: VariantPolicyConfigObject) {\n return this.envs.override({\n getDependencies: () => merge(dependencyPolicy, this.nodeEnv.getDependencies()),\n });\n }\n\n overrideMounter = this.react.overrideMounter.bind(this.react);\n\n /**\n * create a new composition of the node environment.\n */\n compose(transformers: EnvTransformer[], targetEnv: Environment = {}) {\n return this.envs.compose(this.envs.merge(targetEnv, this.nodeEnv), transformers);\n }\n\n static runtime = MainRuntime;\n static dependencies = [LoggerAspect, EnvsAspect, ApplicationAspect, ReactAspect, GeneratorAspect];\n\n static async provider([loggerAspect, envs, application, react, generator]: [\n LoggerMain,\n EnvsMain,\n ApplicationMain,\n ReactMain,\n GeneratorMain\n ]) {\n const logger = loggerAspect.createLogger(NodeAspect.id);\n const nodeEnv = envs.merge<NodeEnv, ReactEnv>(new NodeEnv(), react.reactEnv);\n envs.registerEnv(nodeEnv);\n const nodeAppType = new NodeAppType('node-app', nodeEnv, logger);\n application.registerAppType(nodeAppType);\n generator.registerComponentTemplate([nodeEnvTemplate, nodeTemplate]);\n return new NodeMain(react, nodeEnv, envs);\n }\n}\n\nNodeAspect.addRuntime(NodeMain);\n"]}
|
|
@@ -50,6 +50,12 @@ const nodeEnvTemplate = {
|
|
|
50
50
|
relativePath: `${context.name}.extension.ts`,
|
|
51
51
|
content: (0, _extension().extensionFile)(context)
|
|
52
52
|
}];
|
|
53
|
+
},
|
|
54
|
+
config: {
|
|
55
|
+
'teambit.harmony/aspect': {},
|
|
56
|
+
'teambit.envs/envs': {
|
|
57
|
+
env: 'teambit.harmony/aspect'
|
|
58
|
+
}
|
|
53
59
|
}
|
|
54
60
|
};
|
|
55
61
|
exports.nodeEnvTemplate = nodeEnvTemplate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["nodeEnvTemplate","name","description","generateFiles","context","relativePath","content","isMain"],"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
|
|
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"]}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/node",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.595",
|
|
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.
|
|
9
|
+
"version": "0.0.595"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.2.11",
|
|
@@ -14,19 +14,22 @@
|
|
|
14
14
|
"typescript": "4.4.2",
|
|
15
15
|
"@babel/runtime": "7.12.18",
|
|
16
16
|
"core-js": "^3.0.0",
|
|
17
|
-
"@teambit/
|
|
18
|
-
"@teambit/
|
|
19
|
-
"@teambit/
|
|
20
|
-
"@teambit/
|
|
21
|
-
"@teambit/
|
|
22
|
-
"@teambit/
|
|
23
|
-
"@teambit/
|
|
24
|
-
"@teambit/
|
|
25
|
-
"@teambit/
|
|
26
|
-
"@teambit/
|
|
17
|
+
"@teambit/builder": "0.0.595",
|
|
18
|
+
"@teambit/isolator": "0.0.595",
|
|
19
|
+
"@teambit/application": "0.0.237",
|
|
20
|
+
"@teambit/logger": "0.0.497",
|
|
21
|
+
"@teambit/react": "0.0.595",
|
|
22
|
+
"@teambit/dependency-resolver": "0.0.595",
|
|
23
|
+
"@teambit/envs": "0.0.595",
|
|
24
|
+
"@teambit/cli": "0.0.409",
|
|
25
|
+
"@teambit/compiler": "0.0.595",
|
|
26
|
+
"@teambit/generator": "0.0.595",
|
|
27
|
+
"@teambit/pkg": "0.0.595",
|
|
28
|
+
"@teambit/typescript": "0.0.595",
|
|
29
|
+
"@teambit/compositions": "0.0.595",
|
|
27
30
|
"@teambit/design.ui.empty-box": "0.0.352",
|
|
28
|
-
"@teambit/tester": "0.0.
|
|
29
|
-
"@teambit/ui": "0.0.
|
|
31
|
+
"@teambit/tester": "0.0.595",
|
|
32
|
+
"@teambit/ui": "0.0.595"
|
|
30
33
|
},
|
|
31
34
|
"devDependencies": {
|
|
32
35
|
"@types/react": "^17.0.8",
|
|
@@ -36,10 +39,10 @@
|
|
|
36
39
|
"@types/jest": "^26.0.0",
|
|
37
40
|
"@types/react-dom": "^17.0.5",
|
|
38
41
|
"@types/node": "12.20.4",
|
|
39
|
-
"@teambit/harmony.aspect-docs.node": "0.0.
|
|
42
|
+
"@teambit/harmony.aspect-docs.node": "0.0.130"
|
|
40
43
|
},
|
|
41
44
|
"peerDependencies": {
|
|
42
|
-
"@teambit/legacy": "1.0.
|
|
45
|
+
"@teambit/legacy": "1.0.196",
|
|
43
46
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
44
47
|
"react": "^16.8.0 || ^17.0.0"
|
|
45
48
|
},
|
|
@@ -67,7 +70,7 @@
|
|
|
67
70
|
"react": "-"
|
|
68
71
|
},
|
|
69
72
|
"peerDependencies": {
|
|
70
|
-
"@teambit/legacy": "1.0.
|
|
73
|
+
"@teambit/legacy": "1.0.196",
|
|
71
74
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
72
75
|
"react": "^16.8.0 || ^17.0.0"
|
|
73
76
|
}
|
|
Binary file
|