@nimbus-ds/webpack 1.2.0 → 1.3.0-rc.2
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/config/alias.d.ts +7 -0
- package/dist/config/alias.js +27 -0
- package/dist/config/alias.js.map +1 -0
- package/dist/config/base.d.ts +4 -0
- package/dist/config/base.js +41 -0
- package/dist/config/base.js.map +1 -0
- package/dist/config/development.d.ts +6 -0
- package/dist/config/development.js +12 -0
- package/dist/config/development.js.map +1 -0
- package/dist/config/external.d.ts +32 -0
- package/dist/config/external.js +24 -0
- package/dist/config/external.js.map +1 -0
- package/dist/config/{index.ts → index.d.ts} +0 -1
- package/dist/config/index.js +20 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/production.d.ts +6 -0
- package/dist/config/production.js +16 -0
- package/dist/config/production.js.map +1 -0
- package/dist/index.d.ts +131 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/cssHashRemoverPlugin.d.ts +14 -0
- package/dist/plugins/cssHashRemoverPlugin.js +60 -0
- package/dist/plugins/cssHashRemoverPlugin.js.map +1 -0
- package/dist/plugins/{cssMinimizerPlugin.ts → cssMinimizerPlugin.d.ts} +1 -2
- package/dist/plugins/cssMinimizerPlugin.js +10 -0
- package/dist/plugins/cssMinimizerPlugin.js.map +1 -0
- package/dist/plugins/dtsBundleGeneratorPlugin.d.ts +7 -0
- package/dist/plugins/dtsBundleGeneratorPlugin.js +24 -0
- package/dist/plugins/dtsBundleGeneratorPlugin.js.map +1 -0
- package/dist/plugins/index.js +16 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/miniCssExtract.d.ts +5 -0
- package/dist/plugins/miniCssExtract.js +16 -0
- package/dist/plugins/miniCssExtract.js.map +1 -0
- package/dist/plugins/terserJSPlugin.d.ts +5 -0
- package/dist/plugins/terserJSPlugin.js +14 -0
- package/dist/plugins/terserJSPlugin.js.map +1 -0
- package/dist/plugins/{vanillaExtractPlugin.ts → vanillaExtractPlugin.d.ts} +1 -4
- package/dist/plugins/vanillaExtractPlugin.js +11 -0
- package/dist/plugins/vanillaExtractPlugin.js.map +1 -0
- package/dist/rules/{common.ts → common.d.ts} +4 -5
- package/dist/rules/common.js +15 -0
- package/dist/rules/common.js.map +1 -0
- package/dist/rules/index.js +7 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/styles.d.ts +15 -0
- package/dist/rules/styles.js +21 -0
- package/dist/rules/styles.js.map +1 -0
- package/dist/rules/{svg.ts → svg.d.ts} +3 -4
- package/dist/rules/svg.js +11 -0
- package/dist/rules/svg.js.map +1 -0
- package/dist/utils/constants.d.ts +5 -0
- package/dist/utils/constants.js +18 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/helpers.d.ts +15 -0
- package/dist/utils/helpers.js +9 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +2 -2
- package/dist/config/alias.ts +0 -25
- package/dist/config/base.ts +0 -42
- package/dist/config/development.ts +0 -15
- package/dist/config/external.ts +0 -22
- package/dist/config/production.ts +0 -19
- package/dist/index.ts +0 -43
- package/dist/plugins/cssHashRemoverPlugin.ts +0 -81
- package/dist/plugins/dtsBundleGeneratorPlugin.ts +0 -24
- package/dist/plugins/miniCssExtract.ts +0 -13
- package/dist/plugins/terserJSPlugin.ts +0 -11
- package/dist/rules/styles.ts +0 -20
- package/dist/utils/constants.ts +0 -15
- package/dist/utils/helpers.ts +0 -12
- /package/dist/plugins/{index.ts → index.d.ts} +0 -0
- /package/dist/rules/{index.ts → index.d.ts} +0 -0
- /package/dist/utils/{index.ts → index.d.ts} +0 -0
|
@@ -2,7 +2,4 @@
|
|
|
2
2
|
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
3
|
*/
|
|
4
4
|
import { VanillaExtractPlugin } from "@vanilla-extract/webpack-plugin";
|
|
5
|
-
|
|
6
|
-
export const vanillaExtractPlugin = new VanillaExtractPlugin({
|
|
7
|
-
identifiers: "debug",
|
|
8
|
-
});
|
|
5
|
+
export declare const vanillaExtractPlugin: VanillaExtractPlugin;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.vanillaExtractPlugin = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
6
|
+
*/
|
|
7
|
+
const webpack_plugin_1 = require("@vanilla-extract/webpack-plugin");
|
|
8
|
+
exports.vanillaExtractPlugin = new webpack_plugin_1.VanillaExtractPlugin({
|
|
9
|
+
identifiers: "debug",
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=vanillaExtractPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vanillaExtractPlugin.js","sourceRoot":"","sources":["../../src/plugins/vanillaExtractPlugin.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,oEAAuE;AAE1D,QAAA,oBAAoB,GAAG,IAAI,qCAAoB,CAAC;IAC3D,WAAW,EAAE,OAAO;CACrB,CAAC,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* @see https://webpack.js.org/guides/typescript/#loader
|
|
7
6
|
*/
|
|
8
|
-
export const typescriptRule
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export declare const typescriptRule: {
|
|
8
|
+
test: RegExp;
|
|
9
|
+
loader: string;
|
|
10
|
+
exclude: RegExp;
|
|
12
11
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.typescriptRule = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* @see https://webpack.js.org/guides/typescript/#loader
|
|
9
|
+
*/
|
|
10
|
+
exports.typescriptRule = {
|
|
11
|
+
test: /\.tsx?$/,
|
|
12
|
+
loader: "ts-loader",
|
|
13
|
+
exclude: /node_modules/,
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/rules/common.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH;;GAEG;AACU,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,cAAc;CACxB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./common"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./styles"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./svg"), exports);
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,mDAAyB;AACzB,gDAAsB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
|
+
*/
|
|
4
|
+
export declare const miniCssExtractRule: {
|
|
5
|
+
test: RegExp;
|
|
6
|
+
loader: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const cssLoaderExtractRule: {
|
|
9
|
+
test: RegExp;
|
|
10
|
+
use: string[];
|
|
11
|
+
};
|
|
12
|
+
export declare const styleLoaderCssRule: {
|
|
13
|
+
test: RegExp;
|
|
14
|
+
use: string[];
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.styleLoaderCssRule = exports.cssLoaderExtractRule = exports.miniCssExtractRule = void 0;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
const mini_css_extract_plugin_1 = tslib_1.__importDefault(require("mini-css-extract-plugin"));
|
|
9
|
+
exports.miniCssExtractRule = {
|
|
10
|
+
test: /\.css$/,
|
|
11
|
+
loader: mini_css_extract_plugin_1.default.loader,
|
|
12
|
+
};
|
|
13
|
+
exports.cssLoaderExtractRule = {
|
|
14
|
+
test: /\.css$/i,
|
|
15
|
+
use: [mini_css_extract_plugin_1.default.loader, "css-loader"],
|
|
16
|
+
};
|
|
17
|
+
exports.styleLoaderCssRule = {
|
|
18
|
+
test: /\.css$/i,
|
|
19
|
+
use: ["style-loader", "css-loader"],
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/rules/styles.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,8FAA2D;AAE9C,QAAA,kBAAkB,GAAG;IAChC,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,iCAAoB,CAAC,MAAM;CACpC,CAAC;AAEW,QAAA,oBAAoB,GAAG;IAClC,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,CAAC,iCAAoB,CAAC,MAAM,EAAE,YAAY,CAAC;CACjD,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAChC,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,CAAC,cAAc,EAAE,YAAY,CAAC;CACpC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.svgRule = void 0;
|
|
7
|
+
exports.svgRule = {
|
|
8
|
+
test: /\.svg$/i,
|
|
9
|
+
use: ["@svgr/webpack"],
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../src/rules/svg.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEU,QAAA,OAAO,GAAG;IACrB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,CAAC,eAAe,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.webpackDir = exports.rootDir = exports.isDevelopment = exports.isProduction = exports.mode = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/**
|
|
6
|
+
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
7
|
+
*/
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const dotenv = tslib_1.__importStar(require("dotenv")); // see https://github.com/motdotla/dotenv#how-do-i-use-dotenv-with-import
|
|
10
|
+
dotenv.config({
|
|
11
|
+
path: (0, path_1.join)(__dirname, "../../../../../.env"),
|
|
12
|
+
});
|
|
13
|
+
exports.mode = process.env.NODE_ENV ?? "production";
|
|
14
|
+
exports.isProduction = exports.mode === "production";
|
|
15
|
+
exports.isDevelopment = !exports.isProduction;
|
|
16
|
+
exports.rootDir = (0, path_1.join)(__dirname, "../../../../../");
|
|
17
|
+
exports.webpackDir = (0, path_1.join)(__dirname, "../../");
|
|
18
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";;;;AAAA;;GAEG;AACH,+BAA4B;AAC5B,uDAAiC,CAAC,yEAAyE;AAE3G,MAAM,CAAC,MAAM,CAAC;IACZ,IAAI,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,qBAAqB,CAAC;CAC7C,CAAC,CAAC;AAEU,QAAA,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,YAAY,CAAC;AAC5C,QAAA,YAAY,GAAG,YAAI,KAAK,YAAY,CAAC;AACrC,QAAA,aAAa,GAAG,CAAC,oBAAY,CAAC;AAC9B,QAAA,OAAO,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;AAC7C,QAAA,UAAU,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
|
+
*/
|
|
4
|
+
/// <reference types="jest" />
|
|
5
|
+
export declare const arrayFilterEmpty: (array: {
|
|
6
|
+
test: RegExp;
|
|
7
|
+
loader?: string;
|
|
8
|
+
use?: any;
|
|
9
|
+
exclude?: RegExp;
|
|
10
|
+
}[]) => {
|
|
11
|
+
test: RegExp;
|
|
12
|
+
loader?: string | undefined;
|
|
13
|
+
use?: any;
|
|
14
|
+
exclude?: RegExp | undefined;
|
|
15
|
+
}[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.arrayFilterEmpty = void 0;
|
|
7
|
+
const arrayFilterEmpty = (array) => array.filter((x) => !!x);
|
|
8
|
+
exports.arrayFilterEmpty = arrayFilterEmpty;
|
|
9
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAII,MAAM,gBAAgB,GAAG,CAC9B,KAKG,EACH,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAPjB,QAAA,gBAAgB,oBAOC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,oDAA0B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nimbus-ds/webpack",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-rc.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "
|
|
12
|
+
"build": "tsc --outDir dist --declaration true",
|
|
13
13
|
"clean": "rm -rf dist",
|
|
14
14
|
"g:webpack": "cd $INIT_CWD && webpack"
|
|
15
15
|
},
|
package/dist/config/alias.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
|
-
* @see https://webpack.js.org/configuration/dev-server/
|
|
4
|
-
*/
|
|
5
|
-
import dashify from "dashify";
|
|
6
|
-
import glob from "glob";
|
|
7
|
-
import { join } from "path";
|
|
8
|
-
import { rootDir } from "../utils/constants";
|
|
9
|
-
|
|
10
|
-
const paths = glob.sync(`${join(rootDir, "./packages/react/src/*/*/src")}`);
|
|
11
|
-
|
|
12
|
-
const packages = paths.reduce((prev: { [key: string]: string }, curr) => {
|
|
13
|
-
const key = `@nimbus-ds/${dashify(curr.split("/")[10])}`;
|
|
14
|
-
prev[key] = curr;
|
|
15
|
-
return prev;
|
|
16
|
-
}, {});
|
|
17
|
-
|
|
18
|
-
export const aliasItems = {
|
|
19
|
-
"@nimbus-ds/icons": join(rootDir, "./packages/icons"),
|
|
20
|
-
"@nimbus-ds/tokens": join(rootDir, "./packages/core/tokens"),
|
|
21
|
-
"@nimbus-ds/typings": join(rootDir, "./packages/core/typings/src"),
|
|
22
|
-
"@nimbus-ds/styles": join(rootDir, "./packages/core/styles/src"),
|
|
23
|
-
"@nimbus-ds/webpack": join(rootDir, "./packages/core/webpack/src"),
|
|
24
|
-
...packages,
|
|
25
|
-
};
|
package/dist/config/base.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
|
-
*/
|
|
4
|
-
import merge from "webpack-merge";
|
|
5
|
-
import { Configuration } from "webpack";
|
|
6
|
-
|
|
7
|
-
import { arrayFilterEmpty, isProduction } from "../utils";
|
|
8
|
-
import { typescriptRule, svgRule } from "../rules";
|
|
9
|
-
import { dtsBundleGeneratorPlugin } from "../plugins";
|
|
10
|
-
import { aliasItems } from "./alias";
|
|
11
|
-
import { externalItems } from "./external";
|
|
12
|
-
|
|
13
|
-
import production from "./production";
|
|
14
|
-
import development from "./development";
|
|
15
|
-
|
|
16
|
-
const webpack: Configuration = {
|
|
17
|
-
target: "node",
|
|
18
|
-
mode: isProduction ? "production" : "development",
|
|
19
|
-
entry: {
|
|
20
|
-
"./index": "./src/index.ts",
|
|
21
|
-
},
|
|
22
|
-
output: {
|
|
23
|
-
filename: "[name].js",
|
|
24
|
-
libraryTarget: "umd",
|
|
25
|
-
},
|
|
26
|
-
module: {
|
|
27
|
-
rules: arrayFilterEmpty([typescriptRule, svgRule]),
|
|
28
|
-
},
|
|
29
|
-
plugins: [dtsBundleGeneratorPlugin()],
|
|
30
|
-
resolve: {
|
|
31
|
-
alias: aliasItems,
|
|
32
|
-
extensions: [".tsx", ".ts", ".js"],
|
|
33
|
-
},
|
|
34
|
-
externals: externalItems,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const getConfiguration = (config?: Configuration) =>
|
|
38
|
-
isProduction
|
|
39
|
-
? merge(webpack, production, config || {})
|
|
40
|
-
: merge(webpack, development, config || {});
|
|
41
|
-
|
|
42
|
-
export default getConfiguration();
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
|
-
*/
|
|
4
|
-
import { Configuration } from "webpack";
|
|
5
|
-
import { terserJSPlugin } from "../plugins";
|
|
6
|
-
|
|
7
|
-
const webpack: Configuration = {
|
|
8
|
-
devtool: "source-map",
|
|
9
|
-
optimization: {
|
|
10
|
-
minimize: true,
|
|
11
|
-
minimizer: [terserJSPlugin],
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default webpack;
|
package/dist/config/external.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
|
-
* @see https://webpack.js.org/configuration/externals/
|
|
4
|
-
*/
|
|
5
|
-
export const externalLibs = {
|
|
6
|
-
"@floating-ui/react-dom-interactions": "@floating-ui/react-dom-interactions",
|
|
7
|
-
"@nimbus-ds/styles": "@nimbus-ds/styles",
|
|
8
|
-
react: "react",
|
|
9
|
-
"react-dom": "react-dom",
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const externalPackages = {
|
|
13
|
-
"@nimbus-ds/icon": "@nimbus-ds/icon",
|
|
14
|
-
"@nimbus-ds/icons": "@nimbus-ds/icons",
|
|
15
|
-
"@nimbus-ds/skeleton": "@nimbus-ds/skeleton",
|
|
16
|
-
"@nimbus-ds/spinner": "@nimbus-ds/spinner",
|
|
17
|
-
"@nimbus-ds/text": "@nimbus-ds/text",
|
|
18
|
-
"@nimbus-ds/title": "@nimbus-ds/title",
|
|
19
|
-
"@nimbus-ds/tokens": "@nimbus-ds/tokens",
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const externalItems = { ...externalLibs, ...externalPackages };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
|
-
*/
|
|
4
|
-
import { Configuration } from "webpack";
|
|
5
|
-
import { cssMinimizerPlugin, terserJSPlugin } from "../plugins";
|
|
6
|
-
|
|
7
|
-
const webpack: Configuration = {
|
|
8
|
-
optimization: {
|
|
9
|
-
minimize: true,
|
|
10
|
-
minimizer: [terserJSPlugin, cssMinimizerPlugin],
|
|
11
|
-
},
|
|
12
|
-
performance: {
|
|
13
|
-
hints: false,
|
|
14
|
-
maxEntrypointSize: 512000,
|
|
15
|
-
maxAssetSize: 512000,
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default webpack;
|
package/dist/index.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getConfiguration,
|
|
3
|
-
development,
|
|
4
|
-
production,
|
|
5
|
-
base,
|
|
6
|
-
externalLibs,
|
|
7
|
-
} from "./config";
|
|
8
|
-
import {
|
|
9
|
-
vanillaExtractPlugin,
|
|
10
|
-
miniCssExtractPlugin,
|
|
11
|
-
dtsBundleGeneratorPlugin,
|
|
12
|
-
cssHashRemoverPlugin,
|
|
13
|
-
cssMinimizerPlugin,
|
|
14
|
-
} from "./plugins";
|
|
15
|
-
import { cssLoaderExtractRule, styleLoaderCssRule } from "./rules";
|
|
16
|
-
import { rootDir } from "./utils";
|
|
17
|
-
|
|
18
|
-
export const rules = { cssLoaderExtractRule, styleLoaderCssRule };
|
|
19
|
-
export const plugins = {
|
|
20
|
-
vanillaExtractPlugin,
|
|
21
|
-
miniCssExtractPlugin,
|
|
22
|
-
cssHashRemoverPlugin,
|
|
23
|
-
cssMinimizerPlugin,
|
|
24
|
-
dtsBundleGeneratorPlugin,
|
|
25
|
-
};
|
|
26
|
-
export const configuration = {
|
|
27
|
-
externalLibs,
|
|
28
|
-
development,
|
|
29
|
-
production,
|
|
30
|
-
base,
|
|
31
|
-
getConfiguration,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const utils = { rootDir };
|
|
35
|
-
|
|
36
|
-
const webpack = {
|
|
37
|
-
rules,
|
|
38
|
-
plugins,
|
|
39
|
-
configuration,
|
|
40
|
-
utils,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default webpack;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
type Compiler = import("webpack").Compiler;
|
|
2
|
-
|
|
3
|
-
class CssHashRemoverPlugin {
|
|
4
|
-
options;
|
|
5
|
-
|
|
6
|
-
content = "";
|
|
7
|
-
|
|
8
|
-
static defaultOptions = {
|
|
9
|
-
outputFile: "styles.css",
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// Any options should be passed in the constructor of your plugin,
|
|
13
|
-
// (this is a public API of your plugin).
|
|
14
|
-
constructor(options = {}) {
|
|
15
|
-
// Applying user-specified options over the default options
|
|
16
|
-
// and making merged options further available to the plugin methods.
|
|
17
|
-
// You should probably validate all the options here as well.
|
|
18
|
-
this.options = { ...CssHashRemoverPlugin.defaultOptions, ...options };
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
apply(compiler: Compiler) {
|
|
22
|
-
const pluginName = CssHashRemoverPlugin.name;
|
|
23
|
-
|
|
24
|
-
// webpack module instance can be accessed from the compiler object,
|
|
25
|
-
// this ensures that correct version of the module is used
|
|
26
|
-
// (do not require/import the webpack or any symbols from it directly).
|
|
27
|
-
const { webpack } = compiler;
|
|
28
|
-
|
|
29
|
-
// Compilation object gives us reference to some useful constants.
|
|
30
|
-
const { Compilation } = webpack;
|
|
31
|
-
|
|
32
|
-
// RawSource is one of the "sources" classes that should be used
|
|
33
|
-
// to represent asset sources in compilation.
|
|
34
|
-
const { RawSource } = webpack.sources;
|
|
35
|
-
|
|
36
|
-
// Tapping to the "thisCompilation" hook in order to further tap
|
|
37
|
-
// to the compilation process on an earlier stage.
|
|
38
|
-
compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {
|
|
39
|
-
// Tapping to the assets processing pipeline on a specific stage.
|
|
40
|
-
compilation.hooks.processAssets.tap(
|
|
41
|
-
{
|
|
42
|
-
name: pluginName,
|
|
43
|
-
// Using one of the later asset processing stages to ensure
|
|
44
|
-
// that all assets were already added to the compilation by other plugins.
|
|
45
|
-
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE,
|
|
46
|
-
},
|
|
47
|
-
(assets) => {
|
|
48
|
-
const source = assets?.["./index.css"]?.source()?.toString() ?? "";
|
|
49
|
-
const matches = Array.from(
|
|
50
|
-
source?.matchAll(
|
|
51
|
-
/(?:\.nimbus-[\w|-]+)(?:(__\w{7,}))(?::{0,2}(?:disabled|focus|active|hover|placeholder|focus-visible|after)?) ?{/gm
|
|
52
|
-
),
|
|
53
|
-
(m) => m[1]
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
const uniqueMatches = [...new Set(matches)];
|
|
57
|
-
|
|
58
|
-
this.content = source;
|
|
59
|
-
uniqueMatches?.forEach((hash) => {
|
|
60
|
-
const regex = new RegExp(`${hash}\\b`, "gm");
|
|
61
|
-
this.content = this.content.replace(regex, "");
|
|
62
|
-
});
|
|
63
|
-
// "assets" is an object that contains all assets
|
|
64
|
-
// in the compilation, the keys of the object are pathnames of the assets
|
|
65
|
-
// and the values are file sources.
|
|
66
|
-
|
|
67
|
-
// Iterating over all the assets and
|
|
68
|
-
// generating content for our Markdown file.
|
|
69
|
-
// Adding new asset to the compilation, so it would be automatically
|
|
70
|
-
// generated by the webpack in the output directory.
|
|
71
|
-
compilation.emitAsset(
|
|
72
|
-
this.options.outputFile,
|
|
73
|
-
new RawSource(this.content)
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
);
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export const cssHashRemoverPlugin = new CssHashRemoverPlugin();
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import WebpackShellPluginNextPlugin from "webpack-shell-plugin-next";
|
|
6
|
-
import { rootDir } from "../utils";
|
|
7
|
-
|
|
8
|
-
const entry = [
|
|
9
|
-
`node ${rootDir}/node_modules/.bin/dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts`,
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
export const dtsBundleGeneratorPlugin = (
|
|
13
|
-
configuration: { entries: string[] } = { entries: entry }
|
|
14
|
-
) => {
|
|
15
|
-
const config = {
|
|
16
|
-
onBuildEnd: {
|
|
17
|
-
scripts: [...configuration.entries],
|
|
18
|
-
blocking: false,
|
|
19
|
-
parallel: true,
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return new WebpackShellPluginNextPlugin(config);
|
|
24
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
|
-
*/
|
|
4
|
-
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
5
|
-
|
|
6
|
-
const config = {
|
|
7
|
-
// Options similar to the same options in webpackOptions.output
|
|
8
|
-
// both options are optional
|
|
9
|
-
filename: "[name].css",
|
|
10
|
-
chunkFilename: "[id].css",
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const miniCssExtractPlugin = new MiniCssExtractPlugin(config);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
|
-
*/
|
|
4
|
-
import TerserJSPlugin from "terser-webpack-plugin";
|
|
5
|
-
|
|
6
|
-
const config = {
|
|
7
|
-
// Options similar to the same options in webpackOptions.output
|
|
8
|
-
// both options are optional
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const terserJSPlugin = new TerserJSPlugin(config);
|
package/dist/rules/styles.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
6
|
-
|
|
7
|
-
export const miniCssExtractRule = {
|
|
8
|
-
test: /\.css$/,
|
|
9
|
-
loader: MiniCssExtractPlugin.loader,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const cssLoaderExtractRule = {
|
|
13
|
-
test: /\.css$/i,
|
|
14
|
-
use: [MiniCssExtractPlugin.loader, "css-loader"],
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const styleLoaderCssRule = {
|
|
18
|
-
test: /\.css$/i,
|
|
19
|
-
use: ["style-loader", "css-loader"],
|
|
20
|
-
};
|
package/dist/utils/constants.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by: Júnior Conquista (junior.conquista@nuvemshop.com.br)
|
|
3
|
-
*/
|
|
4
|
-
import { join } from "path";
|
|
5
|
-
import * as dotenv from "dotenv"; // see https://github.com/motdotla/dotenv#how-do-i-use-dotenv-with-import
|
|
6
|
-
|
|
7
|
-
dotenv.config({
|
|
8
|
-
path: join(__dirname, "../../../../../.env"),
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
export const mode = process.env.NODE_ENV ?? "production";
|
|
12
|
-
export const isProduction = mode === "production";
|
|
13
|
-
export const isDevelopment = !isProduction;
|
|
14
|
-
export const rootDir = join(__dirname, "../../../../../");
|
|
15
|
-
export const webpackDir = join(__dirname, "../../");
|
package/dist/utils/helpers.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|