newspack-scripts 1.7.0 → 3.0.0-alpha.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/.github/ISSUE_TEMPLATE/Bug_report.md +21 -0
- package/.github/ISSUE_TEMPLATE/Enhancement.md +17 -0
- package/.github/ISSUE_TEMPLATE/Feature_request.md +17 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +28 -0
- package/.github/dependabot.yml +27 -0
- package/.github/workflows/auto-merge.yml +18 -0
- package/.github/workflows/main.yml +15 -0
- package/README.md +1 -1
- package/bin/newspack-scripts.js +1 -1
- package/package.json +1 -1
- package/post-release.sh +24 -13
- package/scripts/release.js +7 -0
- /package/scripts/{start.js → watch.js} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "\U0001F41E Bug report"
|
|
3
|
+
about: Report a bug if something isn't working as expected.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Describe the bug**
|
|
8
|
+
A clear and concise description of what the bug is. Please be as descriptive as possible; issues lacking detail, or for any other reason than to report a bug, may be closed without action.
|
|
9
|
+
|
|
10
|
+
**To Reproduce**
|
|
11
|
+
Steps to reproduce the behavior:
|
|
12
|
+
1. Go to '...'
|
|
13
|
+
2. Click on '....'
|
|
14
|
+
3. Scroll down to '....'
|
|
15
|
+
4. See error
|
|
16
|
+
|
|
17
|
+
**Screenshots**
|
|
18
|
+
If applicable, add screenshots to help explain your problem.
|
|
19
|
+
|
|
20
|
+
**Expected behavior**
|
|
21
|
+
A clear and concise description of what you expected to happen.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "✨ New Enhancement"
|
|
3
|
+
about: "If you have an idea to improve an existing feature please let us know or submit a Pull Request!"
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Is your feature request related to a problem? Please describe.**
|
|
8
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
9
|
+
|
|
10
|
+
**Describe the solution you'd like**
|
|
11
|
+
A clear and concise description of what you want to happen.
|
|
12
|
+
|
|
13
|
+
**Describe alternatives you've considered**
|
|
14
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
15
|
+
|
|
16
|
+
**Additional context**
|
|
17
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "\U0001F680 Feature request"
|
|
3
|
+
about: "Suggest a new feature \U0001F389 We'll consider building it if it receives sufficient interest! \U0001F44D"
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Is your feature request related to a problem? Please describe.**
|
|
8
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
9
|
+
|
|
10
|
+
**Describe the solution you'd like**
|
|
11
|
+
A clear and concise description of what you want to happen.
|
|
12
|
+
|
|
13
|
+
**Describe alternatives you've considered**
|
|
14
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
15
|
+
|
|
16
|
+
**Additional context**
|
|
17
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
### All Submissions:
|
|
2
|
+
|
|
3
|
+
* [ ] Have you followed the [Newspack Contributing guideline](https://github.com/Automattic/newspack-theme/blob/master/.github/CONTRIBUTING.md)?
|
|
4
|
+
* [ ] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change?
|
|
5
|
+
|
|
6
|
+
<!-- Mark completed items with an [x] -->
|
|
7
|
+
|
|
8
|
+
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
|
|
9
|
+
|
|
10
|
+
### Changes proposed in this Pull Request:
|
|
11
|
+
|
|
12
|
+
<!-- Describe the changes made to this Pull Request, and the reason for such changes. -->
|
|
13
|
+
|
|
14
|
+
Closes # .
|
|
15
|
+
|
|
16
|
+
### How to test the changes in this Pull Request:
|
|
17
|
+
|
|
18
|
+
1.
|
|
19
|
+
2.
|
|
20
|
+
3.
|
|
21
|
+
|
|
22
|
+
### Other information:
|
|
23
|
+
|
|
24
|
+
* [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
|
|
25
|
+
* [ ] Have you written new tests for your changes, as applicable?
|
|
26
|
+
* [ ] Have you successfully ran tests with your changes locally?
|
|
27
|
+
|
|
28
|
+
<!-- Mark completed items with an [x] -->
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Dependabot config.
|
|
2
|
+
# Keep NPM and Composer packages up-to-date.
|
|
3
|
+
# Let's start out with weekly updates and then drop back to less frequent intervals after everything is up-to-date.
|
|
4
|
+
|
|
5
|
+
version: 2
|
|
6
|
+
updates:
|
|
7
|
+
# Enable version updates for npm
|
|
8
|
+
- package-ecosystem: 'npm'
|
|
9
|
+
# Look for `package.json` and `lock` files in the `root` directory
|
|
10
|
+
directory: '/'
|
|
11
|
+
# Check the npm registry for updates every day (weekdays)
|
|
12
|
+
schedule:
|
|
13
|
+
interval: 'weekly'
|
|
14
|
+
# Add reviewers
|
|
15
|
+
reviewers:
|
|
16
|
+
- 'Automattic/newspack-product'
|
|
17
|
+
|
|
18
|
+
# Enable version updates for Composer
|
|
19
|
+
- package-ecosystem: 'composer'
|
|
20
|
+
# Look for a `composer.lock` in the `root` directory
|
|
21
|
+
directory: '/'
|
|
22
|
+
# Check for updates every day (weekdays)
|
|
23
|
+
schedule:
|
|
24
|
+
interval: 'weekly'
|
|
25
|
+
# Add reviewers
|
|
26
|
+
reviewers:
|
|
27
|
+
- 'Automattic/newspack-product'
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
on:
|
|
2
|
+
pull_request_target:
|
|
3
|
+
types: [labeled]
|
|
4
|
+
|
|
5
|
+
name: Dependabot auto-merge
|
|
6
|
+
jobs:
|
|
7
|
+
auto-merge:
|
|
8
|
+
name: Auto-merge dependabot PRs for minor and patch updates
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
if: |
|
|
11
|
+
contains( github.event.pull_request.labels.*.name, 'dependencies' )
|
|
12
|
+
&& ! contains( github.event.pull_request.labels.*.name, '[Status] Approved' )
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v2
|
|
15
|
+
- uses: ahmadnassri/action-dependabot-auto-merge@v2
|
|
16
|
+
with:
|
|
17
|
+
target: minor # includes patch updates.
|
|
18
|
+
github-token: ${{ secrets.DEPENDABOT_TOKEN }}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
on: pull_request_review
|
|
2
|
+
name: Label approved pull requests
|
|
3
|
+
jobs:
|
|
4
|
+
labelWhenApproved:
|
|
5
|
+
name: Label when approved
|
|
6
|
+
runs-on: ubuntu-latest
|
|
7
|
+
steps:
|
|
8
|
+
- name: Label when approved
|
|
9
|
+
uses: pullreminders/label-when-approved-action@master
|
|
10
|
+
env:
|
|
11
|
+
APPROVALS: '1'
|
|
12
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
13
|
+
ADD_LABEL: '[Status] Approved'
|
|
14
|
+
# Needs to be URL-encoded, see https://github.com/abinoda/label-when-approved-action/pull/3#discussion_r321882620
|
|
15
|
+
REMOVE_LABEL: '%5BStatus%5D%20Needs%20Review'
|
package/README.md
CHANGED
package/bin/newspack-scripts.js
CHANGED
|
@@ -5,7 +5,7 @@ const spawn = require("cross-spawn");
|
|
|
5
5
|
const [scriptName, ...nodeArgs] = process.argv.slice(2);
|
|
6
6
|
|
|
7
7
|
if (
|
|
8
|
-
["test", "build", "
|
|
8
|
+
["test", "build", "watch", "commit", "commitlint", "release"].includes(
|
|
9
9
|
scriptName
|
|
10
10
|
)
|
|
11
11
|
) {
|
package/package.json
CHANGED
package/post-release.sh
CHANGED
|
@@ -3,19 +3,30 @@
|
|
|
3
3
|
git config user.name "$GIT_COMMITTER_NAME"
|
|
4
4
|
git config user.email "$GITHUB_COMMITER_EMAIL"
|
|
5
5
|
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
git pull origin release
|
|
10
|
-
git checkout alpha
|
|
11
|
-
git reset --hard release --
|
|
12
|
-
git push "https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git" --force
|
|
6
|
+
# The last commit message at this point is the automated release commit. The second-to-last
|
|
7
|
+
# commit message should contain data about the merge.
|
|
8
|
+
SECOND_TO_LAST_COMMIT_MSG=$(git log -n 1 --skip 1 --pretty=format:"%s")
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
#
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
LATEST_VERSION_TAG=$(git describe --tags --abbrev=0)
|
|
11
|
+
|
|
12
|
+
# If the merge was from alpha branch, alpha branch should be reset.
|
|
13
|
+
if [[ $(echo $SECOND_TO_LAST_COMMIT_MSG | grep '^Merge pull request.*alpha') ]]; then
|
|
14
|
+
echo '[newspack-scripts] Release was created from the alpha branch. Alpha branch will now be reset.'
|
|
15
|
+
|
|
16
|
+
# Reset the tip of alpha branch to the release branch.
|
|
17
|
+
# The alpha brach is single-serving, just for alpha releases. After a release,
|
|
18
|
+
# we don't care about any alpha changes.
|
|
19
|
+
git pull origin release
|
|
20
|
+
git checkout alpha
|
|
21
|
+
git reset --hard release --
|
|
22
|
+
# Force-push the alpha branch.
|
|
23
|
+
git push "https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git" --force
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
# Update master branch with latest changes from the release branch, so they are in sync.
|
|
27
|
+
echo '[newspack-scripts] Merging the release branch into master'
|
|
19
28
|
git checkout master
|
|
20
|
-
git
|
|
29
|
+
git merge --squash release
|
|
30
|
+
git commit --message "chore(release): merge in release $LATEST_VERSION_TAG"
|
|
31
|
+
# Push updated master upstream.
|
|
21
32
|
git push "https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git"
|
package/scripts/release.js
CHANGED
|
@@ -19,11 +19,18 @@ const config = {
|
|
|
19
19
|
debug: semanticReleaseArgs.debug,
|
|
20
20
|
|
|
21
21
|
branches: [
|
|
22
|
+
// `release` branch is published on the main distribution channel (a new version on GH).
|
|
22
23
|
"release",
|
|
24
|
+
// `alpha` branch – for regular pre-releases.
|
|
23
25
|
{
|
|
24
26
|
name: "alpha",
|
|
25
27
|
prerelease: "alpha",
|
|
26
28
|
},
|
|
29
|
+
// `hotfix/*` branches – for releases outside of the release schedule.
|
|
30
|
+
{
|
|
31
|
+
name: "hotfix/*",
|
|
32
|
+
prerelease: "hotfix",
|
|
33
|
+
},
|
|
27
34
|
],
|
|
28
35
|
prepare: [
|
|
29
36
|
"@semantic-release/changelog",
|
|
File without changes
|