@airfleet/generator-init 0.37.0 → 0.39.0
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/generators/plugin/index.js +115 -26
- package/generators/plugin/templates/.browserslistrc +2 -0
- package/generators/plugin/templates/.dprint.json +3 -0
- package/generators/plugin/templates/.github/workflows/release-plugin-preview.yml +197 -0
- package/generators/plugin/templates/.github/workflows/release-plugin.yml +24 -18
- package/generators/plugin/templates/.github/workflows/test-wordpress.yml +43 -10
- package/generators/plugin/templates/.husky/pre-commit +1 -4
- package/generators/plugin/templates/.lintstagedrc.json +12 -0
- package/generators/plugin/templates/.node-version +1 -0
- package/generators/plugin/templates/.oxlintrc.json +3 -0
- package/generators/plugin/templates/.parcelrc +1 -2
- package/generators/plugin/templates/.stylelintrc.json +4 -0
- package/generators/plugin/templates/.vscode/airfleet.code-snippets.ejs +5 -1
- package/generators/plugin/templates/.vscode/settings.json +18 -8
- package/generators/plugin/templates/README.md.ejs +0 -11
- package/generators/plugin/templates/composer-scoped-empty.json.ejs +6 -0
- package/generators/plugin/templates/composer-scoped-empty.lock.ejs +18 -0
- package/generators/{project-plugin/templates/composer-scoped.json.ejs → plugin/templates/composer-scoped-framework.json.ejs} +1 -1
- package/generators/{project-plugin/templates/composer-scoped.lock.ejs → plugin/templates/composer-scoped-framework.lock.ejs} +19 -20
- package/generators/{project-plugin/templates/composer.json.ejs → plugin/templates/composer-with-scoper.json.ejs} +5 -4
- package/generators/plugin/templates/composer-without-scoper.json.ejs +40 -0
- package/generators/plugin/templates/gitignore +1 -0
- package/generators/plugin/templates/globals.d.ts +1 -0
- package/generators/plugin/templates/inc/AjaxVariables.php.ejs +1 -1
- package/generators/plugin/templates/inc/AjaxVariablesAdmin.php.ejs +1 -1
- package/generators/plugin/templates/inc/Options/GeneralOptions.php.ejs +2 -2
- package/generators/plugin/templates/inc/Pages.php.ejs +3 -3
- package/generators/plugin/templates/inc/RegisterViews.php.ejs +1 -1
- package/generators/plugin/templates/inc/Setup.php.ejs +6 -6
- package/generators/plugin/templates/package.json.ejs +9 -53
- package/generators/plugin/templates/plugin-name-api.php +1 -0
- package/generators/{project-plugin/templates/plugin-name.php.ejs → plugin/templates/plugin-name-scoped-framework.php.ejs} +11 -1
- package/generators/plugin/templates/plugin-name-unscoped-framework.php.ejs +82 -0
- package/generators/plugin/templates/scoper.custom.php.ejs +1 -0
- package/generators/project/index.js +14 -21
- package/generators/project/info.js +2 -2
- package/generators/project/prompts.js +10 -16
- package/generators/project/templates/.deployignore +8 -0
- package/generators/project/templates/.github/workflows/test-wordpress-root-lightyear.yml +46 -9
- package/generators/project/templates/.husky/pre-commit +1 -4
- package/generators/project/templates/.vscode/airfleet.code-snippets +2 -2
- package/generators/project/templates/.vscode/settings.json +18 -8
- package/generators/project/templates/README.md.ejs +0 -9
- package/generators/project-plugin/index.js +85 -14
- package/generators/project-plugin/templates/.browserslistrc +2 -0
- package/generators/project-plugin/templates/.deployignore +38 -8
- package/generators/project-plugin/templates/.dprint.json +3 -0
- package/generators/project-plugin/templates/.github/workflows/test-wordpress.yml +43 -12
- package/generators/project-plugin/templates/.husky/pre-commit +1 -4
- package/generators/project-plugin/templates/.lintstagedrc.json +12 -0
- package/generators/project-plugin/templates/.node-version +1 -0
- package/generators/project-plugin/templates/.oxlintrc.json +3 -0
- package/generators/project-plugin/templates/.parcelrc +1 -2
- package/generators/project-plugin/templates/.stylelintrc.json +4 -0
- package/generators/project-plugin/templates/.vscode/airfleet.code-snippets.ejs +5 -1
- package/generators/project-plugin/templates/.vscode/settings.json +18 -8
- package/generators/project-plugin/templates/README.md.ejs +0 -7
- package/generators/project-plugin/templates/assets/admin/styles/admin.entry.scss +2 -2
- package/generators/project-plugin/templates/assets/editor/styles/editor.entry.scss +8 -7
- package/generators/project-plugin/templates/assets/frontend/styles/_main.scss +7 -3
- package/generators/project-plugin/templates/assets/frontend/styles/_placeholders.scss +9 -3
- package/generators/project-plugin/templates/assets/frontend/styles/_root.scss +2 -2
- package/generators/project-plugin/templates/assets/frontend/styles/critical.entry.scss +1 -1
- package/generators/project-plugin/templates/assets/frontend/styles/index.entry.scss +7 -5
- package/generators/project-plugin/templates/assets/frontend/styles/main/_body.scss +6 -4
- package/generators/project-plugin/templates/assets/frontend/styles/main/_reset.scss +98 -96
- package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_button.scss +42 -40
- package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_container.scss +12 -10
- package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_sections.scss +6 -4
- package/generators/project-plugin/templates/assets/frontend/styles/root/_fonts.scss +2 -2
- package/generators/project-plugin/templates/assets/shared/styles/_figma-variables.scss +2 -5
- package/generators/project-plugin/templates/assets/shared/styles/_lib.scss +2 -2
- package/generators/project-plugin/templates/assets/shared/styles/_root.scss +2 -2
- package/generators/project-plugin/templates/assets/shared/styles/lib/_mixins.scss +6 -6
- package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_breakpoints.scss +1 -0
- package/generators/project-plugin/templates/composer-scoped-empty.json.ejs +6 -0
- package/generators/project-plugin/templates/composer-scoped-empty.lock.ejs +18 -0
- package/generators/{plugin/templates/composer-scoped.json.ejs → project-plugin/templates/composer-scoped-framework.json.ejs} +1 -1
- package/generators/{plugin/templates/composer-scoped.lock.ejs → project-plugin/templates/composer-scoped-framework.lock.ejs} +19 -20
- package/generators/{plugin/templates/composer.json.ejs → project-plugin/templates/composer-with-scoper.json.ejs} +5 -4
- package/generators/project-plugin/templates/composer-without-scoper.json.ejs +40 -0
- package/generators/project-plugin/templates/gitignore +1 -0
- package/generators/project-plugin/templates/globals.d.ts +1 -0
- package/generators/project-plugin/templates/inc/Features/Menus.php.ejs +1 -1
- package/generators/project-plugin/templates/inc/Setup/AjaxVariables.php.ejs +1 -1
- package/generators/project-plugin/templates/inc/Setup/AjaxVariablesAdmin.php.ejs +1 -1
- package/generators/project-plugin/templates/inc/Setup/Breakpoints.php.ejs +1 -1
- package/generators/project-plugin/templates/inc/Setup/Colors.php.ejs +1 -1
- package/generators/project-plugin/templates/inc/Setup/RegisterViews.php.ejs +1 -1
- package/generators/project-plugin/templates/inc/Setup.php.ejs +3 -3
- package/generators/project-plugin/templates/package.json.ejs +9 -58
- package/generators/{plugin/templates/plugin-name.php.ejs → project-plugin/templates/plugin-name-scoped-framework.php.ejs} +6 -1
- package/generators/project-plugin/templates/plugin-name-unscoped-framework.php.ejs +79 -0
- package/generators/project-plugin/templates/scoper.custom.php.ejs +1 -0
- package/generators/snippets/templates/airfleet.code-snippets.ejs +2 -2
- package/package.json +1 -1
- package/generators/plugin/templates/.prettierignore +0 -15
|
@@ -31,32 +31,23 @@ export default class extends Generator {
|
|
|
31
31
|
await this._copyTheme();
|
|
32
32
|
this._fixHusky();
|
|
33
33
|
await this._installTheme();
|
|
34
|
-
await this._handleBootstrap();
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
async _copyTheme() {
|
|
38
37
|
const repository = this._themeRepository();
|
|
39
38
|
const themeFolder = this._themeFolder();
|
|
40
|
-
await this.spawnCommand(
|
|
39
|
+
await this.spawnCommand("git", [
|
|
40
|
+
"clone",
|
|
41
|
+
"--depth=1",
|
|
42
|
+
repository,
|
|
43
|
+
themeFolder,
|
|
44
|
+
]);
|
|
41
45
|
this._deleteFolder(`${themeFolder}/.git`);
|
|
42
46
|
}
|
|
43
47
|
|
|
44
|
-
async _handleBootstrap() {
|
|
45
|
-
const themeFolder = this._themeFolder();
|
|
46
|
-
|
|
47
|
-
if (this.answers.addBootstrap) {
|
|
48
|
-
this._deleteFolder(`${themeFolder}/assets`);
|
|
49
|
-
this._moveFolder(`${themeFolder}/assets-bootstrap`, `${themeFolder}/assets`);
|
|
50
|
-
this._deleteFolder(`${themeFolder}/assets-bootstrap`);
|
|
51
|
-
} else {
|
|
52
|
-
this._deleteFolder(`${themeFolder}/assets-bootstrap`);
|
|
53
|
-
await this._spawnThemeCommand('npm', ['uninstall', "@popperjs/core", "bootstrap", "--save"]);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
48
|
async _installTheme() {
|
|
58
|
-
await this._spawnThemeCommand(
|
|
59
|
-
await this._spawnThemeCommand(
|
|
49
|
+
await this._spawnThemeCommand("composer", ["install"]);
|
|
50
|
+
await this._spawnThemeCommand("bun", ["install"]);
|
|
60
51
|
}
|
|
61
52
|
|
|
62
53
|
_fixHusky() {
|
|
@@ -64,7 +55,7 @@ export default class extends Generator {
|
|
|
64
55
|
const packageJsonPath = `${this._themeFolder()}/package.json`;
|
|
65
56
|
const packageJson = this.readDestinationJSON(packageJsonPath);
|
|
66
57
|
|
|
67
|
-
packageJson.scripts.prepare = "cd .. && cd .. && cd .. && husky
|
|
58
|
+
packageJson.scripts.prepare = "cd .. && cd .. && cd .. && husky";
|
|
68
59
|
this.writeDestinationJSON(packageJsonPath, packageJson);
|
|
69
60
|
}
|
|
70
61
|
|
|
@@ -79,7 +70,7 @@ export default class extends Generator {
|
|
|
79
70
|
}
|
|
80
71
|
|
|
81
72
|
_moveFolder(source, destination) {
|
|
82
|
-
this.moveDestination(source, destination, { globOptions: {dot: true} });
|
|
73
|
+
this.moveDestination(source, destination, { globOptions: { dot: true } });
|
|
83
74
|
}
|
|
84
75
|
|
|
85
76
|
_deleteFolder(path) {
|
|
@@ -88,7 +79,9 @@ export default class extends Generator {
|
|
|
88
79
|
this.deleteDestination(`${path}/**/*`);
|
|
89
80
|
}
|
|
90
81
|
|
|
91
|
-
async _spawnThemeCommand(command, params
|
|
92
|
-
return await this.spawnCommand(command, params, {
|
|
82
|
+
async _spawnThemeCommand(command, params) {
|
|
83
|
+
return await this.spawnCommand(command, params, {
|
|
84
|
+
cwd: this.destinationPath(this._themeFolder()),
|
|
85
|
+
});
|
|
93
86
|
}
|
|
94
87
|
}
|
|
@@ -24,8 +24,8 @@ export default class {
|
|
|
24
24
|
" - Navigated to the project folder on the command line",
|
|
25
25
|
"",
|
|
26
26
|
"Requirements for running the theme:",
|
|
27
|
-
" - Node >=
|
|
28
|
-
" - PHP 8.
|
|
27
|
+
" - Node >= 24",
|
|
28
|
+
" - PHP 8.3",
|
|
29
29
|
" - Composer 2",
|
|
30
30
|
" - Required WP plugins (see the theme Notion docs)",
|
|
31
31
|
"",
|
|
@@ -13,8 +13,7 @@ export default class {
|
|
|
13
13
|
repository: undefined,
|
|
14
14
|
productionUrl: undefined,
|
|
15
15
|
stagingUrl: undefined,
|
|
16
|
-
|
|
17
|
-
}
|
|
16
|
+
};
|
|
18
17
|
this.answers = {};
|
|
19
18
|
}
|
|
20
19
|
|
|
@@ -25,7 +24,6 @@ export default class {
|
|
|
25
24
|
this._repositoryPrompt(),
|
|
26
25
|
this._productionUrlPrompt(),
|
|
27
26
|
this._stagingUrlPrompt(),
|
|
28
|
-
this._addBootstrapPrompt(),
|
|
29
27
|
]);
|
|
30
28
|
|
|
31
29
|
return this.answers;
|
|
@@ -46,7 +44,10 @@ export default class {
|
|
|
46
44
|
return {
|
|
47
45
|
type: "input",
|
|
48
46
|
name: "title",
|
|
49
|
-
message: this._message(
|
|
47
|
+
message: this._message(
|
|
48
|
+
`What is the name of the project?`,
|
|
49
|
+
`(e.g. "Zenity Website 2023")`
|
|
50
|
+
),
|
|
50
51
|
validate: requiredText("Please enter a name"),
|
|
51
52
|
default: this.defaults.title,
|
|
52
53
|
};
|
|
@@ -66,7 +67,10 @@ export default class {
|
|
|
66
67
|
return {
|
|
67
68
|
type: "input",
|
|
68
69
|
name: "repository",
|
|
69
|
-
message: this._message(
|
|
70
|
+
message: this._message(
|
|
71
|
+
"What's the repository URL?",
|
|
72
|
+
`(start with https and end with .git)`
|
|
73
|
+
),
|
|
70
74
|
validate: function requiredText(text) {
|
|
71
75
|
if (!text) {
|
|
72
76
|
return "Please enter the repository URL";
|
|
@@ -76,7 +80,7 @@ export default class {
|
|
|
76
80
|
|
|
77
81
|
if (!matches) {
|
|
78
82
|
return "Repository URL must start with https:// and end in .git";
|
|
79
|
-
}
|
|
83
|
+
}
|
|
80
84
|
|
|
81
85
|
return true;
|
|
82
86
|
},
|
|
@@ -101,14 +105,4 @@ export default class {
|
|
|
101
105
|
default: this.defaults.stagingUrl,
|
|
102
106
|
};
|
|
103
107
|
}
|
|
104
|
-
|
|
105
|
-
_addBootstrapPrompt() {
|
|
106
|
-
return {
|
|
107
|
-
type: "confirm",
|
|
108
|
-
name: "addBootstrap",
|
|
109
|
-
message: this._message("Add Bootstrap?"),
|
|
110
|
-
default: this.defaults.addBootstrap,
|
|
111
|
-
store: true,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
108
|
}
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
**/.airfleet-release
|
|
13
13
|
**/.airfleet-license
|
|
14
14
|
**/.airfleet-visible
|
|
15
|
+
**/.browserslistrc
|
|
15
16
|
**/.deployignore
|
|
17
|
+
**/.dprint.json
|
|
16
18
|
**/.editorconfig
|
|
17
19
|
.editorconfig
|
|
18
20
|
**/.env
|
|
@@ -24,6 +26,9 @@
|
|
|
24
26
|
.gitignore
|
|
25
27
|
**/.gitkeep
|
|
26
28
|
**/.gitlab-ci.yml
|
|
29
|
+
**/.lintstagedrc.json
|
|
30
|
+
**/.node-version
|
|
31
|
+
**/.oxlintrc.json
|
|
27
32
|
**/.parcelrc
|
|
28
33
|
**/.phpcscache
|
|
29
34
|
**/.prettierignore
|
|
@@ -31,12 +36,15 @@
|
|
|
31
36
|
**/.stylelintrc.js
|
|
32
37
|
**/.stylelintrc.json
|
|
33
38
|
**/.travis
|
|
39
|
+
**/AGENTS.md
|
|
40
|
+
**/bun.lock
|
|
34
41
|
**/CHANGELOG
|
|
35
42
|
**/CHANGELOG.md
|
|
36
43
|
**/CODE_OF_CONDUCT
|
|
37
44
|
**/CODE_OF_CONDUCT.md
|
|
38
45
|
**/composer.json
|
|
39
46
|
**/composer.lock
|
|
47
|
+
**/globals.d.ts
|
|
40
48
|
**/LICENSE
|
|
41
49
|
**/LICENSE.md
|
|
42
50
|
**/package-lock.json
|
|
@@ -17,7 +17,7 @@ jobs:
|
|
|
17
17
|
|
|
18
18
|
steps:
|
|
19
19
|
- name: 🚚 Get latest code
|
|
20
|
-
uses: actions/checkout@
|
|
20
|
+
uses: actions/checkout@v6
|
|
21
21
|
|
|
22
22
|
- name: ⚙️ Setup PHP
|
|
23
23
|
uses: shivammathur/setup-php@v2
|
|
@@ -25,10 +25,8 @@ jobs:
|
|
|
25
25
|
php-version: "8.2"
|
|
26
26
|
ini-values: short_open_tag=1
|
|
27
27
|
|
|
28
|
-
- name: ⚙️
|
|
29
|
-
uses:
|
|
30
|
-
with:
|
|
31
|
-
node-version: 16
|
|
28
|
+
- name: ⚙️ Install bun
|
|
29
|
+
uses: oven-sh/setup-bun@v2
|
|
32
30
|
|
|
33
31
|
- name: 🔨 Increase composer timeout
|
|
34
32
|
run: composer --global config process-timeout 1500
|
|
@@ -36,11 +34,50 @@ jobs:
|
|
|
36
34
|
- name: 🔨 Composer install
|
|
37
35
|
run: composer install --prefer-dist --no-ansi --no-interaction --no-progress --optimize-autoloader
|
|
38
36
|
|
|
39
|
-
- name: 🔨
|
|
40
|
-
run:
|
|
37
|
+
- name: 🔨 Bun install
|
|
38
|
+
run: bun ci
|
|
39
|
+
|
|
40
|
+
- name: 🔬 Lint
|
|
41
|
+
run: bun run --if-present lint
|
|
41
42
|
|
|
42
43
|
- name: 🔬 Test
|
|
43
|
-
run:
|
|
44
|
+
run: bun run --if-present test
|
|
44
45
|
|
|
45
46
|
- name: 📦 Build
|
|
46
|
-
run:
|
|
47
|
+
run: bun run --if-present build
|
|
48
|
+
|
|
49
|
+
test-php:
|
|
50
|
+
runs-on: ubuntu-latest
|
|
51
|
+
|
|
52
|
+
defaults:
|
|
53
|
+
run:
|
|
54
|
+
working-directory: ./wp-content/themes/airfleet-lightyear
|
|
55
|
+
|
|
56
|
+
strategy:
|
|
57
|
+
matrix:
|
|
58
|
+
php-versions: ["8.2", "8.3", "8.4", "8.5"]
|
|
59
|
+
|
|
60
|
+
steps:
|
|
61
|
+
- name: 🚚 Get latest code
|
|
62
|
+
uses: actions/checkout@v6
|
|
63
|
+
|
|
64
|
+
- name: ⚙️ Setup PHP
|
|
65
|
+
uses: shivammathur/setup-php@v2
|
|
66
|
+
with:
|
|
67
|
+
php-version: "${{ matrix.php-versions }}"
|
|
68
|
+
ini-values: short_open_tag=1
|
|
69
|
+
|
|
70
|
+
- name: ⚙️ Install bun
|
|
71
|
+
uses: oven-sh/setup-bun@v2
|
|
72
|
+
|
|
73
|
+
- name: 🔨 Increase composer timeout
|
|
74
|
+
run: composer --global config process-timeout 1500
|
|
75
|
+
|
|
76
|
+
- name: 🔨 Composer install
|
|
77
|
+
run: composer install --prefer-dist --no-ansi --no-interaction --no-progress --optimize-autoloader
|
|
78
|
+
|
|
79
|
+
- name: 🔨 Bun install
|
|
80
|
+
run: bun ci
|
|
81
|
+
|
|
82
|
+
- name: 🔬 Lint
|
|
83
|
+
run: bun run lint --php
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"",
|
|
8
8
|
"namespace Airfleet\\Themes\\Lightyear\\\\${TM_DIRECTORY/^.+[\\/\\\\]+(.*)$/$1/};",
|
|
9
9
|
"",
|
|
10
|
-
"use Airfleet\\
|
|
10
|
+
"use Airfleet\\Framework\\Features\\Feature;",
|
|
11
11
|
"",
|
|
12
12
|
"class $TM_FILENAME_BASE implements Feature {",
|
|
13
13
|
" public function initialize(): void {",
|
|
@@ -168,4 +168,4 @@
|
|
|
168
168
|
],
|
|
169
169
|
"description": "Bootstrap a Blade template for a partial"
|
|
170
170
|
}
|
|
171
|
-
}
|
|
171
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"editor.codeActionsOnSave": {
|
|
3
3
|
"source.fixAll": "explicit",
|
|
4
|
-
"source.fixAll.
|
|
4
|
+
"source.fixAll.oxc": "explicit"
|
|
5
5
|
},
|
|
6
|
+
"editor.defaultFormatter": "dprint.dprint",
|
|
6
7
|
"editor.formatOnSave": true,
|
|
7
8
|
"stylelint.validate": ["css", "scss", "postcss"],
|
|
8
9
|
"phpSniffer.executablesFolder": "./wp-content/themes/airfleet-lightyear/vendor/bin/",
|
|
@@ -28,24 +29,33 @@
|
|
|
28
29
|
"editor.defaultFormatter": "wongjn.php-sniffer"
|
|
29
30
|
},
|
|
30
31
|
"[javascript]": {
|
|
31
|
-
"editor.defaultFormatter": "
|
|
32
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
32
33
|
},
|
|
33
34
|
"[javascriptreact]": {
|
|
34
|
-
"editor.defaultFormatter": "
|
|
35
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
35
36
|
},
|
|
36
37
|
"[typescript]": {
|
|
37
|
-
"editor.defaultFormatter": "
|
|
38
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
38
39
|
},
|
|
39
40
|
"[typescriptreact]": {
|
|
40
|
-
"editor.defaultFormatter": "
|
|
41
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
41
42
|
},
|
|
42
43
|
"[postcss]": {
|
|
43
|
-
"editor.defaultFormatter": "
|
|
44
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
44
45
|
},
|
|
45
46
|
"[scss]": {
|
|
46
|
-
"editor.defaultFormatter": "
|
|
47
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
47
48
|
},
|
|
48
49
|
"[css]": {
|
|
49
|
-
"editor.defaultFormatter": "
|
|
50
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
51
|
+
},
|
|
52
|
+
"[json]": {
|
|
53
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
54
|
+
},
|
|
55
|
+
"[yaml]": {
|
|
56
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
57
|
+
},
|
|
58
|
+
"[markdown]": {
|
|
59
|
+
"editor.defaultFormatter": "dprint.dprint"
|
|
50
60
|
}
|
|
51
61
|
}
|
|
@@ -4,15 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
<%= answers.description %>
|
|
6
6
|
|
|
7
|
-
## Getting Started
|
|
8
|
-
|
|
9
|
-
Navigate to the theme folder (`wp-content/themes/airfleet-lightyear`) and run:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
composer install
|
|
13
|
-
npm install
|
|
14
|
-
```
|
|
15
|
-
|
|
16
7
|
## License
|
|
17
8
|
|
|
18
9
|
© [Airfleet](https://www.airfleet.co/)
|
|
@@ -10,7 +10,6 @@ import title from "../../utils/log/title.js";
|
|
|
10
10
|
import highlightText from "../../utils/log/text/highlightText.js";
|
|
11
11
|
import lines from "../../utils/log/text/lines.js";
|
|
12
12
|
import infoBox from "../../utils/log/boxes/infoBox.js";
|
|
13
|
-
import objectPropertyFromValue from '../../utils/objectPropertyFromValue.js';
|
|
14
13
|
|
|
15
14
|
export default class extends Generator {
|
|
16
15
|
async prompting() {
|
|
@@ -58,14 +57,40 @@ export default class extends Generator {
|
|
|
58
57
|
name: "pluginPhpVersion",
|
|
59
58
|
message: "What's the required PHP version?",
|
|
60
59
|
validate: requiredText("Please enter the PHP version"),
|
|
61
|
-
default: ">=8.
|
|
60
|
+
default: ">=8.3",
|
|
62
61
|
},
|
|
63
62
|
{
|
|
64
63
|
type: "input",
|
|
65
64
|
name: "pluginNodeVersion",
|
|
66
65
|
message: "What's the required Node version?",
|
|
67
66
|
validate: requiredText("Please enter the Node version"),
|
|
68
|
-
default: ">=
|
|
67
|
+
default: ">=24",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: "confirm",
|
|
71
|
+
name: "useScopedFramework",
|
|
72
|
+
message: "Use scoped framework?",
|
|
73
|
+
default: false,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
type: "confirm",
|
|
77
|
+
name: "addScoper",
|
|
78
|
+
message: "Add scoper setup?",
|
|
79
|
+
default: false,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
type: "confirm",
|
|
83
|
+
name: "hasDependencies",
|
|
84
|
+
message: "Specify plugin dependencies?",
|
|
85
|
+
default: true,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: "input",
|
|
89
|
+
name: "dependencies",
|
|
90
|
+
message: "Plugin dependencies (comma separated slugs)",
|
|
91
|
+
default:
|
|
92
|
+
"advanced-custom-fields-pro, airfleet-framework, airfleet-views, airfleet-elements-core",
|
|
93
|
+
when: (answers) => answers.hasDependencies,
|
|
69
94
|
},
|
|
70
95
|
{
|
|
71
96
|
type: "confirm",
|
|
@@ -91,11 +116,14 @@ export default class extends Generator {
|
|
|
91
116
|
mainBranch: "main",
|
|
92
117
|
year: new Date().getFullYear(),
|
|
93
118
|
phpVersion: this._getPhpVersion(this.answers.pluginPhpVersion),
|
|
119
|
+
frameworkNamespace: this.answers.useScopedFramework
|
|
120
|
+
? `Airfleet\\Plugins\\${this.nameNoAirfleet.pascal}\\Vendor\\Airfleet\\Framework\\`
|
|
121
|
+
: `Airfleet\\Framework\\`,
|
|
94
122
|
};
|
|
95
123
|
}
|
|
96
124
|
|
|
97
125
|
writing() {
|
|
98
|
-
const templateExtension = this.answers.pluginUseBlade ?
|
|
126
|
+
const templateExtension = this.answers.pluginUseBlade ? "blade.php" : "php";
|
|
99
127
|
|
|
100
128
|
const files = [
|
|
101
129
|
".github/workflows/create-asana-attachment.yaml",
|
|
@@ -161,20 +189,23 @@ export default class extends Generator {
|
|
|
161
189
|
"views-elements/partials/button/ButtonSetup.php.ejs",
|
|
162
190
|
"views-elements/.gitkeep",
|
|
163
191
|
".airfleet-release",
|
|
192
|
+
".browserslistrc",
|
|
193
|
+
".dprint.json",
|
|
164
194
|
".editorconfig",
|
|
165
195
|
".env",
|
|
166
196
|
".gitattributes",
|
|
197
|
+
".lintstagedrc.json",
|
|
198
|
+
".node-version.ejs",
|
|
199
|
+
".oxlintrc.json",
|
|
167
200
|
".parcelrc",
|
|
168
|
-
".
|
|
201
|
+
".stylelintrc.json",
|
|
169
202
|
"CHANGELOG.md",
|
|
170
|
-
"
|
|
171
|
-
"composer-scoped.json.ejs",
|
|
203
|
+
"globals.d.ts",
|
|
172
204
|
"index.php",
|
|
173
205
|
"LICENSE.ejs",
|
|
174
206
|
"package.json.ejs",
|
|
175
207
|
"phpcs.xml.ejs",
|
|
176
208
|
"README.md.ejs",
|
|
177
|
-
"scoper.custom.php.ejs",
|
|
178
209
|
".deployignore",
|
|
179
210
|
];
|
|
180
211
|
const templates = [
|
|
@@ -190,9 +221,14 @@ export default class extends Generator {
|
|
|
190
221
|
isEnabled: true,
|
|
191
222
|
},
|
|
192
223
|
{
|
|
193
|
-
template: "plugin-name.php.ejs",
|
|
224
|
+
template: "plugin-name-scoped-framework.php.ejs",
|
|
194
225
|
destination: `${this.name.slug}.php`,
|
|
195
|
-
isEnabled:
|
|
226
|
+
isEnabled: this.answers.useScopedFramework,
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
template: "plugin-name-unscoped-framework.php.ejs",
|
|
230
|
+
destination: `${this.name.slug}.php`,
|
|
231
|
+
isEnabled: !this.answers.useScopedFramework,
|
|
196
232
|
},
|
|
197
233
|
{
|
|
198
234
|
template: "acf-json/.gitkeep",
|
|
@@ -204,17 +240,53 @@ export default class extends Generator {
|
|
|
204
240
|
destination: ".vscode/airfleet.code-snippets",
|
|
205
241
|
isEnabled: true,
|
|
206
242
|
},
|
|
243
|
+
{
|
|
244
|
+
template: "composer-with-scoper.json.ejs",
|
|
245
|
+
destination: "composer.json",
|
|
246
|
+
isEnabled: this.answers.addScoper,
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
template: "composer-without-scoper.json.ejs",
|
|
250
|
+
destination: "composer.json",
|
|
251
|
+
isEnabled: !this.answers.addScoper,
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
template: "composer-scoped-empty.json.ejs",
|
|
255
|
+
destination: "composer-scoped.json",
|
|
256
|
+
isEnabled: this.answers.addScoper && !this.answers.useScopedFramework,
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
template: "composer-scoped-empty.lock.ejs",
|
|
260
|
+
destination: "composer-scoped.lock",
|
|
261
|
+
isEnabled: this.answers.addScoper && !this.answers.useScopedFramework,
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
template: "composer-scoped-framework.json.ejs",
|
|
265
|
+
destination: "composer-scoped.json",
|
|
266
|
+
isEnabled: this.answers.addScoper && this.answers.useScopedFramework,
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
template: "composer-scoped-framework.lock.ejs",
|
|
270
|
+
destination: "composer-scoped.lock",
|
|
271
|
+
isEnabled: this.answers.addScoper && this.answers.useScopedFramework,
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
template: "scoper.custom.php.ejs",
|
|
275
|
+
destination: "scoper.custom.php",
|
|
276
|
+
isEnabled: this.answers.addScoper,
|
|
277
|
+
},
|
|
207
278
|
];
|
|
208
279
|
|
|
209
280
|
copyTemplates(this, templates, this.data);
|
|
210
281
|
}
|
|
211
282
|
|
|
212
|
-
install() {
|
|
213
|
-
this.spawnCommand("composer", ["install"]);
|
|
283
|
+
async install() {
|
|
284
|
+
await this.spawnCommand("composer", ["install"]);
|
|
285
|
+
await this.spawnCommand("bun", ["install"]);
|
|
214
286
|
}
|
|
215
287
|
|
|
216
288
|
_getPhpVersion(pluginPhpVersion) {
|
|
217
|
-
const toFind = [
|
|
289
|
+
const toFind = ["=", ">"];
|
|
218
290
|
|
|
219
291
|
for (const char of toFind) {
|
|
220
292
|
const index = pluginPhpVersion.indexOf(char);
|
|
@@ -226,5 +298,4 @@ export default class extends Generator {
|
|
|
226
298
|
|
|
227
299
|
return pluginPhpVersion;
|
|
228
300
|
}
|
|
229
|
-
|
|
230
301
|
}
|
|
@@ -15,7 +15,12 @@
|
|
|
15
15
|
.airfleet-license
|
|
16
16
|
**/.airfleet-visible
|
|
17
17
|
.airfleet-visible
|
|
18
|
+
**/.browserslistrc
|
|
19
|
+
.browserslistrc
|
|
18
20
|
**/.deployignore
|
|
21
|
+
.deployignore
|
|
22
|
+
**/.dprint.json
|
|
23
|
+
.dprint.json
|
|
19
24
|
**/.editorconfig
|
|
20
25
|
.editorconfig
|
|
21
26
|
**/.env
|
|
@@ -24,20 +29,51 @@
|
|
|
24
29
|
**/.eslintrc.js
|
|
25
30
|
**/.gitattributes
|
|
26
31
|
.gitattributes
|
|
32
|
+
**/.gitignore
|
|
33
|
+
.gitignore
|
|
34
|
+
**/.gitkeep
|
|
35
|
+
.gitkeep
|
|
36
|
+
**/.lintstagedrc.json
|
|
37
|
+
.lintstagedrc.json
|
|
38
|
+
**/.node-version
|
|
39
|
+
.node-version
|
|
40
|
+
**/.oxlintrc.json
|
|
41
|
+
.oxlintrc.json
|
|
27
42
|
**/.parcelrc
|
|
28
43
|
.parcelrc
|
|
44
|
+
**/.phpcscache
|
|
45
|
+
.phpcscache
|
|
29
46
|
**/.prettierignore
|
|
30
47
|
.prettierignore
|
|
48
|
+
**/.stylelintcache
|
|
49
|
+
.stylelintcache
|
|
50
|
+
**/.stylelintrc.js
|
|
51
|
+
.stylelintrc.js
|
|
52
|
+
**/.stylelintrc.json
|
|
53
|
+
.stylelintrc.json
|
|
54
|
+
**/.travis
|
|
55
|
+
**/AGENTS.md
|
|
56
|
+
AGENTS.md
|
|
57
|
+
**/bun.lock
|
|
58
|
+
bun.lock
|
|
59
|
+
**/CHANGELOG
|
|
60
|
+
CHANGELOG
|
|
31
61
|
**/CHANGELOG.md
|
|
32
62
|
CHANGELOG.md
|
|
63
|
+
**/CODE_OF_CONDUCT
|
|
64
|
+
**/CODE_OF_CONDUCT.md
|
|
65
|
+
**/globals.d.ts
|
|
66
|
+
globals.d.ts
|
|
33
67
|
**/LICENSE
|
|
34
68
|
LICENSE
|
|
69
|
+
**/LICENSE.md
|
|
70
|
+
**/phpcs.xml
|
|
71
|
+
phpcs.xml
|
|
72
|
+
**/README
|
|
35
73
|
**/README.md
|
|
36
74
|
README.md
|
|
37
75
|
**/*.md
|
|
38
76
|
*.md
|
|
39
|
-
**/.gitignore
|
|
40
|
-
.gitignore
|
|
41
77
|
**/package.json
|
|
42
78
|
package.json
|
|
43
79
|
**/composer-scoped.json
|
|
@@ -50,11 +86,5 @@ composer.json
|
|
|
50
86
|
composer.lock
|
|
51
87
|
**/package-lock.json
|
|
52
88
|
package-lock.json
|
|
53
|
-
**/phpcs.xml
|
|
54
|
-
phpcs.xml
|
|
55
89
|
**/scoper.custom.php
|
|
56
90
|
scoper.custom.php
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|