sdc-build-wp 2.0.0 → 2.1.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/index.js CHANGED
@@ -20,7 +20,7 @@ let chokidarOpts = {
20
20
  let sassGlobPath = project.package?.sdc?.sassGlobPath || project.path + '/_src/style/**/*.scss';
21
21
  let sassGlob = glob.sync(sassGlobPath, {
22
22
  ignore: [
23
- project.path + '/_src/style/partials/_colors.scss'
23
+ project.path + '/_src/style/partials/_theme.scss'
24
24
  ]
25
25
  });
26
26
 
@@ -8,7 +8,8 @@ const buildBrowserSync = () => {
8
8
  proxy: project.package.sdc?.browsersync?.localProxyURL,
9
9
  files: [
10
10
  project.path + '/dist/**/*',
11
- project.path + '/**/*.php'
11
+ project.path + '/**/*.php',
12
+ project.path + '/**/*.html'
12
13
  ],
13
14
  open: project.package.sdc?.open || false,
14
15
  https: (process.env.SSL_KEY_PATH && process.env.SSL_CRT_PATH ? {
package/lib/style.js CHANGED
@@ -13,18 +13,27 @@ import { promises } from 'fs';
13
13
  const buildColors = async () => {
14
14
  try {
15
15
  let theme = JSON.parse(await promises.readFile(project.path + '/theme.json'));
16
- if (theme.settings?.color?.palette?.length > 0) {
17
- let palette = theme.settings.color.palette;
18
- let colorFileData = `// This file is automatically generated. Do not edit.\n`;
19
- for (var color of palette) {
20
- colorFileData += `$${color['slug']}: ${color['color']};\n`;
16
+ let themeFileData = `// This file is automatically generated. Do not edit.\n`;
17
+ if (theme.settings?.typography?.fontFamilies) {
18
+ for (var fontFamily of theme.settings.typography.fontFamilies) {
19
+ themeFileData += `$${fontFamily['slug']}: ${fontFamily['fontFamily']};\n`;
21
20
  }
22
- try {
23
- await promises.writeFile(project.path + '/_src/style/partials/_colors.scss', colorFileData);
24
- } catch {
25
- log('error', `Failed to read write colors.scss - See above error.`);
21
+ }
22
+ if (theme.settings?.color?.palette) {
23
+ for (var color of theme.settings.color.palette) {
24
+ themeFileData += `$${color['slug']}: ${color['color']};\n`;
25
+ }
26
+ }
27
+ if (theme.settings?.color?.gradients) {
28
+ for (var color of theme.settings.color.gradients) {
29
+ themeFileData += `$gradient-${color['slug']}: ${color['gradient']};\n`;
26
30
  }
27
31
  }
32
+ try {
33
+ await promises.writeFile(project.path + '/_src/style/partials/_theme.scss', themeFileData);
34
+ } catch {
35
+ log('error', `Failed to write auto-generated _theme.scss - See above error.`);
36
+ }
28
37
  } catch {
29
38
  log('error', `Failed to read theme.json - See above error.`);
30
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdc-build-wp",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Custom WordPress build process.",
5
5
  "author": {
6
6
  "name": "Robert Sefer",
@@ -19,23 +19,23 @@
19
19
  "sdc-build-wp": "./index.js"
20
20
  },
21
21
  "dependencies": {
22
- "autoprefixer": "^10.4.0",
23
- "browser-sync": "^2.27.7",
24
- "chalk": "^5.0.0",
25
- "chokidar": "^3.5.2",
26
- "esbuild": "^0.14.8",
27
- "eslint": "^8.5.0",
28
- "fs-extra": "^10.0.0",
29
- "glob": "^7.2.0",
22
+ "autoprefixer": "^10.4.7",
23
+ "browser-sync": "^2.27.10",
24
+ "chalk": "^5.0.1",
25
+ "chokidar": "^3.5.3",
26
+ "esbuild": "^0.14.46",
27
+ "eslint": "^8.18.0",
28
+ "fs-extra": "^10.1.0",
29
+ "glob": "^8.0.3",
30
30
  "imagemin": "^8.0.1",
31
31
  "imagemin-jpegtran": "^7.0.0",
32
32
  "imagemin-pngquant": "^9.0.2",
33
33
  "imagemin-svgo": "^10.0.1",
34
- "minimist": "^1.2.5",
34
+ "minimist": "^1.2.6",
35
35
  "postcss": "^8.4.5",
36
- "postcss-scss": "^4.0.2",
36
+ "postcss-scss": "^4.0.4",
37
37
  "postcss-sort-media-queries": "^4.2.1",
38
- "sass": "^1.45.1",
39
- "stylelint": "^14.2.0"
38
+ "sass": "^1.52.3",
39
+ "stylelint": "^14.9.1"
40
40
  }
41
41
  }