@lipemat/js-boilerplate-shared 0.2.0 → 0.2.2
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/config/tsconfig.json +37 -0
- package/helpers/package-config.js +1 -0
- package/helpers/package-config.js.map +1 -1
- package/helpers/package-config.ts +2 -0
- package/helpers/wp-externals.js +6 -1
- package/helpers/wp-externals.js.map +1 -1
- package/helpers/wp-externals.ts +6 -1
- package/package.json +1 -1
- package/lib/package.json +0 -114
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"//~~": "PHPStorm will only see changes to the file if you re-save the project root's tsconfig.json file",
|
|
3
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
4
|
+
"display": "JS Boilerplate",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"allowImportingTsExtensions": true,
|
|
7
|
+
"allowSyntheticDefaultImports": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"jsx": "react-jsx",
|
|
11
|
+
"lib": [
|
|
12
|
+
"DOM",
|
|
13
|
+
"ES2022"
|
|
14
|
+
],
|
|
15
|
+
"module": "ESNext",
|
|
16
|
+
"moduleResolution": "bundler",
|
|
17
|
+
"noEmit": true,
|
|
18
|
+
"noFallthroughCasesInSwitch": true,
|
|
19
|
+
"noImplicitReturns": true,
|
|
20
|
+
"noImplicitThis": true,
|
|
21
|
+
"paths": {
|
|
22
|
+
"$src": [
|
|
23
|
+
"./js/src"
|
|
24
|
+
],
|
|
25
|
+
"$src/*": [
|
|
26
|
+
"./js/src/*"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"skipLibCheck": true,
|
|
30
|
+
"sourceMap": true,
|
|
31
|
+
"strict": true,
|
|
32
|
+
"strictBindCallApply": true,
|
|
33
|
+
"strictNullChecks": true,
|
|
34
|
+
"target": "ES2022",
|
|
35
|
+
"verbatimModuleSyntax": false
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-config.js","sourceRoot":"","sources":["package-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAEnD,SAAS,YAAY,CAAK,QAAgB;IACzC,OAAO,IAAI,CAAC,KAAK,CAAE,YAAY,CAAE,QAAQ,EAAE,MAAM,CAAE,CAAO,CAAC;AAC5D,CAAC;
|
|
1
|
+
{"version":3,"file":"package-config.js","sourceRoot":"","sources":["package-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAEnD,SAAS,YAAY,CAAK,QAAgB;IACzC,OAAO,IAAI,CAAC,KAAK,CAAE,YAAY,CAAE,QAAQ,EAAE,MAAM,CAAE,CAAO,CAAC;AAC5D,CAAC;AAsDD,MAAM,gBAAgB,GAAG,YAAY,CAAE,OAAO,CAAC,GAAG,EAAE,CAAE,CAAC;AACvD,MAAM,QAAQ,GAA2B;IACxC,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,aAAa;IACzB,MAAM,EAAE,MAAM;IACd,eAAe,EAAE,WAAW;IAC5B,gBAAgB,EAAE,gBAAgB;IAClC,SAAS,EAAE,CAAE,MAAM,EAAE,gBAAgB,CAAE;IACvC,QAAQ,EAAE,CAAE,GAAG,CAAE;IACjB,eAAe,EAAE,IAAI;IACrB,UAAU,EAAE,IAAI;IAChB,GAAG,EAAE,kBAAkB;CACvB,CAAC;AAEF,IAAI,aAAa,GAAkB,YAAY,CAAiB,OAAO,CAAE,gBAAgB,EAAE,cAAc,CAAE,CAAE,CAAC;AAC9G,aAAa,GAAG,EAAC,GAAG,QAAQ,EAAE,GAAG,aAAa,EAAC,CAAC;AAChD,aAAa,CAAC,gBAAgB,GAAG,aAAa,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAE,aAAa,CAAC,MAAM,CAAE,CAAC,OAAO,CAAE,KAAK,EAAE,GAAG,CAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAExI,IAAI,CAAC;IACJ,MAAM,WAAW,GAAG,YAAY,CAA0B,OAAO,CAAE,gBAAgB,EAAE,qBAAqB,CAAE,CAAE,CAAC;IAC/G,aAAa,GAAG,EAAC,GAAG,aAAa,EAAE,GAAG,WAAW,EAAC,CAAC;AACpD,CAAC;AAAC,MAAM,CAAC;AACT,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB;IAC/B,OAAO,EAAC,GAAG,aAAa,EAAE,GAAG,aAAa,EAAC,CAAC;AAC7C,CAAC;AAED;;;;GAIG;AACH,IAAI,aAAa,GAA2B,EAAE,CAAC;AAE/C,MAAM,UAAU,mBAAmB,CAAE,SAAiC;IACrE,aAAa,GAAG,SAAS,CAAC;AAC3B,CAAC;AACD,MAAM,UAAU,kBAAkB;IACjC,aAAa,GAAG,EAAE,CAAC;AACpB,CAAC"}
|
|
@@ -25,6 +25,7 @@ export interface PackageConfig {
|
|
|
25
25
|
packageDirectory: string;
|
|
26
26
|
packageManager?: string;
|
|
27
27
|
pcssWatch: string[];
|
|
28
|
+
phpWatch: string[];
|
|
28
29
|
resolutions?: Dependencies;
|
|
29
30
|
scripts: Partial<Scripts>;
|
|
30
31
|
theme_path: string;
|
|
@@ -66,6 +67,7 @@ const defaults: Partial<PackageConfig> = {
|
|
|
66
67
|
mainCssFileName: 'front-end',
|
|
67
68
|
packageDirectory: workingDirectory,
|
|
68
69
|
pcssWatch: [ 'pcss', 'template-parts' ],
|
|
70
|
+
phpWatch: [ '/' ],
|
|
69
71
|
shortCssClasses: true,
|
|
70
72
|
theme_path: './',
|
|
71
73
|
url: 'http://localhost',
|
package/helpers/wp-externals.js
CHANGED
|
@@ -72,11 +72,16 @@ const wpExports = [
|
|
|
72
72
|
wp: 'wp',
|
|
73
73
|
react: 'React',
|
|
74
74
|
'react-dom': 'ReactDOM',
|
|
75
|
+
/**
|
|
76
|
+
* To allow React Fast Refresh (HMR) to work in WP 6.0+ we must
|
|
77
|
+
* externalize fast refresh or dequeue `wp-react-refresh-runtime`.
|
|
78
|
+
*
|
|
79
|
+
* @see \wp_register_development_scripts
|
|
80
|
+
*/
|
|
75
81
|
'react-refresh/runtime': 'ReactRefreshRuntime',
|
|
76
82
|
jquery: 'jQuery',
|
|
77
83
|
tinymce: 'tinymce',
|
|
78
84
|
moment: 'moment',
|
|
79
|
-
'react/jsx-runtime': 'ReactJSXRuntime',
|
|
80
85
|
backbone: 'Backbone',
|
|
81
86
|
});
|
|
82
87
|
export default wpExports;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wp-externals.js","sourceRoot":"","sources":["wp-externals.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,aAAa,GAAG,CAAE,IAAY,EAAW,EAAE,CAAC,IAAI,CAAC,OAAO,CAAE,WAAW,EAAE,CAAE,KAAK,EAAE,MAAM,EAAG,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAE,CAAC;AAEzH;;;;;GAKG;AACH,MAAM,SAAS,GAAiC;IAC/C,MAAM;IACN,aAAa;IACb,WAAW;IACX,OAAO;IACP,MAAM;IACN,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,oCAAoC;IACpC,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,SAAS;IACT,WAAW;IACX,MAAM;IACN,eAAe;IACf,MAAM;IACN,YAAY;IACZ,KAAK;IACL,WAAW;IACX,WAAW;IACX,WAAW;IACX,QAAQ;IACR,SAAS;IACT,aAAa;IACb,OAAO;IACP,eAAe;IACf,MAAM;IACN,kBAAkB;IAClB,oBAAoB;IACpB,UAAU;IACV,sBAAsB;IACtB,aAAa;IACb,SAAS;IACT,KAAK;IACL,SAAS;IACT,YAAY;IACZ,gBAAgB;IAChB,eAAe;IACf,iBAAiB;IACjB,WAAW;IACX,oBAAoB;IACpB,WAAW;IACX,YAAY;IACZ,KAAK;IACL,OAAO;IACP,UAAU;IACV,SAAS;IACT,WAAW;CACX,CAAC,MAAM,CACP,CAAE,SAAS,EAAE,IAAI,EAAG,EAAE,CAAC,CAAE;IACxB,GAAG,SAAS;IACZ,CAAE,cAAc,IAAI,EAAE,CAAE,EAAE,cAAc,aAAa,CAAE,IAAI,CAAE,EAAE;CAC/D,CAAE,EACH;IACC,MAAM,EAAE,QAAQ;IAChB,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,UAAU;IACvB,uBAAuB,EAAE,qBAAqB;IAC9C,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,
|
|
1
|
+
{"version":3,"file":"wp-externals.js","sourceRoot":"","sources":["wp-externals.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,aAAa,GAAG,CAAE,IAAY,EAAW,EAAE,CAAC,IAAI,CAAC,OAAO,CAAE,WAAW,EAAE,CAAE,KAAK,EAAE,MAAM,EAAG,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAE,CAAC;AAEzH;;;;;GAKG;AACH,MAAM,SAAS,GAAiC;IAC/C,MAAM;IACN,aAAa;IACb,WAAW;IACX,OAAO;IACP,MAAM;IACN,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,oCAAoC;IACpC,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,SAAS;IACT,WAAW;IACX,MAAM;IACN,eAAe;IACf,MAAM;IACN,YAAY;IACZ,KAAK;IACL,WAAW;IACX,WAAW;IACX,WAAW;IACX,QAAQ;IACR,SAAS;IACT,aAAa;IACb,OAAO;IACP,eAAe;IACf,MAAM;IACN,kBAAkB;IAClB,oBAAoB;IACpB,UAAU;IACV,sBAAsB;IACtB,aAAa;IACb,SAAS;IACT,KAAK;IACL,SAAS;IACT,YAAY;IACZ,gBAAgB;IAChB,eAAe;IACf,iBAAiB;IACjB,WAAW;IACX,oBAAoB;IACpB,WAAW;IACX,YAAY;IACZ,KAAK;IACL,OAAO;IACP,UAAU;IACV,SAAS;IACT,WAAW;CACX,CAAC,MAAM,CACP,CAAE,SAAS,EAAE,IAAI,EAAG,EAAE,CAAC,CAAE;IACxB,GAAG,SAAS;IACZ,CAAE,cAAc,IAAI,EAAE,CAAE,EAAE,cAAc,aAAa,CAAE,IAAI,CAAE,EAAE;CAC/D,CAAE,EACH;IACC,MAAM,EAAE,QAAQ;IAChB,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,UAAU;IACvB;;;;;OAKG;IACH,uBAAuB,EAAE,qBAAqB;IAC9C,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;CACpB,CACD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/helpers/wp-externals.ts
CHANGED
|
@@ -75,11 +75,16 @@ const wpExports: { [ name: string ]: string } = [
|
|
|
75
75
|
wp: 'wp',
|
|
76
76
|
react: 'React',
|
|
77
77
|
'react-dom': 'ReactDOM',
|
|
78
|
+
/**
|
|
79
|
+
* To allow React Fast Refresh (HMR) to work in WP 6.0+ we must
|
|
80
|
+
* externalize fast refresh or dequeue `wp-react-refresh-runtime`.
|
|
81
|
+
*
|
|
82
|
+
* @see \wp_register_development_scripts
|
|
83
|
+
*/
|
|
78
84
|
'react-refresh/runtime': 'ReactRefreshRuntime',
|
|
79
85
|
jquery: 'jQuery',
|
|
80
86
|
tinymce: 'tinymce',
|
|
81
87
|
moment: 'moment',
|
|
82
|
-
'react/jsx-runtime': 'ReactJSXRuntime',
|
|
83
88
|
backbone: 'Backbone',
|
|
84
89
|
},
|
|
85
90
|
);
|
package/package.json
CHANGED
package/lib/package.json
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@lipemat/js-boilerplate",
|
|
3
|
-
"version": "11.0.0-alpha.0",
|
|
4
|
-
"description": "Dependencies and scripts for a no config JavaScript app",
|
|
5
|
-
"author": "Mat Lipe",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"jsPath": "./",
|
|
8
|
-
"type": "module",
|
|
9
|
-
"engines": {
|
|
10
|
-
"node": ">=22.21.1"
|
|
11
|
-
},
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/lipemat/js-boilerplate/issues"
|
|
14
|
-
},
|
|
15
|
-
"homepage": "https://github.com/lipemat/js-boilerplate#readme",
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/lipemat/js-boilerplate.git"
|
|
19
|
-
},
|
|
20
|
-
"sideEffects": false,
|
|
21
|
-
"keywords": [
|
|
22
|
-
"boilerplate",
|
|
23
|
-
"ES6",
|
|
24
|
-
"no-config"
|
|
25
|
-
],
|
|
26
|
-
"files": [
|
|
27
|
-
"tsconfig.json",
|
|
28
|
-
"bin/",
|
|
29
|
-
"config/",
|
|
30
|
-
"helpers/",
|
|
31
|
-
"lib/",
|
|
32
|
-
"scripts/",
|
|
33
|
-
"types/"
|
|
34
|
-
],
|
|
35
|
-
"bin": {
|
|
36
|
-
"lipemat-js-boilerplate": "bin/lipemat-js-boilerplate.js"
|
|
37
|
-
},
|
|
38
|
-
"scripts": {
|
|
39
|
-
"browserslist": "lipemat-js-boilerplate browserslist",
|
|
40
|
-
"build": "tsc --project ./bin",
|
|
41
|
-
"prepublishOnly": "yarn run build",
|
|
42
|
-
"test": "NODE_OPTIONS=--experimental-vm-modules jest --config=jest/jest.config.ts",
|
|
43
|
-
"validate-ts": "tsc --noEmit",
|
|
44
|
-
"watch": "tsc --project ./bin --watch"
|
|
45
|
-
},
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"@babel/core": "^7.24.7",
|
|
48
|
-
"@babel/preset-env": "^7.24.7",
|
|
49
|
-
"@babel/preset-react": "^7.24.7",
|
|
50
|
-
"@babel/preset-typescript": "^7.24.7",
|
|
51
|
-
"@csstools/postcss-global-data": "2.0.0",
|
|
52
|
-
"@lipemat/js-boilerplate-shared": "link:../js-boilerplate-shared",
|
|
53
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.1",
|
|
54
|
-
"@statoscope/webpack-plugin": "^5.29.0",
|
|
55
|
-
"@types/babel__preset-env": "^7.9.6",
|
|
56
|
-
"@types/clean-css": "^4.2.11",
|
|
57
|
-
"@types/postcss-load-config": "^3.0.1",
|
|
58
|
-
"@types/postcss-preset-env": "^7.7.0",
|
|
59
|
-
"@wordpress/browserslist-config": "^6.19.0",
|
|
60
|
-
"babel-jest": "^30.2.0",
|
|
61
|
-
"babel-loader": "^10.0.0",
|
|
62
|
-
"browserslist": "^4.28.1",
|
|
63
|
-
"chalk": "^4.0",
|
|
64
|
-
"clean-css": "^5.3.3",
|
|
65
|
-
"clean-webpack-plugin": "^4.0.0",
|
|
66
|
-
"compression-webpack-plugin": "^10.0.0",
|
|
67
|
-
"core-js": "^3.33.1",
|
|
68
|
-
"cross-spawn": "^7.0.6",
|
|
69
|
-
"css-loader": "6.7.1",
|
|
70
|
-
"fork-ts-checker-webpack-plugin": "^7.2.13",
|
|
71
|
-
"html-webpack-plugin": "^5.5.0",
|
|
72
|
-
"identity-obj-proxy": "^3.0.0",
|
|
73
|
-
"jest-environment-jsdom": "^30.2.0",
|
|
74
|
-
"mini-css-extract-plugin": "^2.9.2",
|
|
75
|
-
"minimist": "^1.2.8",
|
|
76
|
-
"postcss": "^8.4.47",
|
|
77
|
-
"postcss-color-mod-function": "^4.1.1",
|
|
78
|
-
"postcss-custom-media": "^8.0.1",
|
|
79
|
-
"postcss-import": "^15.1.0",
|
|
80
|
-
"postcss-loader": "^8.1.1",
|
|
81
|
-
"postcss-nested": "^5.0.6",
|
|
82
|
-
"postcss-preset-env": "^7.8.3",
|
|
83
|
-
"postcss-scss": "^4.0.4",
|
|
84
|
-
"postcss-sort-media-queries": "^5.2.0",
|
|
85
|
-
"react-refresh": "^0.17.0",
|
|
86
|
-
"style-loader": "^3.3.1",
|
|
87
|
-
"ts-node": "^10.9.1",
|
|
88
|
-
"typescript": "^5.9.3",
|
|
89
|
-
"webpack": "^5.101.0",
|
|
90
|
-
"webpack-assets-manifest": "^6.2.1",
|
|
91
|
-
"webpack-cli": "^6.0.1",
|
|
92
|
-
"webpack-dev-server": "^5.2.2",
|
|
93
|
-
"webpack-subresource-integrity": "^5.1.0"
|
|
94
|
-
},
|
|
95
|
-
"devDependencies": {
|
|
96
|
-
"@jest/globals": "^30.2.0",
|
|
97
|
-
"@lipemat/eslint-config": "^5.1.4",
|
|
98
|
-
"@types/jest": "^29.5.3",
|
|
99
|
-
"@types/minimist": "^1",
|
|
100
|
-
"@types/node": "^22.19.3",
|
|
101
|
-
"@types/react": "^18.2.64",
|
|
102
|
-
"chokidar": "^3.5.3",
|
|
103
|
-
"eslint": "^9",
|
|
104
|
-
"glob": "^11.1.0",
|
|
105
|
-
"jest": "^30.2.0",
|
|
106
|
-
"memfs": "^3.5.3",
|
|
107
|
-
"react": "^18.2.0",
|
|
108
|
-
"setimmediate": "^1.0.5"
|
|
109
|
-
},
|
|
110
|
-
"resolutions": {
|
|
111
|
-
"type-fest": "^4.41.0"
|
|
112
|
-
},
|
|
113
|
-
"packageManager": "yarn@4.12.0"
|
|
114
|
-
}
|