wp-blank-scripts 3.1.16 → 3.1.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wp-blank-scripts",
3
- "version": "3.1.16",
3
+ "version": "3.1.18",
4
4
  "description": "Personal Wordpress Scripts",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -69,9 +69,8 @@
69
69
  "replace-in-file": "^7.0.1",
70
70
  "rimraf": "^5.0.5",
71
71
  "rsync": "^0.6.1",
72
- "sass": "^1.63.4",
73
- "sass-loader": "^13.3.2",
74
- "sass-resources-loader": "^2.2.5",
72
+ "sass": "^1.97.3",
73
+ "sass-loader": "16.0.7",
75
74
  "semver": "^7.5.2",
76
75
  "slugify": "^1.6.6",
77
76
  "ssh2": "0.8.9",
@@ -1,13 +1,19 @@
1
1
  const cp = require('child_process');
2
+ const fs = require('fs');
2
3
 
3
4
  const logger = require('../logger');
4
5
  const { isWindows } = require('./checkPlatform');
5
6
 
7
+ const mamp6Path = '/Applications/MAMP/bin';
8
+ const mamp7Path = '/Applications/MAMP/Library/bin'; //MAMP7 moved mysql path
9
+
10
+ const mampPath = fs.existsSync(mamp7Path) ? mamp7Path : mamp6Path;
11
+
6
12
  function startMAMP() {
7
13
  if (isWindows) {
8
14
  return;
9
15
  }
10
- cp.execFile('/Applications/MAMP/bin/start.sh');
16
+ cp.execFile(`${mampPath}/start.sh`);
11
17
  logger.info('MAMP Started');
12
18
  }
13
19
 
@@ -236,6 +236,7 @@ function makeBaseConfig(options) {
236
236
  options: {
237
237
  sourceMap: !isProd,
238
238
  additionalData: sassVariables,
239
+ api: 'modern',
239
240
  },
240
241
  },
241
242
  ],
@@ -19,6 +19,9 @@ function makeReactWebpackConfig(options) {
19
19
  const sourcePath = path.join(process.cwd(), sourceDir);
20
20
  const entryPath = [path.join(sourcePath, 'index.js')];
21
21
  const globalVariablesPath = path.join(sourcePath, 'variables.scss');
22
+ const globalVariables = fs.existsSync(globalVariablesPath)
23
+ ? fs.readFileSync(globalVariablesPath, 'utf8') + '\n'
24
+ : '';
22
25
 
23
26
  const settings = getSettings();
24
27
  const themeDir = path.join('wp-content', 'themes', settings.project);
@@ -133,12 +136,8 @@ function makeReactWebpackConfig(options) {
133
136
  loader: 'sass-loader',
134
137
  options: {
135
138
  sourceMap: !isProd,
136
- },
137
- },
138
- {
139
- loader: 'sass-resources-loader',
140
- options: {
141
- resources: globalVariablesPath,
139
+ api: 'modern',
140
+ additionalData: globalVariables || undefined,
142
141
  },
143
142
  },
144
143
  ],