@openeuropa/bcl-theme-joinup 1.11.0 → 1.12.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.
@@ -29,19 +29,22 @@ const resolvePackagePath = (packageName, ...segments) => {
29
29
  }
30
30
  }
31
31
 
32
- return path.resolve(packageRoot, ...segments);
32
+ return path.resolve(fs.realpathSync(packageRoot), ...segments);
33
33
  };
34
34
 
35
35
  const outputFolder = path.resolve(__dirname);
36
36
  const repoRoot = path.resolve(__dirname, "../../../");
37
37
  const nodeModules = path.resolve(__dirname, "../../../node_modules");
38
+ const toOutputRelativePath = (targetPath) =>
39
+ path.relative(outputFolder, targetPath);
40
+ const toOutputRelativePackagePath = (packagePath, ...segments) =>
41
+ toOutputRelativePath(path.resolve(packagePath, ...segments));
38
42
  const bootstrapIconsPath = resolvePackagePath("bootstrap-icons");
39
43
  const twigTemplatesPath = resolvePackagePath("@openeuropa/bcl-twig-templates");
40
44
  const resourcesFlagIconsPath = resolvePackagePath("@ecl/resources-flag-icons");
41
45
  const resourcesEcLogoPath = resolvePackagePath("@ecl/resources-ec-logo");
42
46
  const resourcesEuLogoPath = resolvePackagePath("@ecl/resources-eu-logo");
43
47
  const slimSelectPath = resolvePackagePath("slim-select");
44
- const slimSelect2Path = resolvePackagePath("slim-select-2");
45
48
  const flagIconsPath = resolvePackagePath("flag-icons");
46
49
  const bootstrapReplaceIconsPath = path.resolve(
47
50
  repoRoot,
@@ -50,11 +53,21 @@ const bootstrapReplaceIconsPath = path.resolve(
50
53
 
51
54
  // SCSS includePaths
52
55
  const includePaths = [nodeModules];
56
+ const silenceDeprecations = [
57
+ "legacy-js-api",
58
+ "import",
59
+ "color-functions",
60
+ "if-function",
61
+ "global-builtin",
62
+ ];
53
63
  const excludePaths = [];
54
64
  if (templates.length) {
55
65
  templates.forEach((template) => {
56
66
  excludePaths.push(
57
- path.resolve(twigTemplatesPath, `templates/bcl-${template}/*.html.twig`),
67
+ toOutputRelativePackagePath(
68
+ twigTemplatesPath,
69
+ `templates/bcl-${template}/*.html.twig`,
70
+ ),
58
71
  );
59
72
  });
60
73
  }
@@ -130,14 +143,8 @@ module.exports = {
130
143
  dest: path.resolve(outputFolder, "css/oe-bcl-joinup.css"),
131
144
  options: {
132
145
  includePaths,
146
+ silenceDeprecations,
133
147
  sourceMap: "file",
134
- silenceDeprecations: [
135
- "legacy-js-api",
136
- "import",
137
- "color-functions",
138
- "if-function",
139
- "global-builtin",
140
- ],
141
148
  },
142
149
  },
143
150
  {
@@ -145,15 +152,9 @@ module.exports = {
145
152
  dest: path.resolve(outputFolder, "css/oe-bcl-joinup.min.css"),
146
153
  options: {
147
154
  includePaths,
155
+ silenceDeprecations,
148
156
  sourceMap: "file",
149
157
  minify: true,
150
- silenceDeprecations: [
151
- "legacy-js-api",
152
- "import",
153
- "color-functions",
154
- "if-function",
155
- "global-builtin",
156
- ],
157
158
  },
158
159
  },
159
160
  ],
@@ -175,11 +176,6 @@ module.exports = {
175
176
  to: path.resolve(outputFolder, "js"),
176
177
  options: { up: true },
177
178
  },
178
- {
179
- from: [path.resolve(slimSelect2Path, "dist/slimselect.min.js")],
180
- to: path.resolve(outputFolder, "js/slim-select-2"),
181
- options: { up: true },
182
- },
183
179
  {
184
180
  from: [path.resolve(bootstrapIconsPath, "bootstrap-icons.svg")],
185
181
  to: path.resolve(outputFolder, "icons"),
@@ -193,24 +189,26 @@ module.exports = {
193
189
  options: { up: true },
194
190
  },
195
191
  {
196
- from: [path.resolve(flagIconsPath, "flags/**/*.svg")],
192
+ from: [toOutputRelativePackagePath(flagIconsPath, "flags/**/*.svg")],
197
193
  to: path.resolve(outputFolder, "icons/world-flags"),
198
- options: { up: 6 },
194
+ options: { up: 5 },
199
195
  },
200
196
  {
201
- from: [path.resolve(resourcesEcLogoPath, "**/*.svg")],
197
+ from: [toOutputRelativePackagePath(resourcesEcLogoPath, "**/*.svg")],
202
198
  to: path.resolve(outputFolder, "logos/ec"),
203
- options: { up: 7 },
199
+ options: { up: 6 },
204
200
  },
205
201
  {
206
- from: [path.resolve(resourcesEuLogoPath, "**/*.svg")],
202
+ from: [toOutputRelativePackagePath(resourcesEuLogoPath, "**/*.svg")],
207
203
  to: path.resolve(outputFolder, "logos/eu"),
208
- options: { up: 7 },
204
+ options: { up: 6 },
209
205
  },
210
206
  {
211
- from: [path.resolve(twigTemplatesPath, "templates/**/*.twig")],
207
+ from: [
208
+ toOutputRelativePackagePath(twigTemplatesPath, "templates/**/*.twig"),
209
+ ],
212
210
  to: path.resolve(outputFolder, "templates"),
213
- options: { up: 8, exclude: excludePaths },
211
+ options: { up: 5, exclude: excludePaths },
214
212
  },
215
213
  {
216
214
  from: ["src/templates/**/*.twig"],