@atls/code-service 0.0.5 → 0.0.10
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.js +2 -2
- package/dist/service.js +96 -0
- package/dist/webpack/externals.js +25 -25
- package/dist/webpack/resolve.js +2 -3
- package/dist/webpack/webpack.config.js +11 -8
- package/dist/webpack.config.js +100 -0
- package/dist/webpack.externals.js +39 -0
- package/package.json +21 -23
- package/dist/build.d.ts +0 -8
- package/dist/build.js +0 -41
- package/dist/index.d.ts +0 -2
- package/dist/watch.d.ts +0 -5
- package/dist/watch.js +0 -14
- package/dist/webpack/externals.d.ts +0 -3
- package/dist/webpack/index.d.ts +0 -1
- package/dist/webpack/resolve.d.ts +0 -1
- package/dist/webpack/webpack.config.d.ts +0 -6
- package/tsconfig.stub.json +0 -1
package/dist/index.js
CHANGED
|
@@ -10,5 +10,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./
|
|
14
|
-
__exportStar(require("./
|
|
13
|
+
__exportStar(require("./webpack.config"), exports);
|
|
14
|
+
__exportStar(require("./service"), exports);
|
package/dist/service.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Service = void 0;
|
|
7
|
+
const node_stream_1 = require("node:stream");
|
|
8
|
+
const webpack_1 = __importDefault(require("webpack"));
|
|
9
|
+
const webpack_start_server_plugin_1 = require("@atls/webpack-start-server-plugin");
|
|
10
|
+
const webpack_config_1 = require("./webpack.config");
|
|
11
|
+
class Service {
|
|
12
|
+
constructor(cwd) {
|
|
13
|
+
this.cwd = cwd;
|
|
14
|
+
}
|
|
15
|
+
async build(plugins = []) {
|
|
16
|
+
const config = new webpack_config_1.WebpackConfig(this.cwd);
|
|
17
|
+
const compiler = (0, webpack_1.default)(await config.build());
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
compiler.run((error, stats) => {
|
|
20
|
+
if (error) {
|
|
21
|
+
if (!error.message) {
|
|
22
|
+
reject(error);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
resolve({
|
|
26
|
+
errors: [{ message: error.message }],
|
|
27
|
+
warnings: [],
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else if (stats) {
|
|
32
|
+
const { errors = [], warnings = [] } = stats.toJson();
|
|
33
|
+
resolve({
|
|
34
|
+
errors: errors.map((error) => ({ message: error.message })),
|
|
35
|
+
warnings: warnings.map((warning) => ({ message: warning.message })),
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
resolve({
|
|
40
|
+
errors: [],
|
|
41
|
+
warnings: [],
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
async watch(callback) {
|
|
48
|
+
const config = new webpack_config_1.WebpackConfig(this.cwd);
|
|
49
|
+
const pass = new node_stream_1.PassThrough();
|
|
50
|
+
pass.on('data', (chunk) => {
|
|
51
|
+
chunk
|
|
52
|
+
.toString()
|
|
53
|
+
.split(/\r?\n/)
|
|
54
|
+
.filter(Boolean)
|
|
55
|
+
.forEach((row) => {
|
|
56
|
+
try {
|
|
57
|
+
callback(JSON.parse(row));
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
callback({ body: row });
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
return (0, webpack_1.default)(await config.build('development', [
|
|
65
|
+
{
|
|
66
|
+
name: 'start-server',
|
|
67
|
+
use: webpack_start_server_plugin_1.StartServerPlugin,
|
|
68
|
+
args: [
|
|
69
|
+
{
|
|
70
|
+
stdout: pass,
|
|
71
|
+
stderr: pass,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
])).watch({}, (error, stats) => {
|
|
76
|
+
if (error) {
|
|
77
|
+
callback({
|
|
78
|
+
severityText: 'ERROR',
|
|
79
|
+
body: error.message || error,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else if (stats) {
|
|
83
|
+
const { errors = [], warnings = [] } = stats.toJson();
|
|
84
|
+
warnings.forEach((warning) => callback({
|
|
85
|
+
severityText: 'WARN',
|
|
86
|
+
body: warning.message,
|
|
87
|
+
}));
|
|
88
|
+
errors.forEach((err) => callback({
|
|
89
|
+
severityText: 'ERROR',
|
|
90
|
+
body: err.message,
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.Service = Service;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getExternals = exports.
|
|
6
|
+
exports.getExternals = exports.getUnpluggedDependencies = exports.unusedExternals = void 0;
|
|
7
7
|
const core_1 = require("@yarnpkg/core");
|
|
8
8
|
const core_2 = require("@yarnpkg/core");
|
|
9
9
|
const cli_1 = require("@yarnpkg/cli");
|
|
@@ -20,26 +20,6 @@ const FORCE_UNPLUGGED_PACKAGES = new Set([
|
|
|
20
20
|
'core-js-pure',
|
|
21
21
|
'protobufjs',
|
|
22
22
|
]);
|
|
23
|
-
const getUnpluggedDependencies = async () => {
|
|
24
|
-
const configuration = await core_1.Configuration.find(process.cwd(), cli_1.getPluginConfiguration());
|
|
25
|
-
const entries = await fast_glob_1.default('*/node_modules/*/package.json', {
|
|
26
|
-
cwd: configuration.get(`pnpUnpluggedFolder`),
|
|
27
|
-
});
|
|
28
|
-
const dependenciesNames = new Set();
|
|
29
|
-
await Promise.all(entries
|
|
30
|
-
.map((entry) => path_1.default.join(configuration.get(`pnpUnpluggedFolder`), entry))
|
|
31
|
-
.map(async (entry) => {
|
|
32
|
-
try {
|
|
33
|
-
const { name } = JSON.parse((await fs_1.promises.readFile(entry)).toString());
|
|
34
|
-
if (name && !FORCE_UNPLUGGED_PACKAGES.has(name)) {
|
|
35
|
-
dependenciesNames.add(name);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
catch (_a) { }
|
|
39
|
-
}));
|
|
40
|
-
return dependenciesNames;
|
|
41
|
-
};
|
|
42
|
-
exports.getUnpluggedDependencies = getUnpluggedDependencies;
|
|
43
23
|
exports.unusedExternals = [
|
|
44
24
|
'cli-color',
|
|
45
25
|
'flaschenpost',
|
|
@@ -66,13 +46,33 @@ exports.unusedExternals = [
|
|
|
66
46
|
'pnpapi',
|
|
67
47
|
'next',
|
|
68
48
|
];
|
|
49
|
+
const getUnpluggedDependencies = async () => {
|
|
50
|
+
const configuration = await core_1.Configuration.find(process.cwd(), (0, cli_1.getPluginConfiguration)());
|
|
51
|
+
const pnpUnpluggedFolder = configuration.get('pnpUnpluggedFolder');
|
|
52
|
+
const dependenciesNames = new Set();
|
|
53
|
+
const entries = await (0, fast_glob_1.default)('*/node_modules/*/package.json', {
|
|
54
|
+
cwd: pnpUnpluggedFolder,
|
|
55
|
+
});
|
|
56
|
+
await Promise.all(entries
|
|
57
|
+
.map((entry) => path_1.default.join(pnpUnpluggedFolder, entry))
|
|
58
|
+
.map(async (entry) => {
|
|
59
|
+
try {
|
|
60
|
+
const { name } = JSON.parse((await fs_1.promises.readFile(entry)).toString());
|
|
61
|
+
if (name && !FORCE_UNPLUGGED_PACKAGES.has(name)) {
|
|
62
|
+
dependenciesNames.add(name);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch { }
|
|
66
|
+
}));
|
|
67
|
+
return dependenciesNames;
|
|
68
|
+
};
|
|
69
|
+
exports.getUnpluggedDependencies = getUnpluggedDependencies;
|
|
69
70
|
const getExternals = async (cwd) => {
|
|
70
|
-
|
|
71
|
-
const configuration = await core_1.Configuration.find(process.cwd(), cli_1.getPluginConfiguration());
|
|
71
|
+
const configuration = await core_1.Configuration.find(process.cwd(), (0, cli_1.getPluginConfiguration)());
|
|
72
72
|
const { project } = await core_2.Project.find(configuration, process.cwd());
|
|
73
73
|
const workspace = project.getWorkspaceByFilePath(cwd);
|
|
74
|
-
const workspaceExternals = Object.keys(
|
|
75
|
-
const unpluggedExternals = Array.from(await exports.getUnpluggedDependencies());
|
|
74
|
+
const workspaceExternals = Object.keys(workspace?.manifest?.raw?.externalDependencies || {});
|
|
75
|
+
const unpluggedExternals = Array.from(await (0, exports.getUnpluggedDependencies)());
|
|
76
76
|
return Array.from(new Set([...workspaceExternals, ...unpluggedExternals, ...exports.unusedExternals]));
|
|
77
77
|
};
|
|
78
78
|
exports.getExternals = getExternals;
|
package/dist/webpack/resolve.js
CHANGED
|
@@ -5,10 +5,9 @@ const core_1 = require("@yarnpkg/core");
|
|
|
5
5
|
const core_2 = require("@yarnpkg/core");
|
|
6
6
|
const cli_1 = require("@yarnpkg/cli");
|
|
7
7
|
const getResolveAliases = async (cwd) => {
|
|
8
|
-
|
|
9
|
-
const configuration = await core_1.Configuration.find(process.cwd(), cli_1.getPluginConfiguration());
|
|
8
|
+
const configuration = await core_1.Configuration.find(process.cwd(), (0, cli_1.getPluginConfiguration)());
|
|
10
9
|
const { project } = await core_2.Project.find(configuration, process.cwd());
|
|
11
10
|
const workspace = project.getWorkspaceByFilePath(cwd);
|
|
12
|
-
return
|
|
11
|
+
return workspace?.manifest?.raw?.resolve?.alias || [];
|
|
13
12
|
};
|
|
14
13
|
exports.getResolveAliases = getResolveAliases;
|
|
@@ -4,14 +4,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createWebpackConfig = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
7
8
|
const webpack_chain_1 = __importDefault(require("webpack-chain"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const webpack_1 = __importDefault(require("webpack"));
|
|
10
|
-
const
|
|
10
|
+
const config_typescript_1 = __importDefault(require("@atls/config-typescript"));
|
|
11
11
|
const externals_1 = require("./externals");
|
|
12
12
|
const resolve_1 = require("./resolve");
|
|
13
13
|
const createWebpackConfig = async (cwd, environment, plugins = []) => {
|
|
14
|
-
const externals = (await externals_1.getExternals(cwd)).reduce((result, dependency) => (
|
|
14
|
+
const externals = (await (0, externals_1.getExternals)(cwd)).reduce((result, dependency) => ({
|
|
15
|
+
...result,
|
|
16
|
+
[dependency]: `commonjs2 ${dependency}`,
|
|
17
|
+
}), {});
|
|
15
18
|
const config = new webpack_chain_1.default();
|
|
16
19
|
config
|
|
17
20
|
.mode(environment)
|
|
@@ -19,10 +22,10 @@ const createWebpackConfig = async (cwd, environment, plugins = []) => {
|
|
|
19
22
|
.target('async-node')
|
|
20
23
|
.optimization.minimize(false);
|
|
21
24
|
config.node.set('__dirname', false).set('__filename', false);
|
|
22
|
-
config.entry('index').add(
|
|
23
|
-
config.output.path(
|
|
25
|
+
config.entry('index').add(node_path_1.default.join(cwd, 'src/index'));
|
|
26
|
+
config.output.path(node_path_1.default.join(cwd, 'dist')).filename('[name].js');
|
|
24
27
|
config.resolve.extensions.add('.tsx').add('.ts').add('.js');
|
|
25
|
-
const aliases = await resolve_1.getResolveAliases(cwd);
|
|
28
|
+
const aliases = await (0, resolve_1.getResolveAliases)(cwd);
|
|
26
29
|
aliases.forEach((target) => {
|
|
27
30
|
config.resolve.alias.set(target, require.resolve(target, { paths: [cwd] }));
|
|
28
31
|
});
|
|
@@ -41,8 +44,8 @@ const createWebpackConfig = async (cwd, environment, plugins = []) => {
|
|
|
41
44
|
.options({
|
|
42
45
|
transpileOnly: true,
|
|
43
46
|
experimentalWatchApi: true,
|
|
44
|
-
compilerOptions:
|
|
45
|
-
configFile:
|
|
47
|
+
compilerOptions: { ...config_typescript_1.default.compilerOptions, sourceMap: true },
|
|
48
|
+
configFile: node_path_1.default.join(__dirname, '../../tsconfig.stub.json'),
|
|
46
49
|
});
|
|
47
50
|
config.module
|
|
48
51
|
.rule('protos')
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WebpackConfig = void 0;
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const promises_1 = require("node:fs/promises");
|
|
9
|
+
const core_1 = require("@yarnpkg/core");
|
|
10
|
+
const core_2 = require("@yarnpkg/core");
|
|
11
|
+
const cli_1 = require("@yarnpkg/cli");
|
|
12
|
+
const webpack_chain_1 = __importDefault(require("webpack-chain"));
|
|
13
|
+
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
14
|
+
const webpack_1 = require("webpack");
|
|
15
|
+
const config_typescript_1 = __importDefault(require("@atls/config-typescript"));
|
|
16
|
+
const webpack_externals_1 = require("./webpack.externals");
|
|
17
|
+
const webpack_externals_2 = require("./webpack.externals");
|
|
18
|
+
class WebpackConfig {
|
|
19
|
+
constructor(cwd) {
|
|
20
|
+
this.cwd = cwd;
|
|
21
|
+
}
|
|
22
|
+
async build(environment = 'production', plugins = []) {
|
|
23
|
+
const root = process.cwd();
|
|
24
|
+
const configuration = await core_1.Configuration.find(root, (0, cli_1.getPluginConfiguration)());
|
|
25
|
+
const { project } = await core_2.Project.find(configuration, root);
|
|
26
|
+
const config = new webpack_chain_1.default();
|
|
27
|
+
this.applyCommon(config, environment);
|
|
28
|
+
this.applyPlugins(config, environment);
|
|
29
|
+
this.applyModules(config);
|
|
30
|
+
config.externals(await this.getExternals(configuration, project));
|
|
31
|
+
plugins.forEach((plugin) => {
|
|
32
|
+
config.plugin(plugin.name).use(plugin.use, plugin.args);
|
|
33
|
+
});
|
|
34
|
+
return config.toConfig();
|
|
35
|
+
}
|
|
36
|
+
applyCommon(config, environment) {
|
|
37
|
+
config
|
|
38
|
+
.mode(environment)
|
|
39
|
+
.bail(environment === 'production')
|
|
40
|
+
.target('async-node')
|
|
41
|
+
.optimization.minimize(false);
|
|
42
|
+
config.node.set('__dirname', false).set('__filename', false);
|
|
43
|
+
config.entry('index').add((0, node_path_1.join)(this.cwd, 'src/index'));
|
|
44
|
+
config.output.path((0, node_path_1.join)(this.cwd, 'dist')).filename('[name].js');
|
|
45
|
+
config.resolve.extensions.add('.tsx').add('.ts').add('.js');
|
|
46
|
+
config.devtool(environment === 'production' ? 'source-map' : 'eval-cheap-module-source-map');
|
|
47
|
+
}
|
|
48
|
+
applyPlugins(config, environment) {
|
|
49
|
+
config.when(environment === 'development', () => {
|
|
50
|
+
config.plugin('hot').use(webpack_1.HotModuleReplacementPlugin);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
applyModules(config) {
|
|
54
|
+
config.module
|
|
55
|
+
.rule('ts')
|
|
56
|
+
.test(/.tsx?$/)
|
|
57
|
+
.use('ts')
|
|
58
|
+
.loader(require.resolve('ts-loader'))
|
|
59
|
+
.options({
|
|
60
|
+
transpileOnly: true,
|
|
61
|
+
experimentalWatchApi: true,
|
|
62
|
+
onlyCompileBundledFiles: true,
|
|
63
|
+
compilerOptions: { ...config_typescript_1.default.compilerOptions, sourceMap: true },
|
|
64
|
+
});
|
|
65
|
+
config.module
|
|
66
|
+
.rule('protos')
|
|
67
|
+
.test(/\.proto$/)
|
|
68
|
+
.use('proto')
|
|
69
|
+
.loader(require.resolve('@atls/webpack-proto-imports-loader'));
|
|
70
|
+
}
|
|
71
|
+
async getUnpluggedDependencies(configuration) {
|
|
72
|
+
const pnpUnpluggedFolder = configuration.get('pnpUnpluggedFolder');
|
|
73
|
+
const dependenciesNames = new Set();
|
|
74
|
+
const entries = await (0, fast_glob_1.default)('*/node_modules/*/package.json', {
|
|
75
|
+
cwd: pnpUnpluggedFolder,
|
|
76
|
+
});
|
|
77
|
+
await Promise.all(entries
|
|
78
|
+
.map((entry) => (0, node_path_1.join)(pnpUnpluggedFolder, entry))
|
|
79
|
+
.map(async (entry) => {
|
|
80
|
+
try {
|
|
81
|
+
const { name } = JSON.parse((await (0, promises_1.readFile)(entry)).toString());
|
|
82
|
+
if (name && !webpack_externals_1.FORCE_UNPLUGGED_PACKAGES.has(name)) {
|
|
83
|
+
dependenciesNames.add(name);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch { }
|
|
87
|
+
}));
|
|
88
|
+
return dependenciesNames;
|
|
89
|
+
}
|
|
90
|
+
async getExternals(configuration, project) {
|
|
91
|
+
const workspace = project.getWorkspaceByFilePath(this.cwd);
|
|
92
|
+
const workspaceExternals = Object.keys(workspace?.manifest?.raw?.externalDependencies || {});
|
|
93
|
+
const unpluggedExternals = Array.from(await this.getUnpluggedDependencies(configuration));
|
|
94
|
+
return Array.from(new Set([...workspaceExternals, ...unpluggedExternals, ...webpack_externals_2.UNUSED_EXTERNALS])).reduce((result, dependency) => ({
|
|
95
|
+
...result,
|
|
96
|
+
[dependency]: `commonjs2 ${dependency}`,
|
|
97
|
+
}), {});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.WebpackConfig = WebpackConfig;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNUSED_EXTERNALS = exports.FORCE_UNPLUGGED_PACKAGES = void 0;
|
|
4
|
+
exports.FORCE_UNPLUGGED_PACKAGES = new Set([
|
|
5
|
+
'nan',
|
|
6
|
+
'node-gyp',
|
|
7
|
+
'node-pre-gyp',
|
|
8
|
+
'node-addon-api',
|
|
9
|
+
'fsevents',
|
|
10
|
+
'core-js',
|
|
11
|
+
'core-js-pure',
|
|
12
|
+
'protobufjs',
|
|
13
|
+
]);
|
|
14
|
+
exports.UNUSED_EXTERNALS = [
|
|
15
|
+
'cli-color',
|
|
16
|
+
'flaschenpost',
|
|
17
|
+
'amqp-connection-manager',
|
|
18
|
+
'kafkajs',
|
|
19
|
+
'amqplib',
|
|
20
|
+
'redis',
|
|
21
|
+
'mqtt',
|
|
22
|
+
'nats',
|
|
23
|
+
'@nestjs/websockets',
|
|
24
|
+
'typeorm-aurora-data-api-driver',
|
|
25
|
+
'react-native-sqlite-storage',
|
|
26
|
+
'@sap/hana-client',
|
|
27
|
+
'better-sqlite3',
|
|
28
|
+
'mongodb',
|
|
29
|
+
'oracledb',
|
|
30
|
+
'pg-native',
|
|
31
|
+
'mysql',
|
|
32
|
+
'ioredis',
|
|
33
|
+
'hdb-pool',
|
|
34
|
+
'mysql2',
|
|
35
|
+
'mssql',
|
|
36
|
+
'sql.js',
|
|
37
|
+
'pnpapi',
|
|
38
|
+
'next',
|
|
39
|
+
];
|
package/package.json
CHANGED
|
@@ -1,43 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atls/code-service",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
7
|
-
"tsconfig.stub.json",
|
|
8
7
|
"dist"
|
|
9
8
|
],
|
|
10
9
|
"scripts": {
|
|
11
|
-
"build": "
|
|
12
|
-
"
|
|
13
|
-
"
|
|
10
|
+
"build": "yarn library build",
|
|
11
|
+
"prepack": "yarn run build",
|
|
12
|
+
"postpack": "rm -rf dist"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@atls/config-typescript": "0.0.1",
|
|
16
|
+
"@atls/webpack-proto-imports-loader": "0.0.6",
|
|
17
|
+
"@atls/webpack-start-server-plugin": "0.0.4",
|
|
18
|
+
"@yarnpkg/cli": "^3.2.0-rc.8",
|
|
19
|
+
"@yarnpkg/core": "^3.2.0-rc.8",
|
|
20
|
+
"fast-glob": "^3.2.7",
|
|
21
|
+
"string-replace-loader": "^3.0.3",
|
|
22
|
+
"ts-loader": "^9.2.6",
|
|
23
|
+
"typescript": "^4.5.4",
|
|
24
|
+
"webpack": "^5.65.0",
|
|
25
|
+
"webpack-chain": "^6.5.1"
|
|
14
26
|
},
|
|
15
27
|
"devDependencies": {
|
|
16
|
-
"@
|
|
17
|
-
"@types/
|
|
18
|
-
"@types/
|
|
19
|
-
"@types/node": "^14.17.0",
|
|
20
|
-
"@types/protocol-buffers-schema": "3.4.0",
|
|
28
|
+
"@types/jest": "^27.0.3",
|
|
29
|
+
"@types/node": "^16.11.12",
|
|
30
|
+
"@types/protocol-buffers-schema": "3.4.1",
|
|
21
31
|
"@types/wait-for-localhost": "3.1.0",
|
|
22
32
|
"@types/webpack": "^5.28.0",
|
|
23
|
-
"@yarnpkg/fslib": "^2.
|
|
33
|
+
"@yarnpkg/fslib": "^2.6.1-rc.3",
|
|
24
34
|
"wait-for-localhost": "^3.3.0"
|
|
25
35
|
},
|
|
26
36
|
"publishConfig": {
|
|
27
37
|
"main": "dist/index.js",
|
|
28
38
|
"typings": "dist/index.d.ts"
|
|
29
39
|
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@atls/code-typescript": "0.0.4",
|
|
32
|
-
"@atls/webpack-proto-imports-loader": "0.0.4",
|
|
33
|
-
"@yarnpkg/cli": "^2.4.1",
|
|
34
|
-
"@yarnpkg/core": "^2.4.0",
|
|
35
|
-
"fast-glob": "^3.2.5",
|
|
36
|
-
"string-replace-loader": "^3.0.1",
|
|
37
|
-
"ts-loader": "^8.3.0",
|
|
38
|
-
"typescript": "^4.2.4",
|
|
39
|
-
"webpack": "^5.37.1",
|
|
40
|
-
"webpack-chain": "^6.5.1"
|
|
41
|
-
},
|
|
42
40
|
"typings": "dist/index.d.ts"
|
|
43
41
|
}
|
package/dist/build.d.ts
DELETED
package/dist/build.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.build = void 0;
|
|
7
|
-
const webpack_1 = __importDefault(require("webpack"));
|
|
8
|
-
const webpack_2 = require("./webpack");
|
|
9
|
-
const build = async ({ cwd }, plugins) => {
|
|
10
|
-
const config = await webpack_2.createWebpackConfig(cwd, 'production', plugins);
|
|
11
|
-
const compiler = webpack_1.default(config);
|
|
12
|
-
return new Promise((resolve, reject) => {
|
|
13
|
-
compiler.run((error, stats) => {
|
|
14
|
-
if (error) {
|
|
15
|
-
if (!error.message) {
|
|
16
|
-
reject(error);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
resolve({
|
|
20
|
-
errors: [{ message: error.message }],
|
|
21
|
-
warnings: [],
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
else if (stats) {
|
|
26
|
-
const { errors = [], warnings = [] } = stats.toJson();
|
|
27
|
-
resolve({
|
|
28
|
-
errors: errors.map((error) => ({ message: error.message })),
|
|
29
|
-
warnings: warnings.map((warning) => ({ message: warning.message })),
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
resolve({
|
|
34
|
-
errors: [],
|
|
35
|
-
warnings: [],
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
exports.build = build;
|
package/dist/index.d.ts
DELETED
package/dist/watch.d.ts
DELETED
package/dist/watch.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.watch = void 0;
|
|
7
|
-
const webpack_1 = __importDefault(require("webpack"));
|
|
8
|
-
const webpack_2 = require("./webpack");
|
|
9
|
-
const watch = async ({ cwd }, plugins = [], callback = (error) => undefined) => {
|
|
10
|
-
const config = await webpack_2.createWebpackConfig(cwd, 'development', plugins);
|
|
11
|
-
const compiler = webpack_1.default(config);
|
|
12
|
-
return compiler.watch({}, callback);
|
|
13
|
-
};
|
|
14
|
-
exports.watch = watch;
|
package/dist/webpack/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './webpack.config';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getResolveAliases: (cwd: string) => Promise<any>;
|
package/tsconfig.stub.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|