@storepress/create-plugin-html 0.0.2 → 0.0.3
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 +6 -14
- package/package.json +1 -1
- package/plugin-templates/.github/workflows/deploy-github-pages.yaml.mustache +11 -11
- package/plugin-templates/.github/workflows/release.yaml.mustache +17 -16
- package/plugin-templates/.npmrc.mustache +1 -1
- package/plugin-templates/lint-staged.config.js.mustache +6 -0
package/index.js
CHANGED
|
@@ -84,6 +84,7 @@ module.exports = {
|
|
|
84
84
|
'eslint-plugin-you-dont-need-lodash-underscore',
|
|
85
85
|
'husky',
|
|
86
86
|
'lint-staged',
|
|
87
|
+
"prettier@npm:wp-prettier@latest",
|
|
87
88
|
'fs-extra',
|
|
88
89
|
'webpack-remove-empty-scripts',
|
|
89
90
|
'eslint-plugin-prettier',
|
|
@@ -96,20 +97,6 @@ module.exports = {
|
|
|
96
97
|
'sideEffects': [
|
|
97
98
|
'src/**',
|
|
98
99
|
],
|
|
99
|
-
'lint-staged': {
|
|
100
|
-
'./src/**/*.scss': [
|
|
101
|
-
'npm run lint:css',
|
|
102
|
-
],
|
|
103
|
-
'./src/**/*.{js,ts,tsx}': [
|
|
104
|
-
'npm run lint:js',
|
|
105
|
-
],
|
|
106
|
-
'./*.md': [
|
|
107
|
-
'npm run lint:md:docs',
|
|
108
|
-
],
|
|
109
|
-
'./package.json': [
|
|
110
|
-
'npm run lint:pkg-json',
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
100
|
'main': 'build/index.js',
|
|
114
101
|
'module': 'src/index.js',
|
|
115
102
|
'files': [
|
|
@@ -138,6 +125,11 @@ module.exports = {
|
|
|
138
125
|
constantSlug: constantSlug,
|
|
139
126
|
kebabSlug: kebabSlug,
|
|
140
127
|
pascaleSlug: pascaleSlug,
|
|
128
|
+
GITHUB_REPOSITORY_NAME: '${{ github.event.repository.name }}',
|
|
129
|
+
GITHUB_RELEASE_NAME: '${{ env.RELEASE_NAME }}',
|
|
130
|
+
GITHUB_RELEASE_TAG: '${{ env.RELEASE_TAG }}',
|
|
131
|
+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}',
|
|
132
|
+
GITHUB_PAGE_URL: '${{ steps.deployment.outputs.page_url }}',
|
|
141
133
|
}
|
|
142
134
|
},
|
|
143
135
|
},
|
package/package.json
CHANGED
|
@@ -26,27 +26,27 @@ jobs:
|
|
|
26
26
|
deploy:
|
|
27
27
|
environment:
|
|
28
28
|
name: github-pages
|
|
29
|
-
url:
|
|
29
|
+
url: {{ GITHUB_PAGE_URL }}
|
|
30
30
|
runs-on: ubuntu-latest
|
|
31
31
|
steps:
|
|
32
|
-
- name: Checkout
|
|
32
|
+
- name: "Checkout"
|
|
33
33
|
uses: actions/checkout@v4
|
|
34
|
-
|
|
35
|
-
- name: Setup Node
|
|
34
|
+
|
|
35
|
+
- name: "Setup Node"
|
|
36
36
|
uses: actions/setup-node@v4
|
|
37
37
|
with:
|
|
38
|
-
node-version:
|
|
39
|
-
|
|
38
|
+
node-version: '20.x'
|
|
39
|
+
|
|
40
|
+
- name: "Install and Build"
|
|
40
41
|
run: |
|
|
41
42
|
npm install
|
|
42
43
|
npm run build
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- name: Upload
|
|
44
|
+
rm -rf node_modules
|
|
45
|
+
|
|
46
|
+
- name: "Upload Page Contents"
|
|
46
47
|
uses: actions/upload-pages-artifact@v3
|
|
47
48
|
with:
|
|
48
|
-
# Upload entire repository
|
|
49
49
|
path: '.'
|
|
50
|
-
- name: Deploy to GitHub Pages
|
|
50
|
+
- name: "Deploy to GitHub Pages"
|
|
51
51
|
id: deployment
|
|
52
52
|
uses: actions/deploy-pages@v4
|
|
@@ -10,23 +10,22 @@ on:
|
|
|
10
10
|
permissions: write-all
|
|
11
11
|
|
|
12
12
|
env:
|
|
13
|
-
REPOSITORY_NAME:
|
|
13
|
+
REPOSITORY_NAME: {{ GITHUB_REPOSITORY_NAME }}
|
|
14
14
|
|
|
15
15
|
name: Release
|
|
16
16
|
|
|
17
17
|
jobs:
|
|
18
18
|
|
|
19
|
-
|
|
20
19
|
# Build distribution release.
|
|
21
20
|
#
|
|
22
21
|
# Performs the following steps:
|
|
23
|
-
# - Checks out the repository
|
|
24
|
-
# -
|
|
25
|
-
# - Install
|
|
26
|
-
# -
|
|
27
|
-
# -
|
|
28
|
-
# -
|
|
29
|
-
|
|
22
|
+
# - Checks out the repository
|
|
23
|
+
# - Setup and Install Node.js
|
|
24
|
+
# - NPM Install
|
|
25
|
+
# - Make Zip
|
|
26
|
+
# - Get Release Version
|
|
27
|
+
# - Get Release Filename
|
|
28
|
+
# - Make Release
|
|
30
29
|
|
|
31
30
|
build:
|
|
32
31
|
name: Release
|
|
@@ -39,24 +38,26 @@ jobs:
|
|
|
39
38
|
uses: actions/setup-node@v4
|
|
40
39
|
with:
|
|
41
40
|
node-version: '20.x'
|
|
42
|
-
|
|
41
|
+
|
|
42
|
+
- name: "NPM Install"
|
|
43
|
+
run: npm install
|
|
43
44
|
|
|
44
45
|
- name: "Make Zip"
|
|
45
46
|
run: npm run plugin-zip --if-present
|
|
46
47
|
|
|
47
|
-
- name: "Get
|
|
48
|
+
- name: "Get Release Version"
|
|
48
49
|
run: |
|
|
49
50
|
echo "RELEASE_TAG=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV
|
|
50
51
|
|
|
51
|
-
- name: "Get
|
|
52
|
+
- name: "Get Release Filename"
|
|
52
53
|
run: |
|
|
53
54
|
echo "RELEASE_NAME=$(node -p -e "require('./package.json').name")" >> $GITHUB_ENV
|
|
54
55
|
|
|
55
|
-
- name: "
|
|
56
|
+
- name: "Make Release"
|
|
56
57
|
uses: softprops/action-gh-release@v2
|
|
57
58
|
with:
|
|
58
|
-
files:
|
|
59
|
+
files: ./{{ GITHUB_RELEASE_NAME }}.zip
|
|
59
60
|
make_latest: true
|
|
60
|
-
name: Release - v
|
|
61
|
+
name: Release - v{{ GITHUB_RELEASE_TAG }}
|
|
61
62
|
env:
|
|
62
|
-
GITHUB_TOKEN:
|
|
63
|
+
GITHUB_TOKEN: {{ GITHUB_TOKEN }}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
package-lock=false
|