@relative-ci/webpack-plugin 5.0.0-alpha.15
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/LICENSE +9 -0
- package/README.md +32 -0
- package/lib/cjs/index.js +78 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/package.json +1 -0
- package/lib/esm/index.js +69 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/package.json +1 -0
- package/lib/types/index.d.ts +34 -0
- package/package.json +66 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright 2018 Viorel Cojocaru, contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<a href="https://relative-ci.com">
|
|
2
|
+
<img alt="RelativeCI" src="https://raw.githubusercontent.com/relative-ci/agent/master/assets/relative-ci--logo.png" width="96" />
|
|
3
|
+
</a>
|
|
4
|
+
|
|
5
|
+
# RelativeCI webpack-plugin agent
|
|
6
|
+
|
|
7
|
+
> Send bundle stats and CI build information to [RelativeCI](https://relative-ci.com?utm_source=github&utm_medium=agent).
|
|
8
|
+
|
|
9
|
+
To get started, follow [RelativeCI Setup guide for webpack-plugin](https://relative-ci.com/documentation/setup?utm_source=github&utm_medium=agent).
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/@relative-ci/webpack-plugin)
|
|
12
|
+
[](https://www.npmjs.com/package/@relative-ci/webpack-plugin)
|
|
13
|
+
[](https://socket.dev/npm/package/@relative-ci/webpack-plugin)
|
|
14
|
+
[](https://github.com/relative-ci/agent/actions/workflows/ci.yml)
|
|
15
|
+
[](https://github.com/relative-ci/agent/actions/workflows/codeql.yml)
|
|
16
|
+
|
|
17
|
+
## Other packages
|
|
18
|
+
|
|
19
|
+
### [`@relative-ci/cli`](https://github.com/relative-ci/agent/tree/master/packages/cli)
|
|
20
|
+
|
|
21
|
+
[](https://www.npmjs.com/package/@relative-ci/cli)
|
|
22
|
+
[](https://www.npmjs.com/package/@relative-ci/cli)
|
|
23
|
+
[](https://socket.dev/npm/package/@relative-ci/cli)
|
|
24
|
+
[](https://github.com/relative-ci/agent/actions/workflows/ci.yml)
|
|
25
|
+
[](https://github.com/relative-ci/agent/actions/workflows/codeql.yml)
|
|
26
|
+
|
|
27
|
+
To get started, follow [RelativeCI Setup guide for CLI](https://relative-ci.com/documentation/setup/agent/cli?utm_source=github&utm_medium=agent).
|
|
28
|
+
|
|
29
|
+
## Other agents
|
|
30
|
+
|
|
31
|
+
- [GitHub action](https://github.com/relative-ci/cli-action)
|
|
32
|
+
- [CircleCI orbit (soon)](https://github.com/relative-ci/roadmap/issues/46)
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var webpack = require('webpack');
|
|
4
|
+
var _ = require('lodash');
|
|
5
|
+
var core = require('@relative-ci/core');
|
|
6
|
+
var loadEnv = require('@relative-ci/core/env');
|
|
7
|
+
var ingest = require('@relative-ci/core/ingest');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var webpack__default = /*#__PURE__*/_interopDefault(webpack);
|
|
12
|
+
var ___default = /*#__PURE__*/_interopDefault(_);
|
|
13
|
+
var loadEnv__default = /*#__PURE__*/_interopDefault(loadEnv);
|
|
14
|
+
var ingest__default = /*#__PURE__*/_interopDefault(ingest);
|
|
15
|
+
|
|
16
|
+
const PLUGIN_NAME = 'RelativeCiAgent';
|
|
17
|
+
const DEFAULT_OPTIONS = {
|
|
18
|
+
includeCommitMessage: true,
|
|
19
|
+
payloadFilepath: null,
|
|
20
|
+
stats: {
|
|
21
|
+
assets: true,
|
|
22
|
+
chunks: true,
|
|
23
|
+
modules: true,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
const isWebpack5 = parseInt(webpack__default.default.version, 10) === 5;
|
|
27
|
+
async function sendStats(compilation, options) {
|
|
28
|
+
const { stats: statsOptions, failOnError, ...config } = options;
|
|
29
|
+
const data = compilation.getStats().toJson(statsOptions);
|
|
30
|
+
const logger = compilation.compiler?.getInfrastructureLogger
|
|
31
|
+
? compilation.compiler.getInfrastructureLogger(PLUGIN_NAME)
|
|
32
|
+
: console;
|
|
33
|
+
try {
|
|
34
|
+
core.validateWebpackStats(data);
|
|
35
|
+
const params = loadEnv__default.default({}, { includeCommitMessage: config?.includeCommitMessage });
|
|
36
|
+
const artifactsData = core.filterArtifacts([{ key: core.SOURCE_WEBPACK_STATS, data }]);
|
|
37
|
+
const response = await ingest__default.default(artifactsData, params, config, logger);
|
|
38
|
+
core.logResponse(response);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
if (failOnError) {
|
|
42
|
+
compilation.errors.push(error);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
logger.warn(error); // catch error to prevent failure on error
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
class RelativeCIAgentWebpackPlugin {
|
|
50
|
+
constructor(options) {
|
|
51
|
+
this.options = options;
|
|
52
|
+
}
|
|
53
|
+
apply(compiler) {
|
|
54
|
+
const { isCi } = loadEnv.getCiEnv({ includeCommitMessage: this.options?.includeCommitMessage });
|
|
55
|
+
const options = ___default.default.merge({}, DEFAULT_OPTIONS, {
|
|
56
|
+
enabled: isCi,
|
|
57
|
+
}, this.options);
|
|
58
|
+
core.debug(options);
|
|
59
|
+
// Skip if not enabled
|
|
60
|
+
if (!options.enabled) {
|
|
61
|
+
core.debug(`${PLUGIN_NAME} is disabled, skip sending data`);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (isWebpack5) {
|
|
65
|
+
compiler.hooks.make.tap(PLUGIN_NAME, (compilation) => {
|
|
66
|
+
compilation.hooks.processAssets.tap({ name: PLUGIN_NAME, stage: webpack__default.default.Compilation.PROCESS_ASSETS_STAGE_REPORT }, () => sendStats(compilation, options));
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
compiler.hooks.emit.tapAsync(PLUGIN_NAME, async (compilation, callback) => {
|
|
71
|
+
await sendStats(compilation, options);
|
|
72
|
+
callback();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
module.exports = RelativeCIAgentWebpackPlugin;
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":[null],"names":["webpack","validateWebpackStats","loadEnv","filterArtifacts","SOURCE_WEBPACK_STATS","ingest","logResponse","getCiEnv","_","debug"],"mappings":";;;;;;;;;;;;;;;AA4CA,MAAM,WAAW,GAAG,iBAAiB;AAErC,MAAM,eAAe,GAAG;AACtB,IAAA,oBAAoB,EAA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
+
import { debug, validateWebpackStats, filterArtifacts, SOURCE_WEBPACK_STATS, logResponse } from '@relative-ci/core';
|
|
4
|
+
import loadEnv, { getCiEnv } from '@relative-ci/core/env';
|
|
5
|
+
import ingest from '@relative-ci/core/ingest';
|
|
6
|
+
|
|
7
|
+
const PLUGIN_NAME = 'RelativeCiAgent';
|
|
8
|
+
const DEFAULT_OPTIONS = {
|
|
9
|
+
includeCommitMessage: true,
|
|
10
|
+
payloadFilepath: null,
|
|
11
|
+
stats: {
|
|
12
|
+
assets: true,
|
|
13
|
+
chunks: true,
|
|
14
|
+
modules: true,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
const isWebpack5 = parseInt(webpack.version, 10) === 5;
|
|
18
|
+
async function sendStats(compilation, options) {
|
|
19
|
+
const { stats: statsOptions, failOnError, ...config } = options;
|
|
20
|
+
const data = compilation.getStats().toJson(statsOptions);
|
|
21
|
+
const logger = compilation.compiler?.getInfrastructureLogger
|
|
22
|
+
? compilation.compiler.getInfrastructureLogger(PLUGIN_NAME)
|
|
23
|
+
: console;
|
|
24
|
+
try {
|
|
25
|
+
validateWebpackStats(data);
|
|
26
|
+
const params = loadEnv({}, { includeCommitMessage: config?.includeCommitMessage });
|
|
27
|
+
const artifactsData = filterArtifacts([{ key: SOURCE_WEBPACK_STATS, data }]);
|
|
28
|
+
const response = await ingest(artifactsData, params, config, logger);
|
|
29
|
+
logResponse(response);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
if (failOnError) {
|
|
33
|
+
compilation.errors.push(error);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
logger.warn(error); // catch error to prevent failure on error
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
class RelativeCIAgentWebpackPlugin {
|
|
41
|
+
constructor(options) {
|
|
42
|
+
this.options = options;
|
|
43
|
+
}
|
|
44
|
+
apply(compiler) {
|
|
45
|
+
const { isCi } = getCiEnv({ includeCommitMessage: this.options?.includeCommitMessage });
|
|
46
|
+
const options = _.merge({}, DEFAULT_OPTIONS, {
|
|
47
|
+
enabled: isCi,
|
|
48
|
+
}, this.options);
|
|
49
|
+
debug(options);
|
|
50
|
+
// Skip if not enabled
|
|
51
|
+
if (!options.enabled) {
|
|
52
|
+
debug(`${PLUGIN_NAME} is disabled, skip sending data`);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (isWebpack5) {
|
|
56
|
+
compiler.hooks.make.tap(PLUGIN_NAME, (compilation) => {
|
|
57
|
+
compilation.hooks.processAssets.tap({ name: PLUGIN_NAME, stage: webpack.Compilation.PROCESS_ASSETS_STAGE_REPORT }, () => sendStats(compilation, options));
|
|
58
|
+
});
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
compiler.hooks.emit.tapAsync(PLUGIN_NAME, async (compilation, callback) => {
|
|
62
|
+
await sendStats(compilation, options);
|
|
63
|
+
callback();
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { RelativeCIAgentWebpackPlugin as default };
|
|
69
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AA4CA,MAAM,WAAW,GAAG,iBAAiB;AAErC,MAAM,eAAe,GAAG;AACtB,IAAA,oBAAoB,EAAE,IAAI;AAC1B,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,KAAK,EAAE;AACL,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,OAAO,EAAE,IAAI;AACd,KAAA;CACF;AAED,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC;AAEtD,eAAe,SAAS,CACtB,WAAwB,EACxB,OAA4C,EAAA;AAE5C,IAAA,MAAM,EAAE,KAAK,EAA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ACb;QAED,KAAK,CAAC,OAAO,CAAC;;AAGd,QAAA,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;AACpB,YAAA,KAAK,CAAC,CAAA,EAAG,WAAW,CAAA,+BAAA,CAAiC,CAAC;YACtD;;QAGF,IAAI,UAAU,EAAE;AACd,YAAA,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,WAAW,KAAI;AACnD,gBAAA,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CACjC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,2BAA2B,EAAE,EAC7E,MAAM,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC,CACtC;AACH,aAAC,CAAC;YAEF;;AAGF,QAAA,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAC1B,WAAW,EACX,OAAO,WAAW,EAAE,QAAQ,KAAI;AAC9B,YAAA,MAAM,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC;AACrC,YAAA,QAAQ,EAAE;AACZ,SAAC,CACF;;AAEJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Compiler, type Configuration } from 'webpack';
|
|
2
|
+
import { type PluginConfig } from '@relative-ci/core';
|
|
3
|
+
type RelativeCIAgentWebpackPluginOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* Plugin is enabled - sends data to RelativeCI
|
|
6
|
+
* @default env-ci isCi value
|
|
7
|
+
*/
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Throw error when validation or ingestion fails
|
|
11
|
+
* @default {false}
|
|
12
|
+
*/
|
|
13
|
+
failOnError?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Read commit message from git
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
includeCommitMessage?: PluginConfig['includeCommitMessage'];
|
|
19
|
+
/**
|
|
20
|
+
* Output payload on a local file for debugging
|
|
21
|
+
*/
|
|
22
|
+
payloadFilepath?: PluginConfig['payloadFilepath'];
|
|
23
|
+
/**
|
|
24
|
+
* Webpack stats options
|
|
25
|
+
* @default assets, chunks, modules
|
|
26
|
+
*/
|
|
27
|
+
stats?: Configuration['stats'];
|
|
28
|
+
};
|
|
29
|
+
declare class RelativeCIAgentWebpackPlugin {
|
|
30
|
+
options: RelativeCIAgentWebpackPluginOptions;
|
|
31
|
+
constructor(options: RelativeCIAgentWebpackPluginOptions);
|
|
32
|
+
apply(compiler: Compiler): void;
|
|
33
|
+
}
|
|
34
|
+
export default RelativeCIAgentWebpackPlugin;
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@relative-ci/webpack-plugin",
|
|
3
|
+
"version": "5.0.0-alpha.15",
|
|
4
|
+
"description": "Webpack plugin that sends bundle stats and CI build information to RelativeCI",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"webpack",
|
|
7
|
+
"rspack",
|
|
8
|
+
"bundle-size",
|
|
9
|
+
"bundle-analyzer",
|
|
10
|
+
"bundle-stats",
|
|
11
|
+
"stats",
|
|
12
|
+
"bundle",
|
|
13
|
+
"size",
|
|
14
|
+
"assets",
|
|
15
|
+
"chunks",
|
|
16
|
+
"modules"
|
|
17
|
+
],
|
|
18
|
+
"repository": "https://github.com/relative-ci/agent",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/relative-ci/agent/issues"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://relative-ci.com/documentation/setup/agent/webpack-plugin",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"author": {
|
|
25
|
+
"name": "Viorel Cojocaru",
|
|
26
|
+
"email": "vio@relative-ci.com",
|
|
27
|
+
"url": "https://relative-ci.com"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">= 18.0.0"
|
|
31
|
+
},
|
|
32
|
+
"main": "./lib/cjs/index.js",
|
|
33
|
+
"module": "./lib/esm/index.js",
|
|
34
|
+
"types": "./lib/types/index.d.ts",
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "npm run clean && tsc && rollup -c && npm run build-type",
|
|
37
|
+
"build-type": "echo '{\"type\":\"commonjs\"}' > lib/cjs/package.json && echo '{\"type\":\"module\"}' > lib/esm/package.json",
|
|
38
|
+
"clean": "rimraf ./lib",
|
|
39
|
+
"clean-deps": "rimraf ./test/webpack/*/node_modules ./node_modules",
|
|
40
|
+
"lint": "eslint .",
|
|
41
|
+
"test": "vitest src --passWithNoTests --run"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@rollup/plugin-commonjs": "28.0.3",
|
|
45
|
+
"@rollup/plugin-node-resolve": "16.0.0",
|
|
46
|
+
"@rollup/plugin-replace": "6.0.2",
|
|
47
|
+
"@rollup/plugin-typescript": "12.1.2",
|
|
48
|
+
"@tsconfig/node18": "^18.2.4",
|
|
49
|
+
"@types/lodash": "4.17.16",
|
|
50
|
+
"memory-fs": "0.5.0",
|
|
51
|
+
"rimraf": "6.0.1",
|
|
52
|
+
"rollup": "4.35.0",
|
|
53
|
+
"rollup-plugin-node-externals": "8.0.0",
|
|
54
|
+
"typescript": "5.8.2",
|
|
55
|
+
"vitest": "3.0.8",
|
|
56
|
+
"webpack": "5.98.0"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@relative-ci/core": "5.0.0-alpha.15",
|
|
60
|
+
"lodash": "4.17.21"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"webpack": "^4.0.0 || ^5.0.0-rc.1"
|
|
64
|
+
},
|
|
65
|
+
"gitHead": "dfeab530e9200e052d773105be6911cb6aeda94b"
|
|
66
|
+
}
|