@openeuropa/bcl-builder 1.10.10 → 1.11.0
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/README.md +4 -4
- package/package.json +15 -20
- package/scripts/colorScheme.js +32 -12
- package/scripts/scripts.js +1 -1
- package/scripts/sprite.js +10 -8
package/README.md
CHANGED
|
@@ -97,11 +97,11 @@ We've also added some new variables that overwrite and make use of extra classes
|
|
|
97
97
|
Step 1:
|
|
98
98
|
Depending on your package manager:
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
PNPM:
|
|
101
101
|
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
102
|
+
- pnpm add @openeuropa/bcl-builder
|
|
103
|
+
- pnpm add @openeuropa/bcl-bootstrap
|
|
104
|
+
- pnpm add @openeuropa/bcl-theme-default
|
|
105
105
|
|
|
106
106
|
NPM:
|
|
107
107
|
|
package/package.json
CHANGED
|
@@ -2,40 +2,35 @@
|
|
|
2
2
|
"name": "@openeuropa/bcl-builder",
|
|
3
3
|
"author": "European Commission",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.11.0",
|
|
6
6
|
"description": "Bootstrap Component Library builder",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
10
10
|
"bin": "./bin/build.js",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@babel/core": "7.
|
|
13
|
-
"@babel/preset-env": "7.
|
|
14
|
-
"@babel/runtime": "7.28.
|
|
12
|
+
"@babel/core": "7.29.0",
|
|
13
|
+
"@babel/preset-env": "7.29.0",
|
|
14
|
+
"@babel/runtime": "7.28.6",
|
|
15
15
|
"@popperjs/core": "2.11.8",
|
|
16
16
|
"@rollup/plugin-babel": "6.1.0",
|
|
17
|
-
"@rollup/plugin-commonjs": "
|
|
17
|
+
"@rollup/plugin-commonjs": "29.0.0",
|
|
18
18
|
"@rollup/plugin-node-resolve": "16.0.3",
|
|
19
|
-
"@rollup/plugin-replace": "6.0.
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"commander": "14.0.1",
|
|
19
|
+
"@rollup/plugin-replace": "6.0.3",
|
|
20
|
+
"@rollup/plugin-terser": "1.0.0",
|
|
21
|
+
"autoprefixer": "10.4.24",
|
|
22
|
+
"commander": "14.0.3",
|
|
24
23
|
"copyfiles": "2.4.1",
|
|
25
24
|
"cross-env": "10.1.0",
|
|
26
|
-
"cssnano": "7.1.
|
|
27
|
-
"eslint": "^9.37.0",
|
|
25
|
+
"cssnano": "7.1.2",
|
|
28
26
|
"postcss": "8.5.6",
|
|
29
27
|
"postcss-prefix-selector": "^2.1.1",
|
|
30
|
-
"rollup": "4.
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"sass": "1.93.2",
|
|
34
|
-
"svg-sprite": "2.0.4",
|
|
35
|
-
"svgo": "4.0.0"
|
|
28
|
+
"rollup": "4.59.0",
|
|
29
|
+
"sass": "1.98.0",
|
|
30
|
+
"svg-sprite": "2.0.4"
|
|
36
31
|
},
|
|
37
32
|
"engines": {
|
|
38
|
-
"node": ">=
|
|
33
|
+
"node": ">=22.0.0"
|
|
39
34
|
},
|
|
40
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "88c25456473404f881593e7c70bbb0ac99ae2d2b"
|
|
41
36
|
}
|
package/scripts/colorScheme.js
CHANGED
|
@@ -39,6 +39,19 @@ const getPlugins = (options) => {
|
|
|
39
39
|
return plugins;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
+
const resolveThemeSource = (includePaths, localPath, packagePath) => {
|
|
43
|
+
const candidates = [
|
|
44
|
+
...(includePaths || []).map((basePath) =>
|
|
45
|
+
path.resolve(basePath, packagePath),
|
|
46
|
+
),
|
|
47
|
+
// Keep installed package resolution first for compatibility, and only
|
|
48
|
+
// fall back to local workspace sources when building this monorepo.
|
|
49
|
+
path.resolve(process.cwd(), localPath),
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
return candidates.find((candidate) => fs.existsSync(candidate));
|
|
53
|
+
};
|
|
54
|
+
|
|
42
55
|
const buildColorScheme = (entry, dest, options) => {
|
|
43
56
|
const plugins = getPlugins(options);
|
|
44
57
|
|
|
@@ -51,21 +64,26 @@ const buildColorScheme = (entry, dest, options) => {
|
|
|
51
64
|
|
|
52
65
|
// Read contents of the entry file and the base color scheme SCSS file
|
|
53
66
|
const entryVariables = fs.readFileSync(entry, "utf8");
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
),
|
|
59
|
-
"utf8",
|
|
67
|
+
const importsPath = resolveThemeSource(
|
|
68
|
+
options.includePaths,
|
|
69
|
+
"src/scss/color-scheme.scss",
|
|
70
|
+
"@openeuropa/bcl-theme-default/src/scss/color-scheme.scss",
|
|
60
71
|
);
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
),
|
|
66
|
-
"utf8",
|
|
72
|
+
const generatorPath = resolveThemeSource(
|
|
73
|
+
options.includePaths,
|
|
74
|
+
"src/scss/color_scheme/generator.scss",
|
|
75
|
+
"@openeuropa/bcl-theme-default/src/scss/color_scheme/generator.scss",
|
|
67
76
|
);
|
|
68
77
|
|
|
78
|
+
if (!importsPath || !generatorPath) {
|
|
79
|
+
throw new Error(
|
|
80
|
+
"Could not resolve the default theme color-scheme sources.",
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const imports = fs.readFileSync(importsPath, "utf8");
|
|
85
|
+
const generator = fs.readFileSync(generatorPath, "utf8");
|
|
86
|
+
|
|
69
87
|
// Concatenate the contents
|
|
70
88
|
const scssContent = imports + "\n" + entryVariables + "\n" + generator;
|
|
71
89
|
|
|
@@ -78,6 +96,8 @@ const buildColorScheme = (entry, dest, options) => {
|
|
|
78
96
|
sourceMapContents: options.sourceMap === true,
|
|
79
97
|
sourceMapEmbed: options.sourceMap === true,
|
|
80
98
|
includePaths: [
|
|
99
|
+
path.dirname(importsPath),
|
|
100
|
+
path.dirname(generatorPath),
|
|
81
101
|
path.resolve(process.cwd(), "node_modules"),
|
|
82
102
|
...(options.includePaths || []),
|
|
83
103
|
],
|
package/scripts/scripts.js
CHANGED
|
@@ -36,7 +36,7 @@ const { babel } = require("@rollup/plugin-babel");
|
|
|
36
36
|
const { nodeResolve } = require("@rollup/plugin-node-resolve");
|
|
37
37
|
const babelPresetEnv = require("@babel/preset-env");
|
|
38
38
|
const rollup = require("rollup");
|
|
39
|
-
const
|
|
39
|
+
const terser = require("@rollup/plugin-terser");
|
|
40
40
|
|
|
41
41
|
module.exports = (input, dest, options) => {
|
|
42
42
|
const plugins = [
|
package/scripts/sprite.js
CHANGED
|
@@ -66,15 +66,17 @@ module.exports = (entry, dest, options) => {
|
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
files.forEach((file) => {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
const entryPaths = Array.isArray(entry) ? entry : [entry];
|
|
70
|
+
const filePath = entryPaths
|
|
71
|
+
.map((entryPath) => path.resolve(entryPath, file))
|
|
72
|
+
.find((resolvedPath) => fs.existsSync(resolvedPath));
|
|
73
|
+
|
|
74
|
+
if (!filePath) {
|
|
75
|
+
throw new Error(
|
|
76
|
+
`Could not resolve sprite source "${file}" from: ${entryPaths.join(", ")}`,
|
|
77
|
+
);
|
|
77
78
|
}
|
|
79
|
+
|
|
78
80
|
spriter.add(
|
|
79
81
|
filePath,
|
|
80
82
|
file,
|