@webship.co/workspace-demos 1.0.8 → 1.0.10
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 +18 -1
- package/ai/agents/demos-site-builder.md +108 -0
- package/ai/commands/demos-build.md +56 -0
- package/ai/prompts/demos-build-a-demo.md +28 -0
- package/ai/skills/demos-workflow/SKILL.md +87 -0
- package/commands/cmd-tools-backup-demo.sh +14 -1
- package/dist/src/index.d.ts +6 -1
- package/dist/src/index.js +8 -3
- package/dist/src/index.js.map +1 -1
- package/docs/AGENTS.md +10 -0
- package/features/demos.feature +16 -0
- package/package.json +31 -2
package/README.md
CHANGED
|
@@ -9,13 +9,30 @@ its commands and its docs, as a plugin.
|
|
|
9
9
|
```bash
|
|
10
10
|
cd ~/workspace
|
|
11
11
|
bash core/scripts/plugins.sh --require github:webship/workspace-demos
|
|
12
|
-
bash core/scripts/plugins.sh --activate demos # puts `demos` on the workspaces list of settings.yml
|
|
12
|
+
bash core/scripts/plugins.sh --activate demos --with-needs # puts `demos` on the workspaces list of settings.yml
|
|
13
13
|
bash core/scripts/plugins.sh --install demos # the folder, its settings file (once), its commands, its docs (once)
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
The settings file and the docs are placed once and never overwritten: they hold what you put there.
|
|
17
17
|
`--deactivate` takes the workspace off the list; the folder and its content stay.
|
|
18
18
|
|
|
19
|
+
## What it goes with
|
|
20
|
+
|
|
21
|
+
The AI items land in the four AI folders, so the manifest needs them (`needs`): `ai-agents`, `ai-skills`, `ai-commands`, `ai-prompts`. `--activate demos` and `--install demos` stop while one is missing and name it; with `--with-needs` they are required, activated and installed first. One of its commands, `cmd-tools-update-all.sh`, still runs `composer` on the machine instead of in a project's container, so the manifest names it as a command a part of the plugin uses (`suggests.commands`): `bash core/scripts/plugins.sh --check demos` says whether it is there (https://getcomposer.org/download/), and nothing is installed for you. Everything else here runs through the container tool the workspace already needs.
|
|
22
|
+
|
|
23
|
+
## The AI items
|
|
24
|
+
|
|
25
|
+
The plugin carries its own AI items (`ai/` in the package, the manifest's `ai` block), written for the work this folder is for. `--install` places each one in the workspace folder of its kind, when that folder is an active workspace folder; `--uninstall` removes them, and keeps one that was edited in its folder.
|
|
26
|
+
|
|
27
|
+
| Item | Kind | Lands in | What it is for |
|
|
28
|
+
| --- | --- | --- | --- |
|
|
29
|
+
| `demos-site-builder` | Agent | `ai-agents/demos-site-builder.md` | Builds a demo site in `demos/` and gets it ready to be shown: installed, default accounts, an address, a check with Webship-js, a backup |
|
|
30
|
+
| `demos-workflow` | Skill | `ai-skills/demos-workflow/` | How work is done in `demos/`: build, address, check, back up; every builder and tool with its flags, the settings keys |
|
|
31
|
+
| `/demos-build` | Command | `ai-commands/demos-build.md` | `/demos-build <builder> <name>`: builds the demo installed and with its accounts, says where it answers and backs it up |
|
|
32
|
+
| `demos-build-a-demo` | Prompt | `ai-prompts/demos-build-a-demo.md` | A new session that builds a demo, checks it with Webship-js and backs it up before it is shown |
|
|
33
|
+
|
|
34
|
+
From its folder an item is installed into the AI CLI (Claude Code by default) like any other: the folder's page on the dashboard, or `bash cmd-tools-ai-items.sh <name> --install` in the AI folder (`--to dev/<project>` for one project). A prompt is not installed: the New screen form lists it as the start of a new session. The body of every item is plain Markdown any AI CLI can follow; Claude Code is the default shape (the frontmatter, the launch line of a prompt). Every command, flag, settings key and path an item names is checked by `tests/items.test.ts`; the shape of the items is the one of the reference, [`docs/plugin-items-pattern.md` of the WordPress plugin](https://github.com/webship/workspace-wordpress/blob/1.0.x/docs/plugin-items-pattern.md).
|
|
35
|
+
|
|
19
36
|
## The commands
|
|
20
37
|
|
|
21
38
|
| Command |
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: demos-site-builder
|
|
3
|
+
description: Use this agent to build a demo site in the `demos/` folder of the Webship Workspace, get it ready to be shown (installed, default accounts, an extra address, a backup) and check it with Webship-js, with the `cmd-*.sh` commands the Demos folder ships (the Drupal, Drupal CMS, Webship, Webships and Cucumber builders, `cmd-tools-hostnames.sh`, `cmd-tools-backup-demo.sh`, `cmd-tools-testing.sh`, `cmd-tools-clone.sh`). It works in containers only and never on the host. Invoke for "build a demo", "spin up a Webship demo", "give the demo another address", "back up the demo before the meeting", or "remove the demo".
|
|
4
|
+
model: fable
|
|
5
|
+
tools:
|
|
6
|
+
- Bash
|
|
7
|
+
- Read
|
|
8
|
+
- Write
|
|
9
|
+
- Edit
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# demos-site-builder
|
|
15
|
+
|
|
16
|
+
You build and look after the sites of `~/workspace/demos`, the Demos folder of a Webship Workspace:
|
|
17
|
+
a container-based workspace (DDEV by default). Demos are demo sites and default content, built to be shown: a demo is installed, has its accounts, answers at an address that can be given out, and is backed up before it is shown. Everything goes through the `cmd-*.sh`
|
|
18
|
+
commands of the folder, which come with the Demos plugin (`@webship.co/workspace-demos`). Run them from the folder:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
cd ~/workspace/demos
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Read a command before quoting a flag: `bash <command> --help` is always safe.
|
|
25
|
+
|
|
26
|
+
## Build a site
|
|
27
|
+
|
|
28
|
+
A builder is a `cmd-*-project.sh`; its first argument is the name of the site, which becomes its
|
|
29
|
+
folder, its container project and its address (`https://<name>.ddev.site`): short, lowercase,
|
|
30
|
+
letters and digits. **A builder deletes a project of the same name first**, so never point it at a
|
|
31
|
+
site somebody still needs.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
bash cmd-webship11-0-x-project.sh mysite --install --add-users
|
|
35
|
+
bash cmd-drupalcms2-x-project.sh mysite --install --add-users
|
|
36
|
+
bash cmd-drupal11-recommended-project.sh mysite --install --add-users --profile umami
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
| Builder | Builds | Flags |
|
|
40
|
+
| --- | --- | --- |
|
|
41
|
+
| `cmd-cucumber11-0-x-project.sh` | Cucumber 11.0.x | `--add-users` `--enable` `--install` `--php-version` `--require` `--skip-drop-database` `--skip-set-default-settings` |
|
|
42
|
+
| `cmd-drupal10-3-x-recommended-project.sh` | Drupal 10.3.x (recommended project) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
43
|
+
| `cmd-drupal10-recommended-project.sh` | Drupal 10 (recommended project) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
44
|
+
| `cmd-drupal11-0-x-recommended-project.sh` | Drupal 11.0.x (recommended project) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
45
|
+
| `cmd-drupal11-4-0-recommended-project.sh` | Drupal 11.4.0 (recommended project) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
46
|
+
| `cmd-drupal11-4-x-recommended-project.sh` | Drupal 11.4.x (recommended project) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
47
|
+
| `cmd-drupal11-recommended-project.sh` | Drupal 11 (latest) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
48
|
+
| `cmd-drupal12-recommended-project.sh` | Drupal 12 (latest) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
49
|
+
| `cmd-drupalcms2-1-0-project.sh` | Drupal CMS 2.1.0 | `--add-users` `--install` `--php-version` |
|
|
50
|
+
| `cmd-drupalcms2-x-project.sh` | Drupal CMS 2.x | `--add-users` `--install` `--php-version` |
|
|
51
|
+
| `cmd-webship11-0-0-project.sh` | Webship 11.0.0 | `--add-users` `--enable` `--install` `--php-version` `--require` `--skip-drop-database` `--skip-set-default-settings` |
|
|
52
|
+
| `cmd-webship11-0-x-project.sh` | Webship 11.0.x | `--add-users` `--enable` `--install` `--php-version` `--require` `--skip-drop-database` `--skip-set-default-settings` |
|
|
53
|
+
| `cmd-webships2-0-0-project.sh` | Webships 2.0.0 | `--add-users` `--enable` `--install` `--php-version` `--require` `--skip-drop-database` `--skip-set-default-settings` |
|
|
54
|
+
| `cmd-webships2-0-x-project.sh` | Webships 2.0.x | `--add-users` `--enable` `--install` `--php-version` `--require` `--skip-drop-database` `--skip-set-default-settings` |
|
|
55
|
+
| `cmd-webships3-0-x-project.sh` | Webships 3.0.x | `--add-users` `--php-version` `--template` |
|
|
56
|
+
|
|
57
|
+
Without `--install` the code is there and the installer waits at the site's address. The
|
|
58
|
+
administrator of an installed site is the workspace account (`account.name` in
|
|
59
|
+
`core/config/settings.yml`); `--add-users` adds the default accounts of the distribution.
|
|
60
|
+
|
|
61
|
+
## Test it with Webship-js
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
bash cmd-tools-testing.sh mysite # set the testing stack up (safe to run again)
|
|
65
|
+
bash cmd-tools-testing.sh mysite --dry-run # match every step, no browser
|
|
66
|
+
bash cmd-tools-testing.sh mysite --run # the whole suite
|
|
67
|
+
bash cmd-tools-testing.sh mysite --run --path tests/features/check-homepage.feature # one feature
|
|
68
|
+
bash cmd-tools-testing.sh mysite --run --tags "@critical" # one tag
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The suite runs in the site's container; the report lands in `mysite/tests/reports/`.
|
|
72
|
+
|
|
73
|
+
## Work on a site
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
bash cmd-tools-hostnames.sh # every site of the folder and the addresses it answers at
|
|
77
|
+
bash cmd-tools-hostnames.sh mysite --add staging --start # one more address
|
|
78
|
+
bash cmd-tools-add-users.sh mysite drupal # the default accounts of a distribution
|
|
79
|
+
bash cmd-tools-cancel-users.sh mysite drupal # and away again
|
|
80
|
+
bash cmd-tools-checks.sh mysite --list # the code-quality checks it declares, and what each would run
|
|
81
|
+
bash cmd-tools-clone.sh mysite --to mysite2 # folder and database under a new name
|
|
82
|
+
bash cmd-tools-backup-demo.sh mysite # the folder and the database, into backups/demos/
|
|
83
|
+
bash cmd-tools-remove.sh mysite # containers, volumes and folder together
|
|
84
|
+
bash cmd-tools-remove.sh --orphans # container projects whose folder is gone: a report
|
|
85
|
+
bash cmd-tools-reclaim.sh # what could be freed: a dry run unless --apply
|
|
86
|
+
bash cmd-tools-screen.sh --list # the sessions that are running
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Rules
|
|
90
|
+
|
|
91
|
+
- **A demo is kept.** Back it up before a change (`bash cmd-tools-backup-demo.sh <name>`), and
|
|
92
|
+
remove it only when asked. Never print the password of an account when you report.
|
|
93
|
+
- **Check a demo before it is shown**: the front page answers, and its Webship-js suite passes.
|
|
94
|
+
- `cmd-tools-update-all.sh` runs `composer update` on the host in every site: do not run it; use
|
|
95
|
+
`ddev composer update` in one site.
|
|
96
|
+
- **Containers only.** Never `composer`, `drush`, `php`, `npm` or `mysql` on the host for a site. In
|
|
97
|
+
the site's folder the container tool does it: `ddev composer …`, `ddev drush …`,
|
|
98
|
+
`ddev export-db --file=…`, `ddev start -y`, `ddev stop` (`stop` takes no `-y`).
|
|
99
|
+
- **Never write database settings** into `settings.php`: the container tool's own settings file
|
|
100
|
+
owns the connection.
|
|
101
|
+
- **One build at a time**, and look at `df -h` and `free -g` first on a busy machine.
|
|
102
|
+
- **Never restart the dashboard** or anything shared to make your own work go through.
|
|
103
|
+
- Say what you ran and what it printed. If a command fails, show the line that failed; do not
|
|
104
|
+
retry with other flags until something passes.
|
|
105
|
+
|
|
106
|
+
## What comes with you
|
|
107
|
+
|
|
108
|
+
The Demos plugin places these beside this one, each in the workspace folder of its kind: the skill `demos-workflow` (`ai-skills/`), the command `/demos-build` (`ai-commands/`) and the prompt `demos-build-a-demo` (`ai-prompts/`).
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Build a demo site in the demos/ folder of the Webship Workspace with one of the folder's builders, installed and with its default accounts, say where it answers, and back it up.
|
|
3
|
+
argument-hint: '<builder or family> <name> [flags of the builder]'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /demos-build
|
|
7
|
+
|
|
8
|
+
Build a demo in `~/workspace/demos` from: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
The arguments are the text typed after the command: the first word names the builder, the second
|
|
11
|
+
the demo, and what follows is passed to the builder as it is. With no name, stop and ask for one.
|
|
12
|
+
The workspace is container-based (DDEV by default): the builder runs the site in its own
|
|
13
|
+
container, and nothing is run on the host for it.
|
|
14
|
+
|
|
15
|
+
## 1. Find the builder
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
cd ~/workspace/demos
|
|
19
|
+
grep -H "^# workspace-name:" cmd-*-project.sh
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The first word is a builder's file name, or enough of it to pick one: `webship` is
|
|
23
|
+
`cmd-webship11-0-x-project.sh`, `drupalcms` is `cmd-drupalcms2-x-project.sh`, `drupal11` is
|
|
24
|
+
`cmd-drupal11-recommended-project.sh`. When it fits more than one, list them and ask.
|
|
25
|
+
|
|
26
|
+
## 2. Make sure the name is free
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
ls -d ~/workspace/*/<name> 2>/dev/null
|
|
30
|
+
ddev list | grep -w <name>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
A builder deletes a project of the same name first. If the name is taken, stop and ask.
|
|
34
|
+
|
|
35
|
+
## 3. Build, installed and with its accounts
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
bash cmd-webship11-0-x-project.sh --help
|
|
39
|
+
bash cmd-webship11-0-x-project.sh <name> --install --add-users
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
With the builder that was picked and the flags that were typed; a demo is always built with
|
|
43
|
+
`--install`, and with `--add-users` where the builder has it. Run it once. If it fails, show the
|
|
44
|
+
line that failed and stop.
|
|
45
|
+
|
|
46
|
+
## 4. Say where it answers, and back it up
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
bash cmd-tools-hostnames.sh <name>
|
|
50
|
+
bash cmd-tools-backup-demo.sh <name>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Report the builder, the address (`https://<name>.ddev.site`), that the default accounts are there
|
|
54
|
+
(never print a password), and where the backup is (`backups/demos/`). For an extra address or a
|
|
55
|
+
check with Webship-js, hand over to the `demos-site-builder` agent; the `demos-workflow` skill
|
|
56
|
+
lists every command of the folder.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Build a demo site in the demos folder, get it ready to be shown and back it up.
|
|
2
|
+
|
|
3
|
+
The launch line is for Claude Code, the default; the text between the triple quotes can be given to another AI CLI as it is.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
claude --permission-mode bypassPermissions """
|
|
7
|
+
Build a demo named <name> in the demos folder with <builder> and get it ready to be shown
|
|
8
|
+
# ~/workspace/demos · https://<name>.ddev.site · container-based (DDEV by default)
|
|
9
|
+
# <builder> is a cmd-*-project.sh of the folder, for example cmd-webship11-0-x-project.sh
|
|
10
|
+
# the builder deletes a project of the same name first: stop if <name> is a site somebody still needs
|
|
11
|
+
# nothing on the host: no composer, drush, npm or mysql outside the site's container
|
|
12
|
+
|
|
13
|
+
1. bash <builder> --help
|
|
14
|
+
tell me the flags it takes
|
|
15
|
+
2. bash <builder> <name> --install --add-users
|
|
16
|
+
3. bash cmd-tools-hostnames.sh <name>
|
|
17
|
+
tell me the address the demo answers at
|
|
18
|
+
4. bash cmd-tools-testing.sh <name>
|
|
19
|
+
bash cmd-tools-testing.sh <name> --run
|
|
20
|
+
the demo is checked with Webship-js before it is shown
|
|
21
|
+
5. bash cmd-tools-backup-demo.sh <name>
|
|
22
|
+
the folder and the database, into backups/demos/
|
|
23
|
+
|
|
24
|
+
If a command fails, show the line that failed and stop. Do not retry with other flags.
|
|
25
|
+
Report the address, the result of the run and where the backup is. Never print a password.
|
|
26
|
+
The demo stays: remove it only when I ask, with: bash cmd-tools-remove.sh <name>
|
|
27
|
+
"""
|
|
28
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: demos-workflow
|
|
3
|
+
description: How work is done in the `demos/` folder of the Webship Workspace — which `cmd-*.sh` builds a demo site, the flags of each command, how a demo gets its accounts and an address to give out, how it is checked with Webship-js and backed up before it is shown, and the settings keys of the folder. Use when asked to "build a demo", "which builder is there for a Webship demo", "add an address to the demo", "back up the demo", or when a command of `demos/` is about to be run.
|
|
4
|
+
argument-hint: '[what you are about to do in demos]'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# demos-workflow
|
|
8
|
+
|
|
9
|
+
`~/workspace/demos` is the Demos folder of a Webship Workspace (container-based, DDEV by default).
|
|
10
|
+
Demos are demo sites and default content, built to be shown: a demo is installed, has its accounts, answers at an address that can be given out, and is backed up before it is shown. It comes with the Demos plugin (`@webship.co/workspace-demos`), which places the commands below in the
|
|
11
|
+
folder. Every command finds the workspace from its own path; run it from the folder, and read
|
|
12
|
+
`bash <command> --help` before quoting a flag.
|
|
13
|
+
|
|
14
|
+
## The order of work
|
|
15
|
+
|
|
16
|
+
1. **Build** the demo, installed and with its accounts:
|
|
17
|
+
`bash cmd-webship11-0-x-project.sh mysite --install --add-users`. The name is the folder, the
|
|
18
|
+
container project and the address (`https://mysite.ddev.site`). A builder deletes a project of
|
|
19
|
+
the same name first.
|
|
20
|
+
2. **Give it the address it is shown at**, when the name is not it:
|
|
21
|
+
`bash cmd-tools-hostnames.sh mysite --add staging --start`.
|
|
22
|
+
3. **Check it** before it is shown: `bash cmd-tools-testing.sh mysite`, then
|
|
23
|
+
`bash cmd-tools-testing.sh mysite --run`.
|
|
24
|
+
4. **Back it up** before the showing and before any change: `bash cmd-tools-backup-demo.sh mysite`
|
|
25
|
+
(the folder and the database, into `backups/demos/`).
|
|
26
|
+
5. **Remove** it only when asked: `bash cmd-tools-remove.sh mysite`.
|
|
27
|
+
|
|
28
|
+
## Builders
|
|
29
|
+
|
|
30
|
+
| Builder | Builds | Flags |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
| `cmd-cucumber11-0-x-project.sh` | Cucumber 11.0.x | `--add-users` `--enable` `--install` `--php-version` `--require` `--skip-drop-database` `--skip-set-default-settings` |
|
|
33
|
+
| `cmd-drupal10-3-x-recommended-project.sh` | Drupal 10.3.x (recommended project) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
34
|
+
| `cmd-drupal10-recommended-project.sh` | Drupal 10 (recommended project) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
35
|
+
| `cmd-drupal11-0-x-recommended-project.sh` | Drupal 11.0.x (recommended project) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
36
|
+
| `cmd-drupal11-4-0-recommended-project.sh` | Drupal 11.4.0 (recommended project) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
37
|
+
| `cmd-drupal11-4-x-recommended-project.sh` | Drupal 11.4.x (recommended project) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
38
|
+
| `cmd-drupal11-recommended-project.sh` | Drupal 11 (latest) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
39
|
+
| `cmd-drupal12-recommended-project.sh` | Drupal 12 (latest) | `--add-users` `--dev` `--enable` `--install` `--launch` `--php-version` `--profile` `--require` |
|
|
40
|
+
| `cmd-drupalcms2-1-0-project.sh` | Drupal CMS 2.1.0 | `--add-users` `--install` `--php-version` |
|
|
41
|
+
| `cmd-drupalcms2-x-project.sh` | Drupal CMS 2.x | `--add-users` `--install` `--php-version` |
|
|
42
|
+
| `cmd-webship11-0-0-project.sh` | Webship 11.0.0 | `--add-users` `--enable` `--install` `--php-version` `--require` `--skip-drop-database` `--skip-set-default-settings` |
|
|
43
|
+
| `cmd-webship11-0-x-project.sh` | Webship 11.0.x | `--add-users` `--enable` `--install` `--php-version` `--require` `--skip-drop-database` `--skip-set-default-settings` |
|
|
44
|
+
| `cmd-webships2-0-0-project.sh` | Webships 2.0.0 | `--add-users` `--enable` `--install` `--php-version` `--require` `--skip-drop-database` `--skip-set-default-settings` |
|
|
45
|
+
| `cmd-webships2-0-x-project.sh` | Webships 2.0.x | `--add-users` `--enable` `--install` `--php-version` `--require` `--skip-drop-database` `--skip-set-default-settings` |
|
|
46
|
+
| `cmd-webships3-0-x-project.sh` | Webships 3.0.x | `--add-users` `--php-version` `--template` |
|
|
47
|
+
|
|
48
|
+
`--install` installs the site (without it the installer waits at the address); `--add-users` adds
|
|
49
|
+
the default accounts of the distribution. A builder deletes a project of the same name first.
|
|
50
|
+
|
|
51
|
+
## Tools
|
|
52
|
+
|
|
53
|
+
| Command | What it does | Flags |
|
|
54
|
+
| --- | --- | --- |
|
|
55
|
+
| `cmd-tools-add-users.sh` | Adds the default accounts of a distribution to a site: `<site> <distribution>` | none |
|
|
56
|
+
| `cmd-tools-backup-demo.sh` | An item as an archive and its database as a dump, into `backups/demos/` | none |
|
|
57
|
+
| `cmd-tools-cancel-users.sh` | Removes those accounts again: `<site> <distribution>` | none |
|
|
58
|
+
| `cmd-tools-checks.sh` | Runs the code-quality checks an item's `package.json` declares; `--list` prints the plan and runs nothing | `--browser` `--e2e` `--fail-fast` `--install` `--list` `--only` `--runner` `--skip` |
|
|
59
|
+
| `cmd-tools-clone.sh` | Folder and database under a new name, here or in another folder | `--branch` `--extra-hostname` `--no-build-copy` `--no-db` `--target-workspace` `--to` `--with-workspace-hostname` `--worktree` |
|
|
60
|
+
| `cmd-tools-git-change-filemode-to-false.sh` | Sets `core.fileMode` to false in the git checkout of every item of the folder | none |
|
|
61
|
+
| `cmd-tools-hostnames.sh` | The addresses a site answers at, and one more | `--add` `--remove` `--start` `--with-workspace` |
|
|
62
|
+
| `cmd-tools-reclaim.sh` | Disk held by projects whose folder is gone: a dry run unless `--apply` | `--apply` `--keep-days` `--list-protected` `--only` |
|
|
63
|
+
| `cmd-tools-remove.sh` | Containers, volumes and folder together; refuses work that is on no remote unless `--force` | `--backup` `--force` `--orphans` |
|
|
64
|
+
| `cmd-tools-screen.sh` | A detached session with a log the dashboard follows | `--follow` `--list` `--log` `--run` `--stop` |
|
|
65
|
+
| `cmd-tools-testing.sh` | Sets the Webship-js testing stack up on a site, or runs its suite in the site's container | `--browser` `--configure` `--dry-run` `--headed` `--path` `--retry` `--run` `--tags` |
|
|
66
|
+
| `cmd-tools-update-all.sh` | `composer update` in every site, **on the host**: not yet moved into the containers. Do not run it unasked; use `ddev composer update` in one site | none |
|
|
67
|
+
|
|
68
|
+
## Settings
|
|
69
|
+
|
|
70
|
+
| Key | File | What it says |
|
|
71
|
+
| --- | --- | --- |
|
|
72
|
+
| `doc.name` | `core/config/workspace.demos.settings.yml` | The folder under the workspace root: `demos` |
|
|
73
|
+
| `type` | `core/config/workspace.demos.settings.yml` | `sites`: the rows of the page are built sites, with the Build, Tests, Checks, Users, Backup and Remove actions |
|
|
74
|
+
| `composer` | `core/config/workspace.demos.settings.yml` | `full`: the COMPOSER menu may install and update here, in the site's container |
|
|
75
|
+
| `assistant.name`, `assistant.placeholder` | `core/config/workspace.demos.settings.yml` | What the assistant is called on this page; `default` takes the workspace's |
|
|
76
|
+
| `workspaces` | `core/config/settings.yml` | The active folders; `demos` is on it once the plugin is activated |
|
|
77
|
+
| `account.name`, `account.mail` | `core/config/settings.yml` | The workspace account: the administrator of every site a builder installs |
|
|
78
|
+
|
|
79
|
+
## Rules
|
|
80
|
+
|
|
81
|
+
- Containers only: never `composer`, `drush`, `php`, `npm` or `mysql` on the host for a site. In the
|
|
82
|
+
site's folder: `ddev composer …`, `ddev drush …`, `ddev export-db --file=…`, `ddev start -y`,
|
|
83
|
+
`ddev stop` (no `-y`).
|
|
84
|
+
- Never write database settings into `settings.php`.
|
|
85
|
+
- A demo is kept while it is shown: back it up with `bash cmd-tools-backup-demo.sh mysite` before a change, and remove it only when asked.
|
|
86
|
+
|
|
87
|
+
The Demos plugin places these beside this one, each in the workspace folder of its kind: the agent `demos-site-builder` (`ai-agents/`), the command `/demos-build` (`ai-commands/`) and the prompt `demos-build-a-demo` (`ai-prompts/`).
|
|
@@ -18,4 +18,17 @@ shift $#;
|
|
|
18
18
|
trim_project_name ; # "v11x00b1/" -> "v11x00b1" — see functions/fun-project-name.sh
|
|
19
19
|
|
|
20
20
|
backup_workspace_item "${PROJECT_NAME}" || exit 1 ;
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
# The database goes beside the archive. A project that runs without one (an Astro or Gatsby site:
|
|
23
|
+
# omit_containers: [db]) has only its files to back up; ddev export-db would fail on it and leave
|
|
24
|
+
# an empty dump behind, which a restore then tries to import.
|
|
25
|
+
dump="${backups}/${doc_name}/${doc_name}---${PROJECT_NAME}--${BACKUP_TIME}-db.sql.gz" ;
|
|
26
|
+
if grep -qsE '^omit_containers:.*\bdb\b' ${PROJECT_NAME}/.ddev/config.yaml ${PROJECT_NAME}/.ddev/config.*.yaml ; then
|
|
27
|
+
echo "${PROJECT_NAME} runs without a database: its files are backed up, and there is no database to export." ;
|
|
28
|
+
exit 0 ;
|
|
29
|
+
fi
|
|
30
|
+
if ! (cd ${PROJECT_NAME} && ddev export-db --file="${dump}") ; then
|
|
31
|
+
[ -s "${dump}" ] || rm -f "${dump}" ;
|
|
32
|
+
echo "The database of ${PROJECT_NAME} could not be exported: only its files are backed up." ;
|
|
33
|
+
exit 1 ;
|
|
34
|
+
fi
|
package/dist/src/index.d.ts
CHANGED
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
* The Demos workspace for Webship Workspace: the `demos/` folder as a plugin.
|
|
3
3
|
*
|
|
4
4
|
* What the package carries is placed by the installer from the manifest (the folder's settings file,
|
|
5
|
-
* its commands and its
|
|
5
|
+
* its commands, its docs and its AI items, each in the folder of its kind) and listed by --activate; the dashboard draws the workspace from the
|
|
6
6
|
* settings file like any other. Nothing to register at run time yet: this is where the folder's own
|
|
7
7
|
* rail buttons, row menus or assistant context would go.
|
|
8
8
|
*/
|
|
9
9
|
import type { PluginApi } from '@webship.co/workspace-plugin-api';
|
|
10
10
|
export declare const WORKSPACE_KEY = "demos";
|
|
11
|
+
/** The AI items the installer places, each in the workspace folder of its kind (ai/ in this package). */
|
|
12
|
+
export declare const AGENTS: string[];
|
|
13
|
+
export declare const SKILLS: string[];
|
|
14
|
+
export declare const AI_COMMANDS: string[];
|
|
15
|
+
export declare const PROMPTS: string[];
|
|
11
16
|
export declare function register(api: PluginApi): void;
|
package/dist/src/index.js
CHANGED
|
@@ -3,15 +3,20 @@
|
|
|
3
3
|
* The Demos workspace for Webship Workspace: the `demos/` folder as a plugin.
|
|
4
4
|
*
|
|
5
5
|
* What the package carries is placed by the installer from the manifest (the folder's settings file,
|
|
6
|
-
* its commands and its
|
|
6
|
+
* its commands, its docs and its AI items, each in the folder of its kind) and listed by --activate; the dashboard draws the workspace from the
|
|
7
7
|
* settings file like any other. Nothing to register at run time yet: this is where the folder's own
|
|
8
8
|
* rail buttons, row menus or assistant context would go.
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.WORKSPACE_KEY = void 0;
|
|
11
|
+
exports.PROMPTS = exports.AI_COMMANDS = exports.SKILLS = exports.AGENTS = exports.WORKSPACE_KEY = void 0;
|
|
12
12
|
exports.register = register;
|
|
13
13
|
exports.WORKSPACE_KEY = 'demos';
|
|
14
|
+
/** The AI items the installer places, each in the workspace folder of its kind (ai/ in this package). */
|
|
15
|
+
exports.AGENTS = ['demos-site-builder'];
|
|
16
|
+
exports.SKILLS = ['demos-workflow'];
|
|
17
|
+
exports.AI_COMMANDS = ['demos-build'];
|
|
18
|
+
exports.PROMPTS = ['demos-build-a-demo'];
|
|
14
19
|
function register(api) {
|
|
15
|
-
api.addAssistantContext(() => `The demos/ workspace is the Demos workspace (a plugin, @webship.co/workspace-demos); its commands are the cmd-*.sh scripts in that folder.`);
|
|
20
|
+
api.addAssistantContext(() => `The demos/ workspace is the Demos workspace (a plugin, @webship.co/workspace-demos); its commands are the cmd-*.sh scripts in that folder. It comes with AI items for work in this folder: the agent \`demos-site-builder\` (ai-agents/), the skill \`demos-workflow\` (ai-skills/), the command \`/demos-build\` (ai-commands/) and the prompt \`demos-build-a-demo\` (ai-prompts/).`);
|
|
16
21
|
}
|
|
17
22
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAYH,4BAEC;AAVY,QAAA,aAAa,GAAG,OAAO,CAAC;AAErC,yGAAyG;AAC5F,QAAA,MAAM,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAChC,QAAA,MAAM,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAC5B,QAAA,WAAW,GAAG,CAAC,aAAa,CAAC,CAAC;AAC9B,QAAA,OAAO,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAE9C,SAAgB,QAAQ,CAAC,GAAc;IACrC,GAAG,CAAC,mBAAmB,CAAC,GAAG,EAAE,CAAC,uXAAuX,CAAC,CAAC;AACzZ,CAAC"}
|
package/docs/AGENTS.md
CHANGED
|
@@ -49,3 +49,13 @@ bash cmd-webships2-0-x-project.sh # Webships 2.0.x
|
|
|
49
49
|
|
|
50
50
|
Every one locates the workspace from its own path, so there is nothing to export and nothing to
|
|
51
51
|
install. `--help` on any of them lists its arguments.
|
|
52
|
+
|
|
53
|
+
## AI items for this folder
|
|
54
|
+
|
|
55
|
+
The plugin of this folder (`@webship.co/workspace-demos`) places its own AI items in the AI folders of the
|
|
56
|
+
workspace, when they are active:
|
|
57
|
+
|
|
58
|
+
- `demos-site-builder` (`ai-agents/`): Builds a demo site in `demos/` and gets it ready to be shown: installed, default accounts, an address, a check with Webship-js, a backup
|
|
59
|
+
- `demos-workflow` (`ai-skills/`): How work is done in `demos/`: build, address, check, back up; every builder and tool with its flags, the settings keys
|
|
60
|
+
- `/demos-build` (`ai-commands/`): `/demos-build <builder> <name>`: builds the demo installed and with its accounts, says where it answers and backs it up
|
|
61
|
+
- `demos-build-a-demo` (`ai-prompts/`): A new session that builds a demo, checks it with Webship-js and backs it up before it is shown
|
package/features/demos.feature
CHANGED
|
@@ -11,3 +11,19 @@ Feature: The Demos workspace plugin
|
|
|
11
11
|
Given I am on "/settings/plugins"
|
|
12
12
|
Then I should see "Demos"
|
|
13
13
|
And I should see "@webship.co/workspace-demos"
|
|
14
|
+
|
|
15
|
+
Scenario: The AI Agents folder lists the agent the plugin ships
|
|
16
|
+
Given I am on "/ai-agents"
|
|
17
|
+
Then I should see "demos-site-builder"
|
|
18
|
+
|
|
19
|
+
Scenario: The AI Skills folder lists the skill the plugin ships
|
|
20
|
+
Given I am on "/ai-skills"
|
|
21
|
+
Then I should see "demos-workflow"
|
|
22
|
+
|
|
23
|
+
Scenario: The AI Commands folder lists the command the plugin ships
|
|
24
|
+
Given I am on "/ai-commands"
|
|
25
|
+
Then I should see "demos-build"
|
|
26
|
+
|
|
27
|
+
Scenario: The AI Prompts folder lists the prompt the plugin ships
|
|
28
|
+
Given I am on "/ai-prompts"
|
|
29
|
+
Then I should see "demos-build-a-demo"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webship.co/workspace-demos",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "The Demos workspace for Webship Workspace: the `demos/` folder (type sites), its settings file, its 27 commands and its
|
|
3
|
+
"version": "1.0.10",
|
|
4
|
+
"description": "The Demos workspace for Webship Workspace: the `demos/` folder (type sites), its settings file, its 27 commands, its docs and its AI items (an agent, a skill, a command and a prompt, each in the folder of its kind), activated as a plugin.",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
7
7
|
"license": "ISC",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"dist/src",
|
|
14
|
+
"ai",
|
|
14
15
|
"commands",
|
|
15
16
|
"config",
|
|
16
17
|
"docs",
|
|
@@ -26,6 +27,20 @@
|
|
|
26
27
|
"workspacePlugin": {
|
|
27
28
|
"name": "demos",
|
|
28
29
|
"label": "Demos",
|
|
30
|
+
"needs": [
|
|
31
|
+
"ai-agents",
|
|
32
|
+
"ai-skills",
|
|
33
|
+
"ai-commands",
|
|
34
|
+
"ai-prompts"
|
|
35
|
+
],
|
|
36
|
+
"suggests": {
|
|
37
|
+
"commands": [
|
|
38
|
+
{
|
|
39
|
+
"command": "composer",
|
|
40
|
+
"hint": "https://getcomposer.org/download/"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
29
44
|
"workspace": {
|
|
30
45
|
"key": "demos",
|
|
31
46
|
"settingsTemplate": "config/workspace.demos.settings.yml",
|
|
@@ -64,6 +79,20 @@
|
|
|
64
79
|
"docs/README.md"
|
|
65
80
|
]
|
|
66
81
|
},
|
|
82
|
+
"ai": {
|
|
83
|
+
"agents": [
|
|
84
|
+
"ai/agents/demos-site-builder.md"
|
|
85
|
+
],
|
|
86
|
+
"skills": [
|
|
87
|
+
"ai/skills/demos-workflow"
|
|
88
|
+
],
|
|
89
|
+
"commands": [
|
|
90
|
+
"ai/commands/demos-build.md"
|
|
91
|
+
],
|
|
92
|
+
"prompts": [
|
|
93
|
+
"ai/prompts/demos-build-a-demo.md"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
67
96
|
"features": [
|
|
68
97
|
"features/demos.feature"
|
|
69
98
|
]
|