@pugpigjs/create-wp-project 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +11 -11
- package/package.json +3 -3
- package/src/utils/shared.js +2 -1
- package/src/utils/templating.js +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @pugpigjs/create-wp-project
|
|
2
2
|
|
|
3
|
+
## 0.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4237718: Add docblock for updated php stubs
|
|
8
|
+
|
|
9
|
+
## 0.0.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 05bf830: Adjust default structure and naming conventions
|
|
14
|
+
|
|
3
15
|
## 0.0.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ CLI tool to scaffold WordPress plugins and themes from a template repo.
|
|
|
7
7
|
The easiest way to scaffold a new WordPress project:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm create @pugpigjs/wp-project -- init --git-url <repository-url> --directory <target-directory>
|
|
10
|
+
npm create @pugpigjs/wp-project@latest -- init --git-url <repository-url> --directory <target-directory>
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
**Note:** Both `--git-url` and `--directory` are required for all commands.
|
|
@@ -63,7 +63,7 @@ The CLI automatically computes all these variations from your namespace and proj
|
|
|
63
63
|
### `init` - Initialise a New Project
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
npm create @pugpigjs/wp-project -- init --git-url <repository-url> --directory <target-directory>
|
|
66
|
+
npm create @pugpigjs/wp-project@latest -- init --git-url <repository-url> --directory <target-directory>
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
This interactive CLI will:
|
|
@@ -80,7 +80,7 @@ This interactive CLI will:
|
|
|
80
80
|
If you've already initialised a project and want to add another plugin or theme:
|
|
81
81
|
|
|
82
82
|
```bash
|
|
83
|
-
npm create @pugpigjs/wp-project -- add --git-url <repository-url> --directory <target-directory>
|
|
83
|
+
npm create @pugpigjs/wp-project@latest -- add --git-url <repository-url> --directory <target-directory>
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
This will:
|
|
@@ -96,7 +96,7 @@ This will:
|
|
|
96
96
|
To remove a plugin or theme from your project:
|
|
97
97
|
|
|
98
98
|
```bash
|
|
99
|
-
npm create @pugpigjs/wp-project -- remove --directory <target-directory>
|
|
99
|
+
npm create @pugpigjs/wp-project@latest -- remove --directory <target-directory>
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
This will:
|
|
@@ -112,7 +112,7 @@ This will:
|
|
|
112
112
|
To refresh configuration files (like bitbucket-pipelines.yml, renovate.json, etc.) from the latest template:
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
|
-
npm create @pugpigjs/wp-project -- update --git-url <repository-url> --directory <target-directory>
|
|
115
|
+
npm create @pugpigjs/wp-project@latest -- update --git-url <repository-url> --directory <target-directory>
|
|
116
116
|
```
|
|
117
117
|
|
|
118
118
|
This will:
|
|
@@ -160,7 +160,7 @@ You can set the following environment variable to simplify usage:
|
|
|
160
160
|
```
|
|
161
161
|
- After setting, you can omit the `-g` flag:
|
|
162
162
|
```bash
|
|
163
|
-
npm create @pugpigjs/wp-project -- init -d ./my-project-server
|
|
163
|
+
npm create @pugpigjs/wp-project@latest -- init -d ./my-project-server
|
|
164
164
|
```
|
|
165
165
|
|
|
166
166
|
|
|
@@ -168,19 +168,19 @@ You can set the following environment variable to simplify usage:
|
|
|
168
168
|
|
|
169
169
|
### Initialise from a remote repository
|
|
170
170
|
```bash
|
|
171
|
-
npm create @pugpigjs/wp-project -- init \
|
|
171
|
+
npm create @pugpigjs/wp-project@latest -- init \
|
|
172
172
|
-g https://github.com/your-org/your-wp-template.git \
|
|
173
173
|
-d ./my-project-server
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
### Initialise from a local template (for development)
|
|
177
177
|
```bash
|
|
178
|
-
npm create @pugpigjs/wp-project -- init -g . -d ./test-server
|
|
178
|
+
npm create @pugpigjs/wp-project@latest -- init -g . -d ./test-server
|
|
179
179
|
```
|
|
180
180
|
|
|
181
181
|
### Initialise from a specific branch
|
|
182
182
|
```bash
|
|
183
|
-
npm create @pugpigjs/wp-project -- init \
|
|
183
|
+
npm create @pugpigjs/wp-project@latest -- init \
|
|
184
184
|
-g https://github.com/your-org/your-wp-template.git \
|
|
185
185
|
-d ./my-project-server \
|
|
186
186
|
-b beta
|
|
@@ -188,14 +188,14 @@ npm create @pugpigjs/wp-project -- init \
|
|
|
188
188
|
|
|
189
189
|
### Add another template to existing project
|
|
190
190
|
```bash
|
|
191
|
-
npm create @pugpigjs/wp-project -- add \
|
|
191
|
+
npm create @pugpigjs/wp-project@latest -- add \
|
|
192
192
|
-g https://github.com/your-org/your-wp-template.git \
|
|
193
193
|
-d ./my-project-server
|
|
194
194
|
```
|
|
195
195
|
|
|
196
196
|
### Update configuration files
|
|
197
197
|
```bash
|
|
198
|
-
npm create @pugpigjs/wp-project -- update \
|
|
198
|
+
npm create @pugpigjs/wp-project@latest -- update \
|
|
199
199
|
-g https://github.com/your-org/your-wp-template.git \
|
|
200
200
|
-d ./my-project-server
|
|
201
201
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pugpigjs/create-wp-project",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "CLI tool to scaffold WordPress plugins and themes from a template repo.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"license": "ISC",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"chalk": "^5.0.0",
|
|
23
|
-
"commander": "^
|
|
23
|
+
"commander": "^14.0.0",
|
|
24
24
|
"fs-extra": "^11.0.0",
|
|
25
25
|
"inquirer": "^12.10.0",
|
|
26
|
-
"ora": "^
|
|
26
|
+
"ora": "^9.0.0",
|
|
27
27
|
"simple-git": "^3.0.0"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
package/src/utils/shared.js
CHANGED
|
@@ -104,10 +104,11 @@ export const prompts = {
|
|
|
104
104
|
name: 'description',
|
|
105
105
|
message: 'Enter project description:',
|
|
106
106
|
default: (answers) => {
|
|
107
|
-
return answers.projectName
|
|
107
|
+
return `Custom extensions for ${answers.projectName
|
|
108
108
|
.split('_')
|
|
109
109
|
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
|
|
110
110
|
.join(' ')
|
|
111
|
+
}`
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
114
|
}
|
package/src/utils/templating.js
CHANGED
|
@@ -29,6 +29,7 @@ function toPascalCase(str) {
|
|
|
29
29
|
* - TPL_NAMESPACE_LOWER / tpl_namespace_lower - Lowercase namespace (e.g., "acme")
|
|
30
30
|
* - TPL_PROJECT_NAME / tpl_project_name - Project name in snake_case (e.g., "my_custom_plugin")
|
|
31
31
|
* - TPL_PROJECT_NAME_PASCAL / tpl_project_name_pascal - Project name in PascalCase (e.g., "MyPlugin")
|
|
32
|
+
* - TPL_PROJECT_NAME_TITLE / tpl_project_name_title - Project name in Title Case (e.g., "My Plugin")
|
|
32
33
|
* - TPL_PROJECT_NAME_SLUG / tpl_project_name_slug - Project name in kebab-case (e.g., "my-plugin")
|
|
33
34
|
* - TPL_PROJECT_NAME_FLAT / tpl_project_name_flat - Project name with no separators (e.g., "myplugin")
|
|
34
35
|
* - TPL_FULL_PROJECT_NAME / tpl_full_project_name - Full project name (e.g., "acme_my_custom_plugin")
|
|
@@ -117,6 +118,10 @@ export function getPlaceholderValues(namespace, projectName, description) {
|
|
|
117
118
|
NAMESPACE_LOWER: namespace.toLowerCase(),
|
|
118
119
|
PROJECT_NAME: projectName,
|
|
119
120
|
PROJECT_NAME_PASCAL: toPascalCase(projectName),
|
|
121
|
+
PROJECT_NAME_TITLE: projectName
|
|
122
|
+
.split('_')
|
|
123
|
+
.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
124
|
+
.join(' '),
|
|
120
125
|
PROJECT_NAME_SLUG: projectName.replace(/_/g, '-'),
|
|
121
126
|
PROJECT_NAME_FLAT: projectName.replace(/_/g, ''),
|
|
122
127
|
FULL_PROJECT_NAME: fullProjectName,
|