forked from ATaylor66/wpseo-woocommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
87 lines (82 loc) · 2.41 KB
/
Copy pathGruntfile.js
File metadata and controls
87 lines (82 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* global require, process */
const { flattenVersionForFile } = require( "./config/grunt/lib/version.js" );
const timeGrunt = require( "time-grunt" );
const loadGruntConfig = require( "load-grunt-config" );
const path = require( "path" );
require( "dotenv" ).config();
module.exports = function( grunt ) {
timeGrunt( grunt );
const pkg = grunt.file.readJSON( "package.json" );
const pluginVersion = pkg.yoast.pluginVersion;
// Define project configuration
const project = {
pluginVersion: pluginVersion,
pluginSlug: "wpseo-woocommerce",
pluginMainFile: "wpseo-woocommerce.php",
pluginVersionConstant: "WPSEO_WOO_VERSION",
paths: {
/**
* Gets the config path.
*
* @returns {string} Config path.
*/
get config() {
return this.grunt + "task-config/";
},
grunt: "config/grunt/",
languages: "languages/",
logs: "logs/",
},
files: {
/**
* Gets the config path.
*
* @returns {string} Config path.
*/
get config() {
return project.paths.config + "*.js";
},
grunt: "Gruntfile.js",
artifact: "artifact",
php: [
"*.php",
"classes/**/*.php",
],
phptests: "tests/**/*.php",
js: [
"js/src/**/*.js",
],
},
pkg: grunt.file.readJSON( "package.json" ),
};
project.pluginVersionSlug = flattenVersionForFile( pluginVersion );
// Load Grunt configurations and tasks
loadGruntConfig( grunt, {
configPath: path.join( process.cwd(), "node_modules/@yoast/grunt-plugin-tasks/config/" ),
overridePath: path.join( process.cwd(), project.paths.config ),
data: project,
jitGrunt: {
staticMappings: {
addtextdomain: "grunt-wp-i18n",
makepot: "grunt-wp-i18n",
gittag: "grunt-git",
gitfetch: "grunt-git",
gitadd: "grunt-git",
gitstatus: "grunt-git",
gitcommit: "grunt-git",
gitcheckout: "grunt-git",
gitpull: "grunt-git",
gitpush: "grunt-git",
/* eslint-disable-next-line camelcase */
glotpress_download: "grunt-glotpress",
"update-version": "./node_modules/@yoast/grunt-plugin-tasks/tasks/update-version.js",
"set-version": "./node_modules/@yoast/grunt-plugin-tasks/tasks/set-version.js",
"update-changelog-with-latest-pr-texts": "@yoast/grunt-plugin-tasks",
"get-latest-pr-texts": "@yoast/grunt-plugin-tasks",
"update-changelog": "@yoast/grunt-plugin-tasks",
"build-qa-changelog": "@yoast/grunt-plugin-tasks",
"download-qa-changelog": "@yoast/grunt-plugin-tasks",
},
},
} );
};