@caweb/webpack 1.3.29 → 1.3.31

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@caweb/html-webpack-plugin",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "CAWebPublishing Sample Page and Configurations",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -15,9 +15,8 @@
15
15
  ],
16
16
  "scripts": {
17
17
  "webpack": "webpack",
18
- "postbuild": "npm run create-entrypoint && npm run generate-json",
18
+ "postbuild": "npm run create-entrypoint",
19
19
  "create-entrypoint": "node ./scripts/create-entrypoints.js",
20
- "generate-json": "node ./scripts/icon.js",
21
20
  "update-scripts": "node ./scripts/update-scripts.js",
22
21
  "new-scheme": "node ./scripts/schemes.js",
23
22
  "remove-scheme": "node ./scripts/schemes.js -r",
@@ -106,20 +105,20 @@
106
105
  },
107
106
  "homepage": "https://github.com/CAWebPublishing/webpack/plugins/html#readme",
108
107
  "devDependencies": {
109
- "@inquirer/prompts": "^7.3.2",
108
+ "@inquirer/prompts": "^7.4.0",
110
109
  "animate.css": "^4.1.1",
111
110
  "bootstrap": "^5.3.3",
112
111
  "bootstrap-forced-colors-css": "^1.0.7",
113
112
  "chalk": "^5.4.1",
114
113
  "cross-spawn": "^7.0.6",
115
- "fast-xml-parser": "^5.0.8",
114
+ "fast-xml-parser": "^5.0.9",
116
115
  "mini-css-extract-plugin": "^2.9.2"
117
116
  },
118
117
  "dependencies": {
119
118
  "@caweb/a11y-webpack-plugin": "^1.0.9",
120
119
  "@caweb/css-audit-webpack-plugin": "^1.0.12",
121
120
  "@caweb/jshint-webpack-plugin": "^2.0.1",
122
- "@wordpress/scripts": "^30.12.0",
121
+ "@wordpress/scripts": "^30.13.0",
123
122
  "css-minimizer-webpack-plugin": "^7.0.2",
124
123
  "handlebars-loader": "^1.7.3",
125
124
  "html-webpack-link-type-plugin": "^1.1.1",
@@ -25,7 +25,7 @@
25
25
  {{/each}}
26
26
  {{/if}}
27
27
  </head>
28
- <body class="page-template-serp">
28
+ <body class="page-template-searchpage">
29
29
  {{> header }}
30
30
  <div id="page-container" class="page-container">
31
31
  <div id="main-content" class="main-content" tabindex="-1">
@@ -10,7 +10,6 @@ import { fileURLToPath } from 'url';
10
10
  const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
11
11
 
12
12
  let entry = {
13
- 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css')
14
13
  };
15
14
 
16
15
  // create the entry directory
@@ -25,7 +24,6 @@ let heading = `/**
25
24
  fs.readdirSync(path.join(currentPath, 'src', 'styles', 'colorschemes')).forEach((c) => {
26
25
  let scheme = c.substring(0, c.indexOf('.')).replace(' ', '');
27
26
  let files = [
28
- path.join(currentPath, 'src', 'styles', 'font-only.css'),
29
27
  path.join(currentPath, 'src', 'styles', 'colorschemes', c),
30
28
  path.join(currentPath, 'src', 'scripts', 'index.js')
31
29
  ]
@@ -40,7 +38,6 @@ const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '
40
38
 
41
39
  export default {
42
40
  entry: {
43
- 'font-only': path.join(currentPath, 'src', 'styles', 'font-only.css'),
44
41
  ${scheme}: [
45
42
  path.join(currentPath, ${correctFiles.join('),\n' + `\t`.repeat(3) + 'path.join(currentPath, ')})
46
43
  ]
@@ -11,9 +11,8 @@ const pkg = JSON.parse( fs.readFileSync(path.resolve('package.json')) );
11
11
 
12
12
  let scripts = {
13
13
  "webpack": "webpack",
14
- "postbuild": "npm run create-entrypoint && npm run generate-json",
14
+ "postbuild": "npm run create-entrypoint",
15
15
  "create-entrypoint": "node ./scripts/create-entrypoints.js",
16
- "generate-json": "node ./scripts/icon.js",
17
16
  "update-scripts": "node ./scripts/update-scripts.js",
18
17
  "new-scheme": "node ./scripts/schemes.js",
19
18
  "remove-scheme": "node ./scripts/schemes.js -r",
@@ -114,7 +114,8 @@ let webpackConfig = {
114
114
  stats: 'errors',
115
115
  output: {
116
116
  ...baseConfig.output,
117
- clean: mode === 'production'
117
+ clean: mode === 'production',
118
+ pathinfo: false
118
119
  },
119
120
  performance: {
120
121
  maxAssetSize: 500000,
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * External dependencies
5
- */
6
- import fs from 'fs';
7
- import path from 'path';
8
- import { fileURLToPath } from 'url';
9
-
10
- const currentPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
11
- const fontBuildPath = path.join(currentPath, 'build', 'fonts');
12
-
13
-
14
- // iterate over all svg files
15
- fs.readdirSync(fontBuildPath).filter( (e) => e.endsWith('.svg')).forEach((c) => {
16
-
17
- // we can't use a parser otherwise some of the unicodes will be encoded
18
- // we parse the file ourselves.
19
- let svgContent = fs.readFileSync(path.join(fontBuildPath, c)).toString();
20
-
21
- // we only want the glyph with unicodes
22
- let icons = [ ...svgContent.matchAll(/glyph unicode=[^\n].*/g) ].map((i) => {
23
- let raw = i[0];
24
- let glyph = raw.match(/glyph-name="([\S]+)"/);
25
-
26
- // only if there is a name associated with the glyph.
27
- if( glyph ){
28
-
29
- let unicode = raw.match(/unicode="([\S]+)"/)[1];
30
- let name = glyph[1];
31
- let ws = name.replace(/[_-]/g, ' ').split(' ');
32
-
33
- // the styles is applied by certain editors/builders
34
- // divi - Applies Divi Theme Support
35
- // line - Applies Line Styles
36
- // solid - Applied Solid Styles
37
- let styles = [
38
- 'divi',
39
- ws.includes('line') ? 'line' : 'solid'
40
- ]
41
-
42
- return {
43
- glyph: name,
44
- unicode,
45
- name: ws.map(w => w.charAt(0).toUpperCase() + w.substring(1)).join(' '), // uppercase all words and join with a space
46
- search_terms: ws.join(' '),
47
- styles
48
- }
49
- }
50
-
51
-
52
- }).filter(e=>e); // clear out any null values
53
-
54
- // write svg json output
55
- fs.writeFileSync(
56
- path.join(fontBuildPath, `${c.substring(0, c.lastIndexOf('.'))}.json`),
57
- JSON.stringify( icons, null, 4 )
58
- )
59
-
60
- })