@webship.co/workspace-drupal-recipes 0.0.0-stage → 1.0.0-alpha1

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 CHANGED
@@ -1,3 +1,32 @@
1
- # Temporary Holding Version
1
+ # @webship.co/workspace-drupal-recipes
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The **Drupal recipes** workspace of the [Webship Workspace](https://github.com/webship/workspace) dashboard:
4
+ the `recipes/` folder (type `code`), its settings file (`core/config/workspace.recipes.settings.yml`),
5
+ its commands and its docs, as a plugin.
6
+
7
+ ## Use it
8
+
9
+ ```bash
10
+ cd ~/workspace
11
+ bash core/scripts/plugins.sh --require github:webship/workspace-drupal-recipes
12
+ bash core/scripts/plugins.sh --activate drupal-recipes # puts `recipes` on the workspaces list of settings.yml
13
+ bash core/scripts/plugins.sh --install drupal-recipes # the folder, its settings file (once), its commands, its docs (once)
14
+ ```
15
+
16
+ The settings file and the docs are placed once and never overwritten: they hold what you put there.
17
+ `--deactivate` takes the workspace off the list; the folder and its content stay.
18
+
19
+ ## The commands
20
+
21
+ | Command |
22
+ | --- |
23
+ | `cmd-tool-backup-recipe.sh` |
24
+ | `cmd-tool-git-change-filemode-to-false.sh` |
25
+ | `cmd-tools-checks.sh` |
26
+ | `cmd-tools-gitlab-ci-local.sh` |
27
+ | `cmd-tools-graphify.sh` |
28
+ | `cmd-tools-obsidian.sh` |
29
+ | `cmd-tools-ragify.sh` |
30
+ | `cmd-tools-reclaim.sh` |
31
+
32
+ The bash functions these commands call live in the dashboard's `core/scripts/functions`.
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Bootstrap.
4
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
5
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
6
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
7
+
8
+ # Load workspace settings and extra lists.
9
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.recipes.settings.yml);
10
+
11
+ ARGPARSE_DESCRIPTION="Backup a recipe"
12
+ argparse "$@" <<ARGEOF || exit 1
13
+ parser.add_argument('PROJECT_NAME',
14
+ help='The name of the project.')
15
+ ARGEOF
16
+
17
+ shift $#;
18
+ trim_project_name ; # "v11x00b1/" -> "v11x00b1" — see functions/fun-project-name.sh
19
+
20
+ backup_workspace_item "${PROJECT_NAME}" || exit 1 ;
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Bootstrap.
4
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
5
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
6
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
7
+
8
+ # Load workspace settings and extra lists.
9
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.recipes.settings.yml);
10
+
11
+ ARGPARSE_DESCRIPTION="Change a project's git core.fileMode to false"
12
+ argparse "$@" <<ARGEOF || exit 1
13
+ parser.add_argument('PROJECT_NAME',
14
+ help='The name of the project.')
15
+ ARGEOF
16
+
17
+ shift $#;
18
+
19
+ cd ${WORKSPACE_ROOT}/recipes/${PROJECT_NAME} ;
20
+ git config core.fileMode false ;
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Run the code-quality checks a package in this workspace already declares in its package.json —
4
+ # lint:js, lint:css, lint:yaml, spellcheck, phpcs, and the browser suite — mapped onto one set of
5
+ # canonical names so the command means the same thing in every workspace.
6
+
7
+ # Bootstrap.
8
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
9
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
10
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
11
+
12
+ # Load workspace settings and extra lists.
13
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.recipes.settings.yml);
14
+
15
+ ARGPARSE_DESCRIPTION="Run the code-quality checks a recipes item already declares"
16
+ source ${WORKSPACE_SCRIPTS}/args/arg-checks.sh || exit 1 ;
17
+
18
+ shift $#;
19
+
20
+ checks_command ;
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Run a project's GitLab CI pipeline locally with gitlab-ci-local — the Webship
4
+ # green-gate before any push to git.drupalcode.org. Wires the
5
+ # drupal/gitlab_templates remote variables through the drupal-ci-local wrapper
6
+ # (installed on first run), checks Docker and SSH, and reports GREEN/RED.
7
+
8
+ # Bootstrap.
9
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
10
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
11
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
12
+
13
+ # Load workspace settings and extra lists.
14
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.recipes.settings.yml);
15
+
16
+ ARGPARSE_DESCRIPTION="Run a recipes project's GitLab CI pipeline locally (the green-gate)"
17
+ source ${WORKSPACE_SCRIPTS}/args/arg-gitlab-ci-local.sh || exit 1 ;
18
+
19
+ shift $#;
20
+
21
+ if [ "${DOCTOR}" == 'yes' ] ; then
22
+ gitlab_ci_local_doctor && echo "Everything a green-gate run needs is in place." ;
23
+ else
24
+ gitlab_ci_local_run ;
25
+ fi
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Map a project in this workspace into a queryable knowledge graph with
4
+ # graphify (https://github.com/Graphify-Labs/graphify), or ask an existing
5
+ # graph a question.
6
+
7
+ # Bootstrap.
8
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
9
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
10
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
11
+
12
+ # Load workspace settings and extra lists.
13
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.recipes.settings.yml);
14
+
15
+ ARGPARSE_DESCRIPTION="Build or query the knowledge graph of a project in the recipes workspace"
16
+ source ${WORKSPACE_SCRIPTS}/args/arg-graphify.sh || exit 1 ;
17
+
18
+ shift $#;
19
+
20
+ if [ ! "${STORE}" == '_none_' ] ; then
21
+ ensure_graphify || exit 1 ;
22
+ graphify_store_url "${WORKSPACE_ROOT}/${doc_name}/${PROJECT_NAME}" "${STORE}" ;
23
+ elif [ -n "${QUERY}" ] ; then
24
+ graphify_query_project ;
25
+ else
26
+ graphify_project ;
27
+ fi
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Turn a project's knowledge graph into an Obsidian vault — one note per entity,
4
+ # a [[wikilink]] per relation, and a JSON Canvas of the map. Written next to the
5
+ # graph in graphs/recipes/<project>/obsidian/.
6
+ #
7
+ # Build the graph first with cmd-tools-graphify.sh: this reads what that wrote
8
+ # rather than parsing the project a second time.
9
+
10
+ # Bootstrap.
11
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
12
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
13
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
14
+
15
+ # Load workspace settings and extra lists.
16
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.recipes.settings.yml);
17
+
18
+ ARGPARSE_DESCRIPTION="Build an Obsidian vault from the knowledge graph of a project in the recipes workspace"
19
+ source ${WORKSPACE_SCRIPTS}/args/arg-obsidian.sh || exit 1 ;
20
+
21
+ shift $#;
22
+
23
+ export MAX_CANVAS_NODES="${MAX_CANVAS_NODES}";
24
+
25
+ if [ "${REMOVE}" == 'yes' ] ; then
26
+ obsidian_remove ;
27
+ elif [ "${STATUS}" == 'yes' ] ; then
28
+ obsidian_status ;
29
+ else
30
+ obsidian_project ;
31
+ fi
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Index a project in this workspace into the Milvus vector database
4
+ # (https://github.com/milvus-io/milvus) held in ~/workspace/rag, or ask an
5
+ # existing index a question.
6
+ #
7
+ # The RAG counterpart of cmd-tools-graphify.sh: graphify parses the CODE into a
8
+ # graph and reads no Markdown, Twig, *.module hooks or Drupal wiring YAML — this
9
+ # indexes the text of exactly those and retrieves passages from them.
10
+
11
+ # Bootstrap.
12
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
13
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
14
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
15
+
16
+ # Load workspace settings and extra lists.
17
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.recipes.settings.yml);
18
+
19
+ ARGPARSE_DESCRIPTION="Build or query the Milvus RAG index of a project in the recipes workspace"
20
+ source ${WORKSPACE_SCRIPTS}/args/arg-ragify.sh || exit 1 ;
21
+
22
+ shift $#;
23
+
24
+ if [ -n "${QUERY}" ] ; then
25
+ ragify_query_project ;
26
+ else
27
+ ragify_project ;
28
+ fi
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Reclaim the disk that REMOVED projects left behind — their DDEV databases, snapshots, built images
4
+ # and containers. A project whose folder is still on disk is never touched, stopped or not.
5
+ #
6
+ # The sweep is machine-wide wherever you run it: it takes no project name, reads WORKSPACE_ROOT, and
7
+ # protects every project folder in the tree — so this copy behaves identically to the one in any other
8
+ # workspace. It ships in each workspace that leans on DDEV, graphify or RAG for the same reason
9
+ # cmd-tools-graphify.sh does: the folder you are standing in is where you look for a cmd-tools-*.
10
+
11
+ # Bootstrap.
12
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
13
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
14
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
15
+
16
+ # Load workspace settings and extra lists.
17
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.recipes.settings.yml);
18
+
19
+ ARGPARSE_DESCRIPTION="Reclaim disk from projects that no longer have a folder — dry run unless --apply"
20
+ source ${WORKSPACE_SCRIPTS}/args/arg-reclaim.sh || exit 1 ;
21
+
22
+ shift $#;
23
+
24
+ reclaim_command ;
@@ -0,0 +1,18 @@
1
+ doc:
2
+ name: recipes
3
+
4
+ # What this folder's projects are, and which actions their rows offer:
5
+ # sites | code | files | media | ai-items — see core/workspace-app/WORKSPACES.md.
6
+ type: code
7
+
8
+ # What the COMPOSER menu may do here: full | manifest (the default). These folders hold package
9
+ # clones, not sites: it only adds to composer.json without running an install (require/remove
10
+ # --no-update, and validate). No install, update or scripts.
11
+ composer: manifest
12
+
13
+ # What the assistant is called on THIS workspace's page, and what its composer says when empty.
14
+ # `default` in either means "whatever settings.yml says" — the global value, so a rename there
15
+ # still reaches this page. Set a value here to override it for this workspace alone.
16
+ assistant:
17
+ name: default
18
+ placeholder: default
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The Drupal recipes workspace for Webship Workspace: the `recipes/` folder as a plugin.
3
+ *
4
+ * What the package carries is placed by the installer from the manifest (the folder's settings file,
5
+ * its commands and its docs) and listed by --activate; the dashboard draws the workspace from the
6
+ * settings file like any other. Nothing to register at run time yet: this is where the folder's own
7
+ * rail buttons, row menus or assistant context would go.
8
+ */
9
+ import type { PluginApi } from '@webship.co/workspace-plugin-api';
10
+ export declare const WORKSPACE_KEY = "recipes";
11
+ export declare function register(api: PluginApi): void;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /**
3
+ * The Drupal recipes workspace for Webship Workspace: the `recipes/` folder as a plugin.
4
+ *
5
+ * What the package carries is placed by the installer from the manifest (the folder's settings file,
6
+ * its commands and its docs) and listed by --activate; the dashboard draws the workspace from the
7
+ * settings file like any other. Nothing to register at run time yet: this is where the folder's own
8
+ * rail buttons, row menus or assistant context would go.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.WORKSPACE_KEY = void 0;
12
+ exports.register = register;
13
+ exports.WORKSPACE_KEY = 'recipes';
14
+ function register(api) {
15
+ api.addAssistantContext(() => `The recipes/ workspace is the Drupal recipes workspace (a plugin, @webship.co/workspace-drupal-recipes); its commands are the cmd-*.sh scripts in that folder.`);
16
+ }
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAMH,4BAEC;AAJY,QAAA,aAAa,GAAG,SAAS,CAAC;AAEvC,SAAgB,QAAQ,CAAC,GAAc;IACrC,GAAG,CAAC,mBAAmB,CAAC,GAAG,EAAE,CAAC,gKAAgK,CAAC,CAAC;AAClM,CAAC"}
package/docs/AGENTS.md ADDED
@@ -0,0 +1,33 @@
1
+ # Recipes
2
+
3
+ Drupal recipe packages.
4
+
5
+ Part of the **Webship Workspace** (`~/workspace`), a DDEV-only harness. The rules in the root
6
+ `CLAUDE.md` apply here too; what follows is what is specific to this folder.
7
+
8
+ ## The rule that matters here
9
+
10
+ Everything goes through DDEV. Never a host `composer`, `drush` or `mysql`:
11
+
12
+ ```bash
13
+ ddev composer require drupal/something
14
+ ddev drush cr
15
+ ddev export-db --file=… # not mysqldump
16
+ ddev delete -y -O # not a dropped database
17
+ ```
18
+
19
+ `ddev start` takes `-y`; **`ddev stop` does not**. Never write a `$databases` block into
20
+ `settings.php` — DDEV's `settings.ddev.php` owns the connection.
21
+
22
+ ## Commands here
23
+
24
+ ```bash
25
+ bash cmd-tool-backup-recipe.sh # Bootstrap.
26
+ bash cmd-tool-git-change-filemode-to-false.sh # Bootstrap.
27
+ bash cmd-tools-graphify.sh # Map a project in this workspace into a queryable knowledge graph with
28
+ bash cmd-tools-obsidian.sh # Turn a project graph into an Obsidian vault
29
+ bash cmd-tools-ragify.sh # Index a project in this workspace into the Milvus vector database
30
+ ```
31
+
32
+ Every one locates the workspace from its own path, so there is nothing to export and nothing to
33
+ install. `--help` on any of them lists its arguments.
package/docs/CLAUDE.md ADDED
@@ -0,0 +1,7 @@
1
+ # Recipes — workspace context
2
+
3
+ You are inside the **recipes** workspace of the Webship Workspace (`~/workspace`).
4
+
5
+ @AGENTS.md
6
+
7
+ The rules in it apply to everything under this folder, however deep.
package/docs/README.md ADDED
@@ -0,0 +1,4 @@
1
+ # Recipes
2
+ --
3
+
4
+ * You could place your recipes.
@@ -0,0 +1,12 @@
1
+ Feature: The Drupal recipes workspace plugin
2
+ Once the plugin is activated and installed, the recipes workspace is on the dashboard, and the
3
+ Plugins page lists the plugin with its four steps.
4
+
5
+ Scenario: The workspace page is there
6
+ Given I am on "/recipes"
7
+ Then I should see "Drupal recipes"
8
+
9
+ Scenario: The plugin is listed on the Plugins page
10
+ Given I am on "/settings/plugins"
11
+ Then I should see "Drupal recipes"
12
+ And I should see "@webship.co/workspace-drupal-recipes"
package/package.json CHANGED
@@ -1,6 +1,60 @@
1
1
  {
2
2
  "name": "@webship.co/workspace-drupal-recipes",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0-alpha1",
4
+ "description": "The Drupal recipes workspace for Webship Workspace: the `recipes/` folder (type code), its settings file, its 8 commands and its docs, activated as a plugin.",
5
+ "main": "dist/src/index.js",
6
+ "types": "dist/src/index.d.ts",
7
+ "license": "ISC",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/webship/workspace-drupal-recipes.git"
11
+ },
12
+ "files": [
13
+ "dist/src",
14
+ "commands",
15
+ "config",
16
+ "docs",
17
+ "features",
18
+ "README.md"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc -p tsconfig.json",
22
+ "prepare": "npm run build",
23
+ "test": "npm run build && node --test dist/tests/*.test.js",
24
+ "lint": "tsc -p tsconfig.json --noEmit"
25
+ },
26
+ "workspacePlugin": {
27
+ "name": "drupal-recipes",
28
+ "label": "Drupal recipes",
29
+ "workspace": {
30
+ "key": "recipes",
31
+ "settingsTemplate": "config/workspace.recipes.settings.yml",
32
+ "files": [
33
+ "commands/cmd-tool-backup-recipe.sh",
34
+ "commands/cmd-tool-git-change-filemode-to-false.sh",
35
+ "commands/cmd-tools-checks.sh",
36
+ "commands/cmd-tools-gitlab-ci-local.sh",
37
+ "commands/cmd-tools-graphify.sh",
38
+ "commands/cmd-tools-obsidian.sh",
39
+ "commands/cmd-tools-ragify.sh",
40
+ "commands/cmd-tools-reclaim.sh"
41
+ ],
42
+ "docs": [
43
+ "docs/AGENTS.md",
44
+ "docs/CLAUDE.md",
45
+ "docs/README.md"
46
+ ]
47
+ },
48
+ "features": [
49
+ "features/drupal-recipes.feature"
50
+ ]
51
+ },
52
+ "devDependencies": {
53
+ "@types/node": "^24.0.0",
54
+ "@webship.co/workspace-plugin-api": "^1.0.0-alpha1",
55
+ "typescript": "^5.9.0"
56
+ },
57
+ "publishConfig": {
58
+ "access": "public"
59
+ }
60
+ }