wp-advads 1.0.34 → 1.0.35
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/README.md +82 -63
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,139 +1,158 @@
|
|
|
1
|
-
# wp-advads
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
# wp-advads
|
|
5
2
|
|
|
6
3
|
[](https://www.npmjs.com/package/wp-advads)
|
|
7
4
|
[](LICENSE)
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
<img src="https://img.icons8.com/nolan/256/wordpress.png"/>
|
|
11
|
-
</p>
|
|
6
|
+
CLI scaffolding for an **existing** Advanced Ads WordPress plugin. It writes `wp.advads` and file stubs (`class`, `view`, `updates`, `js`, `css`). It does not generate a plugin from scratch.
|
|
12
7
|
|
|
13
|
-
|
|
8
|
+
Requires **Node.js 18+**. Created by [Shakeeb Ahmed](https://github.com/meshakeeb).
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
Created by [Shakeeb Ahmed](https://github.com/meshakeeb)
|
|
10
|
+
## Installation
|
|
17
11
|
|
|
18
|
-
## 📦 Installation
|
|
19
|
-
Use via npx:
|
|
20
12
|
```bash
|
|
21
13
|
npx wp-advads
|
|
22
14
|
```
|
|
23
15
|
|
|
24
|
-
## 🚀 Usage
|
|
25
|
-
Run the CLI using:
|
|
26
16
|
```bash
|
|
27
17
|
npx wp-advads <command> [options]
|
|
28
18
|
```
|
|
29
19
|
|
|
30
|
-
##
|
|
20
|
+
## Config
|
|
21
|
+
|
|
22
|
+
Commands (except `init`) need a `wp.advads` file. The CLI uses the nearest ancestor that already has one. `init` writes `wp.advads` in the current directory.
|
|
23
|
+
|
|
24
|
+
If the file is missing, the CLI exits and tells you to run `wp-advads init`. It does not prompt.
|
|
25
|
+
|
|
26
|
+
## Commands
|
|
31
27
|
|
|
32
28
|
#### `init`
|
|
33
|
-
|
|
29
|
+
|
|
30
|
+
Creates `wp.advads` in the current directory.
|
|
31
|
+
|
|
34
32
|
```bash
|
|
35
33
|
npx wp-advads init
|
|
36
34
|
```
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
#### `build`
|
|
37
|
+
|
|
38
|
+
Installs PHP dependencies into `packages/` (`COMPOSER_VENDOR_DIR=packages`), dumps the autoloader, runs `npm run build` when `package.json` has a `scripts.build`, then generates a `.pot`.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx wp-advads build
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Standalone `build` does not touch release git messages. During `release`, commit bullets are passed in explicitly.
|
|
39
45
|
|
|
40
46
|
#### `release`
|
|
41
|
-
|
|
47
|
+
|
|
48
|
+
Bumps the version, changelog, translations, build, and git (explicit file list, hooks run). Stops on the first failed step.
|
|
49
|
+
|
|
42
50
|
```bash
|
|
43
51
|
npx wp-advads release
|
|
44
52
|
```
|
|
45
53
|
|
|
46
|
-
|
|
47
54
|
#### `class <classname> [options]`
|
|
48
|
-
|
|
55
|
+
|
|
56
|
+
Writes a PHP class under `paths.php`. Combine `--heading` with a template flag (`-i` / `-g` / `-r` / `-s`).
|
|
57
|
+
|
|
49
58
|
```bash
|
|
50
59
|
npx wp-advads class MyClass --heading "Class Heading" --description "Description" -s
|
|
51
60
|
```
|
|
52
61
|
|
|
53
|
-
|
|
54
|
-
- `<classname>` – The name of the class.
|
|
55
|
-
|
|
56
|
-
##### Optional Argument:
|
|
62
|
+
- `<classname>` – Class name (namespaces with `\`, e.g. `Foo\Bar`)
|
|
57
63
|
- `--heading <heading>` – File heading
|
|
58
64
|
- `--description <description>` – File description
|
|
59
|
-
- `-i` – Initializer
|
|
60
|
-
- `-g` – Integration
|
|
61
|
-
- `-r` – REST
|
|
62
|
-
- `-s` – Singleton
|
|
63
|
-
|
|
65
|
+
- `-i` – Initializer
|
|
66
|
+
- `-g` – Integration
|
|
67
|
+
- `-r` – REST
|
|
68
|
+
- `-s` – Singleton (`__construct` is private)
|
|
69
|
+
- `--force` – Overwrite if the file exists
|
|
64
70
|
|
|
65
71
|
#### `view <viewname> [heading]`
|
|
66
|
-
|
|
72
|
+
|
|
73
|
+
Writes a PHP view under `paths.views`. Nested names accept `/` or `\`.
|
|
74
|
+
|
|
67
75
|
```bash
|
|
68
76
|
npx wp-advads view sidebar "Sidebar View"
|
|
77
|
+
npx wp-advads view admin/settings
|
|
69
78
|
```
|
|
70
79
|
|
|
71
|
-
|
|
72
|
-
-
|
|
80
|
+
- `<viewname>` – View file name
|
|
81
|
+
- `[heading]` – Heading comment
|
|
82
|
+
- `--force` – Overwrite if the file exists
|
|
73
83
|
|
|
74
|
-
|
|
75
|
-
- `[heading]` – A heading comment added to the view file.
|
|
84
|
+
#### `updates <version>`
|
|
76
85
|
|
|
86
|
+
Writes an upgrade file under `paths.updates`. `misc.prefix` from `wp.advads` is required (empty prefix is an error).
|
|
77
87
|
|
|
78
|
-
#### `updates <version>`
|
|
79
|
-
Creates update logic for the given plugin version.
|
|
80
88
|
```bash
|
|
81
89
|
npx wp-advads updates 1.2.3
|
|
82
90
|
```
|
|
83
91
|
|
|
84
|
-
|
|
85
|
-
-
|
|
92
|
+
- `<version>` – Target version (e.g. `1.2.3`)
|
|
93
|
+
- `--force` – Overwrite if the file exists
|
|
86
94
|
|
|
87
95
|
#### `js <filename> [options]`
|
|
88
|
-
|
|
96
|
+
|
|
97
|
+
Writes a JavaScript file under `paths.javascript`. Nested names accept `/` or `\`.
|
|
98
|
+
|
|
89
99
|
```bash
|
|
90
100
|
npx wp-advads js script -h "Main JS" -d "Handles the frontend logic"
|
|
91
101
|
```
|
|
92
102
|
|
|
93
|
-
|
|
94
|
-
-
|
|
103
|
+
- `<filename>` – Name without extension
|
|
104
|
+
- `-h <heading>` – Heading comment
|
|
105
|
+
- `-d <description>` – Description comment
|
|
106
|
+
- `--force` – Overwrite if the file exists
|
|
95
107
|
|
|
96
|
-
|
|
97
|
-
- `-h <heading>` – Heading comment for the file.
|
|
98
|
-
- `-d <description>` – Description comment for the file.
|
|
108
|
+
#### `css <filename> [options]`
|
|
99
109
|
|
|
110
|
+
Writes a CSS file under `paths.css`. Nested names accept `/` or `\`.
|
|
100
111
|
|
|
101
|
-
#### `css <filename> [options]`
|
|
102
|
-
Creates a new CSS file.
|
|
103
112
|
```bash
|
|
104
113
|
npx wp-advads css styles -h "Main CSS" -d "Plugin styles"
|
|
105
114
|
```
|
|
106
115
|
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
- `-h <heading>` – Heading comment for the file.
|
|
112
|
-
- `-d <description>` – Description comment for the file.
|
|
116
|
+
- `<filename>` – Name without extension
|
|
117
|
+
- `-h <heading>` – Heading comment
|
|
118
|
+
- `-d <description>` – Description comment
|
|
119
|
+
- `--force` – Overwrite if the file exists
|
|
113
120
|
|
|
114
121
|
#### `pot`
|
|
115
|
-
|
|
122
|
+
|
|
123
|
+
Creates a `.pot` translation template (`wp i18n make-pot`).
|
|
124
|
+
|
|
116
125
|
```bash
|
|
117
126
|
npx wp-advads pot
|
|
118
127
|
```
|
|
119
128
|
|
|
129
|
+
POT headers (`Last-Translator`, `Language-Team`) use `author.name` and `author.email` from `wp.advads`.
|
|
130
|
+
|
|
120
131
|
#### `translations`
|
|
121
|
-
|
|
132
|
+
|
|
133
|
+
Downloads `.po` / `.mo` files from GlotPress into `glotpress.destination` (default `./languages/`). Locale ids must be `[a-zA-Z0-9_]+`; non-OK HTTP responses are skipped.
|
|
134
|
+
|
|
122
135
|
```bash
|
|
123
136
|
npx wp-advads translations
|
|
124
137
|
```
|
|
125
138
|
|
|
126
|
-
|
|
127
|
-
|
|
139
|
+
## Notes
|
|
140
|
+
|
|
141
|
+
`class`, `view`, `updates`, `js`, and `css` will not overwrite an existing file unless you pass `--force`. Writes cannot escape the project root.
|
|
142
|
+
|
|
143
|
+
## Tests
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
npm test
|
|
147
|
+
```
|
|
128
148
|
|
|
129
|
-
|
|
149
|
+
That runs `node --experimental-test-module-mocks --test`. Node 18+ is required (`engines.node`).
|
|
130
150
|
|
|
131
|
-
|
|
151
|
+
## Author
|
|
132
152
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
GitHub: [@meshakeeb](http://github.com/meshakeeb)
|
|
153
|
+
Shakeeb Ahmed
|
|
154
|
+
GitHub: [@meshakeeb](https://github.com/meshakeeb)
|
|
136
155
|
|
|
137
|
-
|
|
156
|
+
## Changelog
|
|
138
157
|
|
|
139
|
-
[
|
|
158
|
+
[CHANGELOG.md](./CHANGELOG.md)
|