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

Add NPM workspaces, build using out of the box wp-scripts #506

Merged
merged 22 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
64e5972
Add npm workspaces, lint globally, build locally
stian-overasen Jun 24, 2024
4bda1d9
Run script only if present
stian-overasen Jun 24, 2024
a9d4d97
Move postcss back out to global setup
stian-overasen Jun 25, 2024
ebec7d3
Add extensions
stian-overasen Jun 25, 2024
4baf558
Add back missing postcss packages
stian-overasen Jun 25, 2024
c9b9d34
Merge old and new postcss config
stian-overasen Jun 25, 2024
059e62a
stylelint-order can be added separately later
stian-overasen Jun 25, 2024
1ea5ee0
Add back unused theme-json packages
stian-overasen Jun 25, 2024
bbb2b3a
Move unused theme-json setup into theme
stian-overasen Jun 25, 2024
3625935
Disable theme-json generation. No src files in theme
stian-overasen Jun 25, 2024
49ebcf5
No need for default config
stian-overasen Jun 25, 2024
04c9589
Rename dev script back to start
stian-overasen Jun 25, 2024
5436444
Remove entryFiles discovery from global webpack config
stian-overasen Jun 25, 2024
8529d3d
install comment is depreacted in huskey 9+
stian-overasen Jun 25, 2024
b50bd9d
Remove outdated postcss-flexbugs-fixes plugin, no more need for this
stian-overasen Jun 25, 2024
f00e2e0
No Turbo cache folder, yet
stian-overasen Jun 25, 2024
981bf24
Update installation readme
stian-overasen Jun 25, 2024
9114104
Add blueprint plugin
stian-overasen Jun 25, 2024
4918009
Update wp-scripts to v28
stian-overasen Jun 25, 2024
ac74567
Optimize docs (INSTALLATION.md) (#507)
olethomas Jun 25, 2024
666b2eb
More readme on wp-scripts
stian-overasen Jun 25, 2024
7cfc414
tweaks
stian-overasen Jun 25, 2024
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
18 changes: 8 additions & 10 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Project-base uses wp-scripts to build front end assets using the `npm run build`
## Adding a new package (ex. plugin/mu-plugin/theme)
1. Add a folder to the relevant category in `./packages`. (create one if none exists). So for a plugin, create a folder in the `./packages/plugins` folder.

2. If your package should be installed using composer (for themes, plugins, mu-plugins and php deps) Add a composer.json, it needs a minimum of the following data:
2. If your package should be installed using composer (for themes, plugins, mu-plugins and php deps) Add a `composer.json`, it needs a minimum of the following data:
```json
{
"name": "project/package-name",
Expand All @@ -105,7 +105,7 @@ Project-base uses wp-scripts to build front end assets using the `npm run build`

*Note: A version should _always_ be supplied. This ensures that package versions do not change between branches, leading to unneccesary merge conflicts.*

3. If your package should be installed using npm (for frontend deps, like custom react components) Add a package.json, it needs a minimum of the following data:
3. If your package should be installed using npm (for frontend deps, like custom react components) or contains front end assets that you want to build from project root, add a `package.json`, it needs a minimum of the following data:

```json
{
Expand All @@ -116,19 +116,17 @@ Project-base uses wp-scripts to build front end assets using the `npm run build`
"author": "Dekode",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "echo \"Error: no build specified\" && exit 1",
"start":"echo \"Error: no start specified\" && exit 1",
"test": "echo \"Error: no test specified\" && exit 1",
"clean": "rm -rf node_modules build dist"
}
}
```

4. If your package has front end assets such as scripts or css add a `entry-files.json` with the following structure naming the src files that should be build. (the src files should be located in a folder called `src`)
```json
[ "index.js", "style.css", "editor.css" ]
```

5. Go back to the project root and update the composer.json or package.json depending on package type. For composer add a entry under "require" like such `"project/package-name": "@dev"`. For package.json add an entry under "devDependencies" like such `"package-name": "file:packages/folder/package-name"`.
4. Go back to the project root and update the composer.json or package.json depending on package type. For composer add a entry under "require" like such `"project/package-name": "@dev"`. For package.json add an entry under "devDependencies" like such `"package-name": "file:packages/folder/package-name"`.

6. Install the package using `composer update` or `npm install` depending on type. you might need to re-run `npm run build` or `npm run start` if you have installed a new package containing files that need building.
5. Install the package using `composer update` or `npm install` depending on type. you might need to re-run `npm run build` or `npm run start` if you have installed a new package containing files that need building.

## Documentation
* PostCSS [https://github.com/postcss/postcss/tree/main/docs](https://github.com/postcss/postcss/tree/main/docs)
Expand Down
Loading
Loading