Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use npm as default package manager #152

Merged
merged 15 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
type: string
PACKAGE_MANAGER:
description: Package manager with which the dependencies should be installed (`npm` or `yarn`).
default: 'yarn'
default: 'npm'
required: false
type: string
WORKING_DIRECTORY:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-assets-compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
type: string
PACKAGE_MANAGER:
description: Package manager with which the dependencies should be installed (`npm` or `yarn`).
default: 'yarn'
default: 'npm'
required: false
type: string
PHP_VERSION:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-plugin-archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
type: string
PACKAGE_MANAGER:
description: Package manager with which the dependencies should be installed (`npm` or `yarn`).
default: 'yarn'
default: 'npm'
required: false
type: string
COMPOSER_ARGS:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ddev-playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ on:
required: false
type: string
PLAYWRIGHT_INSTALL_CMD:
description: The command for installing Playwright and its dependencies, such as `yarn install && yarn playwright install --with-deps` or `ddev pw-install-host` from inpsyde/ddev-wordpress-plugin-template.
description: The command for installing Playwright and its dependencies, such as `npm install && npx playwright install --with-deps` or `ddev pw-install-host` from inpsyde/ddev-wordpress-plugin-template.
required: true
type: string
PLAYWRIGHT_RUN_CMD:
description: The command for running Playwright tests, such as `yarn playwright test` or `ddev pw-host test` from inpsyde/ddev-wordpress-plugin-template.
description: The command for running Playwright tests, such as `npx playwright test` or `ddev pw-host test` from inpsyde/ddev-wordpress-plugin-template.
required: true
type: string
PLAYWRIGHT_DIR:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-unit-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
type: string
PACKAGE_MANAGER:
description: Package manager with which the dependencies should be installed (`npm` or `yarn`).
default: 'yarn'
default: 'npm'
required: false
type: string
NODE_OPTIONS:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wp-scripts-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
type: string
PACKAGE_MANAGER:
description: Package manager with which the dependencies should be installed (`npm` or `yarn`).
default: 'yarn'
default: 'npm'
required: false
type: string
LINT_TOOLS:
Expand Down
28 changes: 14 additions & 14 deletions docs/archive-creation.md
tyrann0us marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@ jobs:

### Inputs

| Name | Default | Description |
|-----------------------|---------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `NODE_OPTIONS` | `''` | Space-separated list of command-line Node options |
| `NODE_VERSION` | `18` | Node version with which the assets will be compiled |
| `NPM_REGISTRY_DOMAIN` | `"https://npm.pkg.github.com/"` | Domain of the private npm registry |
| `PACKAGE_MANAGER` | `"yarn"` | Package manager with which the dependencies should be installed (`npm` or `yarn`) |
| Name | Default | Description |
|-----------------------|--------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `NODE_OPTIONS` | `''` | Space-separated list of command-line Node options |
| `NODE_VERSION` | `18` | Node version with which the assets will be compiled |
| `NPM_REGISTRY_DOMAIN` | `"https://npm.pkg.github.com/"` | Domain of the private npm registry |
| `PACKAGE_MANAGER` | `"npm"` | Package manager with which the dependencies should be installed (`npm` or `yarn`) |
| `COMPOSER_ARGS` | `'--no-dev --no-scripts --prefer-dist --optimize-autoloader'` | Set of arguments passed to Composer when gathering production dependencies |
| `PHP_VERSION` | `"8.0"` | PHP version to use when gathering production dependencies |
| `PHP_VERSION_BUILD` | `"8.0"` | PHP version to use when executing build tools |
| `ARCHIVE_NAME` | `""` | The name of the zip archive (falls back to the repository name) |
| `PLUGIN_MAIN_FILE` | `"index.php"` | The name of the main plugin file |
| `PLUGIN_FOLDER_NAME` | `""` | The name of the plugin folder (falls back to the archive name, if set, or the repository name) |
| `PLUGIN_VERSION` | - | The new plugin version |
| `PRE_SCRIPT` | `""` | Run custom shell code before creating the release archive |
| `COMPILE_ASSETS_ARGS` | `'-v --env=root'` | Set of arguments passed to Composer Asset Compiler |
| `PHP_VERSION` | `"8.0"` | PHP version to use when gathering production dependencies |
| `PHP_VERSION_BUILD` | `"8.0"` | PHP version to use when executing build tools |
| `ARCHIVE_NAME` | `""` | The name of the zip archive (falls back to the repository name) |
| `PLUGIN_MAIN_FILE` | `"index.php"` | The name of the main plugin file |
| `PLUGIN_FOLDER_NAME` | `""` | The name of the plugin folder (falls back to the archive name, if set, or the repository name) |
| `PLUGIN_VERSION` | - | The new plugin version |
| `PRE_SCRIPT` | `""` | Run custom shell code before creating the release archive |
| `COMPILE_ASSETS_ARGS` | `'-v --env=root'` | Set of arguments passed to Composer Asset Compiler |

#### A note on `PLUGIN_VERSION`

Expand Down
2 changes: 1 addition & 1 deletion docs/assets-compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
| `NODE_OPTIONS` | `''` | Space-separated list of command-line Node options |
| `NODE_VERSION` | `18` | Node version with which the assets will be compiled |
| `NPM_REGISTRY_DOMAIN` | `https://npm.pkg.github.com/` | Domain of the private npm registry |
| `PACKAGE_MANAGER` | `yarn` | Package manager with which the dependencies should be installed (`npm` or `yarn`) |
| `PACKAGE_MANAGER` | `npm` | Package manager with which the dependencies should be installed (`npm` or `yarn`) |
| `PHP_VERSION` | `"8.0"` | PHP version with which the assets compilation is to be executed |
| `COMPOSER_ARGS` | `'--prefer-dist'` | Set of arguments passed to Composer |
| `COMPILE_ASSETS_ARGS` | `'-v --env=root'` | Set of arguments passed to Composer Asset Compiler |
Expand Down
6 changes: 3 additions & 3 deletions docs/build-and-push-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ on:
- '**.scss'
- '**.js'
- '**package.json'
- '**package-lock.json'
- '**tsconfig.json'
- '**yarn.lock'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -99,7 +99,7 @@ This is not the simplest possible example, but it showcases all the recommendati
| `NODE_OPTIONS` | `''` | Space-separated list of command-line Node options |
| `NODE_VERSION` | `18` | Node version with which the assets will be compiled |
| `NPM_REGISTRY_DOMAIN` | `https://npm.pkg.github.com/` | Domain of the private npm registry |
| `PACKAGE_MANAGER` | `yarn` | Package manager with which the dependencies should be installed (`npm` or `yarn`) |
| `PACKAGE_MANAGER` | `npm` | Package manager with which the dependencies should be installed (`npm` or `yarn`) |
| `WORKING_DIRECTORY` | `'./'` | Working directory path |
| `COMPILE_SCRIPT_PROD` | `'build'` | Script added to `npm run` or `yarn` to build production assets |
| `COMPILE_SCRIPT_DEV` | `'build:dev'` | Script added to `npm run` or `yarn` to build development assets |
Expand Down Expand Up @@ -139,8 +139,8 @@ on:
- '**.scss'
- '**.js'
- '**package.json'
- '**package-lock.json'
- '**tsconfig.json'
- '**yarn.lock'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
24 changes: 12 additions & 12 deletions docs/ddev-playwright.md
tyrann0us marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ This reusable workflow:
3. If the Ngrok auth token is provided, it sets up Ngrok. Ngrok can be needed if some third-party service, e.g., webhooks, must access the website.
1. Launches Ngrok, using `vendor/bin/ddev-share` from [inpsyde/ddev-tools](https://github.com/inpsyde/ddev-tools) by default.
2. Saves the URL to the specified env variable, `BASEURL` by default.
4. Installs Playwright and its dependencies via the provided command, such as `yarn install && yarn playwright install --with-deps` or `ddev pw-install-host` from [inpsyde/ddev-wordpress-plugin-template](https://github.com/inpsyde/ddev-wordpress-plugin-template).
5. Runs Playwright tests via the provided command, such as `yarn playwright test` or `ddev pw-host test` from [inpsyde/ddev-wordpress-plugin-template](https://github.com/inpsyde/ddev-wordpress-plugin-template).
4. Installs Playwright and its dependencies via the provided command, such as `npm install && npx playwright install --with-deps` or `ddev pw-install-host` from [inpsyde/ddev-wordpress-plugin-template](https://github.com/inpsyde/ddev-wordpress-plugin-template).
5. Runs Playwright tests via the provided command, such as `npx playwright test` or `ddev pw-host test` from [inpsyde/ddev-wordpress-plugin-template](https://github.com/inpsyde/ddev-wordpress-plugin-template).

It is possible to add any env variables for the "host" and for DDEV.

Expand Down Expand Up @@ -54,16 +54,16 @@ jobs:

### Inputs

| Name | Default | Description |
|--------------------------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `PHP_VERSION` | `""` | PHP version which will override the version set in the DDEV config |
| `NODE_VERSION` | `""` | Node version which will override the version set in the DDEV config |
| `DDEV_ORCHESTRATE_CMD` | `""` | The command for setting up the DDEV website, such as `ddev orchestrate` from [inpsyde/ddev-wordpress-plugin-template](https://github.com/inpsyde/ddev-wordpress-plugin-template) |
| `PLAYWRIGHT_INSTALL_CMD` | `""` | The command for installing Playwright and its deps, such as `yarn install && yarn playwright install --with-deps` or `ddev pw-install-host` from [inpsyde/ddev-wordpress-plugin-template](https://github.com/inpsyde/ddev-wordpress-plugin-template) |
| `PLAYWRIGHT_RUN_CMD` | `""` | The command for running Playwright tests, such as `yarn playwright test` or `ddev pw-host test` from [inpsyde/ddev-wordpress-plugin-template](https://github.com/inpsyde/ddev-wordpress-plugin-template) |
| `PLAYWRIGHT_DIR` | `"tests/Playwright"` | The path to the Playwright project |
| `NGROK_START_CMD` | `"vendor/bin/ddev-share"` | The command for starting Ngrok, such as `ddev-share` from [inpsyde/ddev-tools](https://github.com/inpsyde/ddev-tools) |
| `BASEURL_ENV_NAME` | `"BASEURL"` | The name of the env variable with the base URL for Playwright, used for overwriting it with the URL from Ngrok |
| Name | Default | Description |
|--------------------------|---------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `PHP_VERSION` | `""` | PHP version which will override the version set in the DDEV config |
| `NODE_VERSION` | `""` | Node version which will override the version set in the DDEV config |
| `DDEV_ORCHESTRATE_CMD` | `""` | The command for setting up the DDEV website, such as `ddev orchestrate` from [inpsyde/ddev-wordpress-plugin-template](https://github.com/inpsyde/ddev-wordpress-plugin-template) |
| `PLAYWRIGHT_INSTALL_CMD` | `""` | The command for installing Playwright and its deps, such as `npm install && npx playwright install --with-deps` or `ddev pw-install-host` from [inpsyde/ddev-wordpress-plugin-template](https://github.com/inpsyde/ddev-wordpress-plugin-template) |
| `PLAYWRIGHT_RUN_CMD` | `""` | The command for running Playwright tests, such as `npx playwright test` or `ddev pw-host test` from [inpsyde/ddev-wordpress-plugin-template](https://github.com/inpsyde/ddev-wordpress-plugin-template) |
| `PLAYWRIGHT_DIR` | `"tests/Playwright"` | The path to the Playwright project |
| `NGROK_START_CMD` | `"vendor/bin/ddev-share"` | The command for starting Ngrok, such as `ddev-share` from [inpsyde/ddev-tools](https://github.com/inpsyde/ddev-tools) |
| `BASEURL_ENV_NAME` | `"BASEURL"` | The name of the env variable with the base URL for Playwright, used for overwriting it with the URL from Ngrok |

## Secrets

Expand Down
2 changes: 1 addition & 1 deletion docs/js.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
| `NPM_REGISTRY_DOMAIN` | `https://npm.pkg.github.com/` | Domain of the private npm registry |
| `NODE_VERSION` | `18` | Node version with which the unit tests are to be executed |
| `JEST_ARGS` | `'--reporters=default --reporters=github-actions'` | Set of arguments passed to Jest |
| `PACKAGE_MANAGER` | `yarn` | Package manager with which the dependencies should be installed (`npm` or `yarn`) |
| `PACKAGE_MANAGER` | `npm` | Package manager with which the dependencies should be installed (`npm` or `yarn`) |

**Note**: The default `github-actions` reporter requires Jest 28 or higher.

Expand Down
Loading