@fontoxml/fontoxml-development-tools 3.10.0-beta.1 → 3.10.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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@fontoxml/fontoxml-development-tools",
3
- "version": "3.10.0-beta.1",
3
+ "version": "3.10.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@fontoxml/fontoxml-development-tools",
9
- "version": "3.10.0-beta.1",
9
+ "version": "3.10.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@babel/core": "7.14.6",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fontoxml/fontoxml-development-tools",
3
3
  "description": "Development tools for Fonto.",
4
- "version": "3.10.0-beta.1",
4
+ "version": "3.10.0",
5
5
  "author": "The Fonto Team",
6
6
  "license": "MIT",
7
7
  "keywords": [
@@ -8,8 +8,6 @@ import webpack from 'webpack';
8
8
 
9
9
  import normalisePath from '../helpers/normalisePath.js';
10
10
 
11
- const emittedAssets = new Map();
12
-
13
11
  const __filename = fileURLToPath(import.meta.url);
14
12
  const __dirname = path.dirname(__filename);
15
13
 
@@ -26,12 +24,14 @@ export default class CopyPlugin {
26
24
  * @param {Compiler} compiler
27
25
  */
28
26
  apply(compiler) {
27
+ const emittedAssets = new Map();
28
+
29
29
  let packageInfos;
30
30
 
31
31
  compiler.hooks.thisCompilation.tap(CopyPlugin.name, (compilation) => {
32
- compilation.hooks.additionalAssets.tapAsync(
32
+ compilation.hooks.additionalAssets.tapPromise(
33
33
  CopyPlugin.name,
34
- async (callback) => {
34
+ async () => {
35
35
  if (
36
36
  compilation.packagesInfoInLoadOrderError ||
37
37
  !compilation.packagesInfoInLoadOrder
@@ -43,7 +43,7 @@ export default class CopyPlugin {
43
43
  );
44
44
  packageInfos = error.packageInfos || [];
45
45
  compilation.errors.push(error);
46
- return callback();
46
+ return;
47
47
  }
48
48
 
49
49
  const templatesPath = normalisePath(
@@ -207,77 +207,64 @@ export default class CopyPlugin {
207
207
  }
208
208
  )
209
209
  );
210
-
211
- return callback();
212
210
  }
213
211
  );
212
+ });
214
213
 
215
- compiler.hooks.afterEmit.tapAsync(
216
- CopyPlugin.name,
217
- async (compilation, callback) => {
218
- await Promise.all(
219
- packageInfos.map(async (packageInfo) => {
220
- const packagePath = path.normalize(
221
- packageInfo.path
222
- );
214
+ compiler.hooks.afterEmit.tapPromise(
215
+ CopyPlugin.name,
216
+ async (compilation) => {
217
+ await Promise.all(
218
+ packageInfos.map(async (packageInfo) => {
219
+ const packagePath = path.normalize(packageInfo.path);
223
220
 
224
- if (
225
- packagePath ===
226
- path.join(
227
- this.options.platformFolder,
228
- packageInfo.name
229
- )
230
- ) {
231
- return;
232
- }
221
+ if (
222
+ packagePath ===
223
+ path.join(
224
+ this.options.platformFolder,
225
+ packageInfo.name
226
+ )
227
+ ) {
228
+ return;
229
+ }
230
+
231
+ if (packageInfo.name === 'config') {
232
+ compilation.contextDependencies.add(packagePath);
233
+ } else {
234
+ const srcFolderPath = path.join(packagePath, 'src');
235
+ const hasSrcFolder = await fs.pathExists(
236
+ srcFolderPath
237
+ );
233
238
 
234
- if (packageInfo.name === 'config') {
239
+ if (hasSrcFolder) {
235
240
  compilation.contextDependencies.add(
236
- packagePath
241
+ srcFolderPath
237
242
  );
238
243
  } else {
239
- const srcFolderPath = path.join(
240
- packagePath,
241
- 'src'
242
- );
243
- const hasSrcFolder = await fs.pathExists(
244
+ compilation.missingDependencies.add(
244
245
  srcFolderPath
245
246
  );
246
-
247
- if (hasSrcFolder) {
248
- compilation.contextDependencies.add(
249
- srcFolderPath
250
- );
251
- } else {
252
- compilation.missingDependencies.add(
253
- srcFolderPath
254
- );
255
- }
256
247
  }
248
+ }
257
249
 
258
- const fontoManifestPath = path.join(
259
- packagePath,
260
- 'fonto-manifest.json'
261
- );
262
- const hasManifest = await fs.pathExists(
250
+ const fontoManifestPath = path.join(
251
+ packagePath,
252
+ 'fonto-manifest.json'
253
+ );
254
+ const hasManifest = await fs.pathExists(
255
+ fontoManifestPath
256
+ );
257
+
258
+ if (hasManifest) {
259
+ compilation.fileDependencies.add(fontoManifestPath);
260
+ } else {
261
+ compilation.missingDependencies.add(
263
262
  fontoManifestPath
264
263
  );
265
-
266
- if (hasManifest) {
267
- compilation.fileDependencies.add(
268
- fontoManifestPath
269
- );
270
- } else {
271
- compilation.missingDependencies.add(
272
- fontoManifestPath
273
- );
274
- }
275
- })
276
- );
277
-
278
- return callback();
279
- }
280
- );
281
- });
264
+ }
265
+ })
266
+ );
267
+ }
268
+ );
282
269
  }
283
270
  }