1
1
# Contributing to Code Snippets
2
2
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
4
13
5
14
In order to build a copy of Code Snippets from the files in this repository, you will need to prepare a few tools
6
15
locally, and be comfortable running commands from a terminal or command line interface.
@@ -14,11 +23,18 @@ The following tools will need to be installed.
14
23
Once Node.js and npm are installed, run the following command from inside the plugin directory to install the required
15
24
node packages:
16
25
17
- npm install
26
+ ``` shell
27
+ npm install
28
+ ```
18
29
19
30
Additionally, run the following command to install the required Composer packages and generate autoload files:
20
31
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.
22
38
23
39
## Building the plugin
24
40
@@ -29,7 +45,9 @@ plugin can be loaded into WordPress.
29
45
30
46
In order to get things built from the source files, the following command can be used:
31
47
32
- npm run build
48
+ ``` shell
49
+ npm run build
50
+ ```
33
51
34
52
This will run the basic Webpack configuration, which will:
35
53
@@ -47,7 +65,9 @@ than running the entire build script, there is an alternative command available
47
65
for changes and run only the necessary tasks when changes are detected. This can be begun by running the following
48
66
command:
49
67
50
- npm run watch
68
+ ``` shell
69
+ npm run watch
70
+ ```
51
71
52
72
## Preparing for release
53
73
@@ -58,7 +78,9 @@ In order to simplify things and reduce the file size of the distributed plugin p
58
78
generating these distribution files separately from the plugin source. Running the following command will commence this
59
79
process:
60
80
61
- npm run bundle
81
+ ``` shell
82
+ npm run bundle
83
+ ```
62
84
63
85
This command will regenerate all processed files and copy those to be distributed to the ` bundle/ ` directory, where they
64
86
can be copied directly into a Subversion repository or similar for distribution.
0 commit comments