11# Contributing to Code Snippets
22
3- ## Setting things up
3+ ## Project structure
4+
5+ The base plugin folder is not the root of repository – instead, files to be loaded into WordPress as a plugin are
6+ located in ` src/ ` . You should copy or symlink this folder into your WordPress ` wp-content/plugins ` folder as
7+ ` code-snippets ` .
8+
9+ Keep in mind that you will need to follow the steps below to populate files under ` src/dist/ ` and` src/vendor/ ` , which
10+ are required for the plugin to function correctly.
11+
12+ ## Required software
413
514In order to build a copy of Code Snippets from the files in this repository, you will need to prepare a few tools
615locally, and be comfortable running commands from a terminal or command line interface.
@@ -14,11 +23,18 @@ The following tools will need to be installed.
1423Once Node.js and npm are installed, run the following command from inside the plugin directory to install the required
1524node packages:
1625
17- npm install
26+ ``` shell
27+ npm install
28+ ```
1829
1930Additionally, run the following command to install the required Composer packages and generate autoload files:
2031
21- composer install
32+ ``` shell
33+ npm run bundle
34+ ```
35+
36+ If you want to interface with Composer directly, you will need to run commands under the ` src/ ` directory, as that is
37+ where ` composer.json ` , ` composer.lock ` , and the ` vendor/ ` directory are located.
2238
2339## Building the plugin
2440
@@ -29,7 +45,9 @@ plugin can be loaded into WordPress.
2945
3046In order to get things built from the source files, the following command can be used:
3147
32- npm run build
48+ ``` shell
49+ npm run build
50+ ```
3351
3452This will run the basic Webpack configuration, which will:
3553
@@ -47,7 +65,9 @@ than running the entire build script, there is an alternative command available
4765for changes and run only the necessary tasks when changes are detected. This can be begun by running the following
4866command:
4967
50- npm run watch
68+ ``` shell
69+ npm run watch
70+ ```
5171
5272## Preparing for release
5373
@@ -58,7 +78,9 @@ In order to simplify things and reduce the file size of the distributed plugin p
5878generating these distribution files separately from the plugin source. Running the following command will commence this
5979process:
6080
61- npm run bundle
81+ ``` shell
82+ npm run bundle
83+ ```
6284
6385This command will regenerate all processed files and copy those to be distributed to the ` bundle/ ` directory, where they
6486can be copied directly into a Subversion repository or similar for distribution.
0 commit comments