Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches: master
workflow_dispatch:
workflow_call:

jobs:
js-and-style:
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish to npm

on:
release:
types: [published]
workflow_dispatch:

jobs:
publish:
name: Publish @wpsyntex/polylang-build-scripts

runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- name: Check out the source code
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || github.ref }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: npm ci

- name: Set bleeding edge version
if: github.event_name == 'workflow_dispatch'
# Derive a unique prerelease from package.json + commit SHA so manual
# publishes never overwrite `latest` and do not require a git version bump.
run: |
BASE_VERSION=$( node -p "require('./package.json').version" )
DEV_VERSION="${BASE_VERSION}-dev.$( git rev-parse --short HEAD )"
npm version "${DEV_VERSION}" --no-git-tag-version
echo "Publishing bleeding edge version: ${DEV_VERSION}"

- name: Publish stable release to npm
if: github.event_name == 'release'
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish bleeding edge to npm
if: github.event_name == 'workflow_dispatch'
run: npm publish --provenance --access public --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches: master
workflow_dispatch:
workflow_call:

jobs:
testing:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches: master
workflow_dispatch:
workflow_call:

jobs:
test:
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ Webpack configuration helpers for building Polylang projects. Provides two main
npm install @wpsyntex/polylang-build-scripts
```

Install the peer dependencies in the consumer project (versions below are the minimum supported):

```bash
npm install -D clean-webpack-plugin copy-webpack-plugin css-loader css-minimizer-webpack-plugin glob mini-css-extract-plugin terser-webpack-plugin webpack webpack-cli
```

Add `sass` and `sass-loader` when using `getReactifiedConfig` with `sassLoadPaths`.

## getVanillaConfig

Generates webpack configurations for vanilla JS and CSS files. Creates both minified and unminified versions.
Expand Down
Loading
Loading