@webship.co/workspace-adminlte 0.0.0-stage → 1.0.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.
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: adminlte-scenarios
3
+ description: The phrases of the AdminLTE step pack (@webship-js/adminlte-steps) and of the Bootstrap pack beside it, by component, the traps of AdminLTE 4 and 3.2, and three example features that pass on the components demo site of the Webship Workspace. Use when writing or fixing webship-js scenarios for the sidebar, its tree menu, a card's tools, a chat, full screen, the color mode or the Bootstrap components of any dashboard built on AdminLTE.
4
+ ---
5
+
6
+ # adminlte-scenarios
7
+
8
+ The step pack [`@webship-js/adminlte-steps`](https://github.com/webship/adminlte-steps) reads the components AdminLTE
9
+ adds to Bootstrap, on any dashboard built on AdminLTE 4 (and 3.2 where the same step holds), in a container-based (DDEV
10
+ by default) Webship Workspace or anywhere else. The Bootstrap components inside a dashboard (dialogs, drop-down menus,
11
+ tabs, alerts, form states) are the Bootstrap pack's, [`@webship-js/bootstrap-steps`](https://github.com/webship/bootstrap-steps):
12
+ load both, they share no phrase. Read the installed definitions before you write a phrase:
13
+
14
+ ```bash
15
+ grep -hE "^(Given|When|Then)\(" node_modules/@webship-js/adminlte-steps/tests/step-definitions/*.steps.js
16
+ grep -hE "^(Given|When|Then)\(" node_modules/@webship-js/bootstrap-steps/tests/step-definitions/*.steps.js
17
+ ```
18
+
19
+ A project gets both with `bash cmd-tools-testing.sh <site>` (a demo site of `cmd-adminlte-project.sh`) or
20
+ `bash cmd-tools-testing.sh <site> --add-steps bootstrap` then `--add-steps adminlte` (any other site, beside its
21
+ platform's pack).
22
+
23
+ ## The phrases, by component
24
+
25
+ | Component | Phrases |
26
+ | --- | --- |
27
+ | Sidebar | `When I collapse the sidebar`, `When I expand the sidebar`, `Then the sidebar should be collapsed` |
28
+ | Tree menu of the sidebar | `When I expand the "Reports" sidebar menu item`, `Then the "Reports" sidebar menu item should be collapsed`, `Then the "Cards" sidebar menu item should be active` |
29
+ | Card tools | `When I collapse the "Sales" card`, `When I maximize the "Wind" card`, `When I restore the "Wind" card`, `When I remove the "Rainfall" card`, `Then the "Sales" card should be collapsed`, `Then the "Rainfall" card should not be shown`, `Then the "Sales" card should show "..."` |
30
+ | Chat | `When I open the contacts of the "Team chat" chat`, `Then the contacts of the "Team chat" chat should be hidden` |
31
+ | Full screen | `When I enter full screen`, `Then the page should not be in full screen` |
32
+ | Color mode (AdminLTE 4) | `When I switch the dashboard's color mode to "Dark"`, `Then the dashboard's color mode should be "dark"` |
33
+ | The theme | `Then the page should use the dashboard theme at version "4"` |
34
+ | Bootstrap components (the Bootstrap pack) | `When I open the "Export report" dialog`, `When I switch to the "This week" tab`, `When I open the "Account" drop-down menu`, `When I dismiss the alert "..."` |
35
+
36
+ webship-js's own steps do the rest: `I press "..."`, `I fill in "..." with "..."`, `I set the viewport to the "xs"
37
+ breakpoint`, `the page should have no serious accessibility violations`.
38
+
39
+ ## Traps found on real dashboards
40
+
41
+ - **4 and 3.2 differ, and the steps say what a person sees on both.** A removed card is taken off the page on 4 and
42
+ hidden on 3.2: `should not be shown` holds for both. A collapsed sidebar is out of the window on 4, a strip of icons
43
+ on 3.2 at a wide width. 4 sets aria-expanded on a submenu's item and the steps check it; 3.2 sets none.
44
+ - **The color mode is AdminLTE 4's.** 3.2 has no switcher: the two color mode steps fail there with a hint. Tag such a
45
+ scenario for the version (the demo's `@lte4`) rather than letting it run on a 3.2 site.
46
+ - **The open sidebar covers its toggle on a phone.** `When I collapse the sidebar` clicks beside it, on the overlay, as
47
+ a person does; a plain click on the toggle would fail.
48
+ - **Things move.** The sidebar slides for 0.3 seconds, a submenu for about 0.3, a card's body too, a removed card fades.
49
+ The steps wait for the end; never add a fixed wait after them.
50
+ - **3.2 needs the full jQuery.** Its slides use jQuery's effects, which the slim build leaves out: a menu that never
51
+ opens on a 3.2 page may load jquery.slim.
52
+ - **The documentation's menu markup fails the audit.** AdminLTE's starter puts `role="navigation"` (4) or `role="menu"`
53
+ (3.2) on the menu's `<ul>`, and axe's list rule flags its items: give the `<nav>` the name instead.
54
+ - **Two packs, two sets of words.** The AdminLTE pack's words were chosen not to meet other packs': "sidebar menu
55
+ item", "the dashboard's color mode". Use them as they are.
56
+
57
+ ## Examples
58
+
59
+ Three features that pass on the components demo site (`bash cmd-adminlte-project.sh <site> --install`), copied into
60
+ `tests/features/` of the project:
61
+
62
+ - `examples/sidebar-and-menu.feature`: the sidebar collapsed and expanded, a submenu, the active item.
63
+ - `examples/cards-and-chat.feature`: a card's tools, a removed card, a chat's contacts.
64
+ - `examples/inside-the-dashboard.feature`: a dialog, tabs and an alert of the Bootstrap pack, full screen.
65
+
66
+ ## The book
67
+
68
+ For any automated functional testing in this work (a Gherkin feature, a step definition, choosing a
69
+ step, a test run and its failures), read the book *Automated Functional Testing Recipes* first.
70
+
71
+ - **Where.** Use the first that exists: `.claude/automated-functional-testing-recipes/` in the project,
72
+ `~/.claude/automated-functional-testing-recipes/` (installed by webship/webship-js-ai-agent,
73
+ webship/webship-js-skills or webship/ai-agents), or
74
+ https://github.com/webship/webship-js-ai-agent/tree/2.0.x/automated-functional-testing-recipes
75
+ - **How.** Its `README.md` first, then the chapter that matches the task (one file per chapter,
76
+ named by its subject), not the single complete file.
77
+ - **Which wins.** The installed webship-js package and the step pack are the source of truth for
78
+ step phrasing. When they differ from the book, follow them and say so.
79
+ - **For AdminLTE.** Start with `ch08-modal-dialog-testing.md` (dialogs, and the sidebar that opens over the page),
80
+ `ch07-waiting-dynamic-content.md` (why a wait names its signal, never a time),
81
+ `ch13-responsive-mobile-testing.md` (the navigation bar on a narrow screen) and
82
+ `ch21-when-tests-go-bad.md` (flaky, brittle and slow scenarios).
@@ -0,0 +1,23 @@
1
+ Feature: Cards and a chat
2
+ A card collapses to its header, fills the window and is removed from view; a chat opens its contacts.
3
+
4
+ Scenario: A card collapses and expands
5
+ Given I am on "/index.html"
6
+ When I collapse the "Sales" card
7
+ Then the "Sales" card should be collapsed
8
+ And the "Sales" card should not show "1,284 orders"
9
+ When I expand the "Sales" card
10
+ Then the "Sales" card should be expanded
11
+
12
+ Scenario: A card is maximized, restored and removed
13
+ Given I am on "/cards.html"
14
+ When I maximize the "Wind" card
15
+ Then the "Wind" card should be maximized
16
+ When I restore the "Wind" card
17
+ And I remove the "Rainfall" card
18
+ Then the "Rainfall" card should not be shown
19
+
20
+ Scenario: The contacts of a chat
21
+ Given I am on "/chat.html"
22
+ When I open the contacts of the "Team chat" chat
23
+ Then the contacts of the "Team chat" chat should be shown
@@ -0,0 +1,23 @@
1
+ Feature: Inside the dashboard
2
+ The Bootstrap components of a dashboard are driven by the Bootstrap pack's steps; full screen by this pack's.
3
+
4
+ Scenario: A dialog opens and closes
5
+ Given I am on "/components.html"
6
+ When I open the "Export report" dialog
7
+ Then the "Export report" dialog should show "exported as a spreadsheet"
8
+ When I press Escape in the "Export report" dialog
9
+ Then no dialog should be shown
10
+
11
+ Scenario: Tabs and an alert
12
+ Given I am on "/components.html"
13
+ When I switch to the "This week" tab
14
+ Then the "This week" tab should be active
15
+ When I dismiss the alert "The backup finished"
16
+ Then I should not see the alert "The backup finished"
17
+
18
+ Scenario: Full screen and back
19
+ Given I am on "/index.html"
20
+ When I enter full screen
21
+ Then the page should be in full screen
22
+ When I leave full screen
23
+ Then the page should not be in full screen
@@ -0,0 +1,21 @@
1
+ Feature: The sidebar and its menu
2
+ The sidebar slides away and back with its toggle; an item of its tree menu slides its submenu open and shut.
3
+
4
+ Scenario: The sidebar collapses and expands
5
+ Given I am on "/index.html"
6
+ When I collapse the sidebar
7
+ Then the sidebar should be collapsed
8
+ When I expand the sidebar
9
+ Then the sidebar should be expanded
10
+
11
+ Scenario: A submenu opens and closes
12
+ Given I am on "/index.html"
13
+ When I expand the "Reports" sidebar menu item
14
+ Then the "Reports" sidebar menu item should be expanded
15
+ When I collapse the "Reports" sidebar menu item
16
+ Then the "Reports" sidebar menu item should be collapsed
17
+
18
+ Scenario: The page in a submenu is active
19
+ Given I am on "/cards.html"
20
+ Then the "Cards" sidebar menu item should be active
21
+ And the "Dashboard" sidebar menu item should not be active
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # workspace-name: AdminLTE (components demo site)
4
+
5
+ # Installed by the AdminLTE plugin (plugins.sh --install adminlte); __WORKSPACE__ is the workspace it was installed into.
6
+ #
7
+ # Serve the components demo site of the AdminLTE step pack in a container, at the project's address
8
+ # (https://<name>.ddev.site on DDEV): a made-up dashboard with AdminLTE's sidebar, tree menu, card tools,
9
+ # chat and the Bootstrap components inside it. With --install the site is checked once it is served.
10
+ # A static site: it has no database and no accounts. DDEV by default; --runtime docker, podman or
11
+ # kubernetes serves it there.
12
+
13
+ # Bootstrap.
14
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
15
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
16
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
17
+
18
+ # Load workspace settings.
19
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.__WORKSPACE__.settings.yml);
20
+
21
+ # Where the demo site comes from: the step pack's repository, its branch, and the version of AdminLTE to
22
+ # serve (4, or 3.2 for the pages of AdminLTE 3.2).
23
+ site_source="https://github.com/webship/adminlte-steps.git";
24
+ site_source_ref="2.0.x";
25
+ site_adminlte_version="4";
26
+
27
+ # Distribution.
28
+ distribution_name="adminlte";
29
+ distribution_title="AdminLTE";
30
+ distribution_webroot="site";
31
+
32
+ ARGPARSE_DESCRIPTION="Build a ${distribution_title} project in __WORKSPACE__"
33
+ # The args file comes with the plugin: core/scripts/plugins/adminlte/ is where plugins.sh --install puts it.
34
+ source ${WORKSPACE_SCRIPTS}/plugins/adminlte/args/arg-adminlte.sh || exit 1 ;
35
+
36
+ shift $#;
37
+
38
+ adminlte_build ;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * AdminLTE for Webship Workspace: a plugin for AdminLTE, the admin dashboard theme built on Bootstrap.
3
+ *
4
+ * What the package carries is placed by the installer from the manifest: the builder in the sites
5
+ * folders, its functions, argparse and machine files (the static server it uses off DDEV, and a
6
+ * first feature) under core/scripts/plugins/adminlte/, its AI items (ai/) in the AI folders. The
7
+ * builder serves the components demo site of the step pack (@webship-js/adminlte-steps) in a
8
+ * container, on DDEV, Docker Compose, Podman or Kubernetes, so the pack and a person have a site
9
+ * with every component on it. The pack itself goes into any other project with the core's
10
+ * `cmd-tools-testing.sh <project> --add-steps bootstrap` and `--add-steps adminlte`. The dashboard needs nothing drawn for it: the
11
+ * builder is in the Build list because it is a cmd-*-project.sh, the row menus are the core's, the
12
+ * AI items are listed like any other. What register() adds is what the assistant is told.
13
+ *
14
+ * Everything the dashboard is asked for goes through `api`; this package requires nothing from the
15
+ * dashboard's own files, so it can be installed from npm and removed without a trace.
16
+ */
17
+ import type { PluginApi } from '@webship.co/workspace-plugin-api';
18
+ /** The plugin's name, which its functions are named after. */
19
+ export declare const PLATFORM = "adminlte";
20
+ /** The commands the installer places in every sites folder. */
21
+ export declare const COMMANDS: string[];
22
+ /** The agents the installer places in the AI Agents folder. */
23
+ export declare const AGENTS: string[];
24
+ /** The skill the installer places in the AI Skills folder (a folder each, with its SKILL.md). */
25
+ export declare const SKILLS: string[];
26
+ /** The slash command the installer places in the AI Commands folder. */
27
+ export declare const AI_COMMANDS: string[];
28
+ /** The prompts the installer places in the AI Prompts folder: whole launch commands for a new session. */
29
+ export declare const PROMPTS: string[];
30
+ /** What the assistant is told about AdminLTE in this workspace. */
31
+ export declare function assistantContext(): string;
32
+ export declare function register(api: PluginApi): void;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /**
3
+ * AdminLTE for Webship Workspace: a plugin for AdminLTE, the admin dashboard theme built on Bootstrap.
4
+ *
5
+ * What the package carries is placed by the installer from the manifest: the builder in the sites
6
+ * folders, its functions, argparse and machine files (the static server it uses off DDEV, and a
7
+ * first feature) under core/scripts/plugins/adminlte/, its AI items (ai/) in the AI folders. The
8
+ * builder serves the components demo site of the step pack (@webship-js/adminlte-steps) in a
9
+ * container, on DDEV, Docker Compose, Podman or Kubernetes, so the pack and a person have a site
10
+ * with every component on it. The pack itself goes into any other project with the core's
11
+ * `cmd-tools-testing.sh <project> --add-steps bootstrap` and `--add-steps adminlte`. The dashboard needs nothing drawn for it: the
12
+ * builder is in the Build list because it is a cmd-*-project.sh, the row menus are the core's, the
13
+ * AI items are listed like any other. What register() adds is what the assistant is told.
14
+ *
15
+ * Everything the dashboard is asked for goes through `api`; this package requires nothing from the
16
+ * dashboard's own files, so it can be installed from npm and removed without a trace.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.PROMPTS = exports.AI_COMMANDS = exports.SKILLS = exports.AGENTS = exports.COMMANDS = exports.PLATFORM = void 0;
20
+ exports.assistantContext = assistantContext;
21
+ exports.register = register;
22
+ /** The plugin's name, which its functions are named after. */
23
+ exports.PLATFORM = 'adminlte';
24
+ /** The commands the installer places in every sites folder. */
25
+ exports.COMMANDS = ['cmd-adminlte-project.sh'];
26
+ /** The agents the installer places in the AI Agents folder. */
27
+ exports.AGENTS = ['adminlte-ui-builder', 'adminlte-tester'];
28
+ /** The skill the installer places in the AI Skills folder (a folder each, with its SKILL.md). */
29
+ exports.SKILLS = ['adminlte-scenarios'];
30
+ /** The slash command the installer places in the AI Commands folder. */
31
+ exports.AI_COMMANDS = ['adminlte-test'];
32
+ /** The prompts the installer places in the AI Prompts folder: whole launch commands for a new session. */
33
+ exports.PROMPTS = ['adminlte-build-and-test', 'adminlte-scenarios-for-a-site'];
34
+ /** What the assistant is told about AdminLTE in this workspace. */
35
+ function assistantContext() {
36
+ return [
37
+ 'AdminLTE (a plugin, @webship.co/workspace-adminlte): its builder serves the components demo site of the step pack',
38
+ '@webship-js/adminlte-steps in a container, with `bash cmd-adminlte-project.sh <name> --install` from a sites folder',
39
+ '(dev, test, sandboxes, demos): a made-up dashboard with AdminLTE\'s sidebar and its tree menu, cards with their tools, a',
40
+ 'chat\'s contacts, full screen and the color mode, and the Bootstrap components inside it, at https://<name>.ddev.site;',
41
+ '`--adminlte 3.2` serves the same pages on AdminLTE 3.2, and `--runtime docker`, `podman` or `kubernetes` serves the site',
42
+ 'there, at the address that runtime gives (the build prints it). It is static: there is no database and there are no accounts.',
43
+ '`bash cmd-tools-testing.sh <name>` sets up webship-js with the AdminLTE pack and, beside it, the Bootstrap pack',
44
+ '(@webship-js/bootstrap-steps, for the dialogs, menus, tabs and alerts inside a dashboard) on such a site; on any other',
45
+ 'project whose dashboard uses AdminLTE, `bash cmd-tools-testing.sh <project> --add-steps bootstrap` then `--add-steps adminlte`',
46
+ 'adds both beside the platform\'s own. The AdminLTE pack shares no phrase with the Bootstrap pack.',
47
+ `For building or checking a dashboard made with AdminLTE, hand over to the agent \`${exports.AGENTS[0]}\`; for testing one, to \`${exports.AGENTS[1]}\`.`,
48
+ `The plugin also places the skill ${exports.SKILLS.map((a) => `\`${a}\``).join(', ')} (the step packs' phrases, by component) in ai-skills/,`,
49
+ `the command ${exports.AI_COMMANDS.map((a) => `\`/${a} <site>\``).join(', ')} in ai-commands/ and the prompts ${exports.PROMPTS.map((a) => `\`${a}\``).join(' and ')} in ai-prompts/.`,
50
+ 'Never run node, npm or npx on the host for a project.',
51
+ ].join(' ');
52
+ }
53
+ function register(api) {
54
+ api.addAssistantContext(assistantContext);
55
+ }
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAuBH,4CAiBC;AAED,4BAEC;AAxCD,8DAA8D;AACjD,QAAA,QAAQ,GAAG,UAAU,CAAC;AAEnC,+DAA+D;AAClD,QAAA,QAAQ,GAAG,CAAC,yBAAyB,CAAC,CAAC;AAEpD,+DAA+D;AAClD,QAAA,MAAM,GAAG,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAC;AAEjE,iGAAiG;AACpF,QAAA,MAAM,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAE7C,wEAAwE;AAC3D,QAAA,WAAW,GAAG,CAAC,eAAe,CAAC,CAAC;AAE7C,0GAA0G;AAC7F,QAAA,OAAO,GAAG,CAAC,yBAAyB,EAAE,+BAA+B,CAAC,CAAC;AAEpF,mEAAmE;AACnE,SAAgB,gBAAgB;IAC9B,OAAO;QACL,mHAAmH;QACnH,qHAAqH;QACrH,0HAA0H;QAC1H,wHAAwH;QACxH,0HAA0H;QAC1H,+HAA+H;QAC/H,iHAAiH;QACjH,wHAAwH;QACxH,gIAAgI;QAChI,mGAAmG;QACnG,qFAAqF,cAAM,CAAC,CAAC,CAAC,6BAA6B,cAAM,CAAC,CAAC,CAAC,KAAK;QACzI,oCAAoC,cAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,yDAAyD;QACrI,eAAe,mBAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,oCAAoC,eAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB;QACtK,uDAAuD;KACxD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;AAED,SAAgB,QAAQ,CAAC,GAAc;IACrC,GAAG,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,39 @@
1
+ Feature: A AdminLTE demo site on Docker Compose, Podman and Kubernetes
2
+ The builder serves on DDEV by default, and with --runtime on Docker Compose, Podman or a Kubernetes cluster. A site
3
+ served there has the row a DDEV project has: its state, its own address and the runtime's menu, and the plugin's
4
+ static server serves its pages.
5
+
6
+ # Each scenario drives a real site of that runtime, built with cmd-adminlte-project.sh --runtime: the first running one
7
+ # the workspace holds. Without one it is skipped, with the reason. In the plugin's CI the Docker Compose site is the
8
+ # one the manifest's featuresSite builds: ci-adminlte.
9
+
10
+ @needs-runtime-docker @needs-platform-adminlte
11
+ Scenario: A AdminLTE demo site served on Docker Compose runs at its own address, with the DOCKER menu
12
+ Given I am on the folder of the "docker" site
13
+ Then the row of the "docker" site should show "Running"
14
+ And the row of the "docker" site should link to the address of its runtime
15
+ And the address of the "docker" site should answer
16
+ And the row of the "docker" site should carry the "DOCKER" menu and no DDEV menu
17
+
18
+ @needs-runtime-docker @needs-platform-adminlte
19
+ Scenario: The site on Docker Compose is the demo dashboard, with AdminLTE's style sheet
20
+ Given I am on the folder of the "docker" site
21
+ When I open "/" on the "docker" site
22
+ Then "link[href*='adminlte']" should be attached within 30 seconds
23
+ And I should see "Field Office"
24
+
25
+ @needs-runtime-podman @needs-platform-adminlte
26
+ Scenario: A AdminLTE demo site served on Podman runs at its own address, with the PODMAN menu
27
+ Given I am on the folder of the "podman" site
28
+ Then the row of the "podman" site should show "Running"
29
+ And the row of the "podman" site should link to the address of its runtime
30
+ And the address of the "podman" site should answer
31
+ And the row of the "podman" site should carry the "PODMAN" menu and no DDEV menu
32
+
33
+ @needs-runtime-kubernetes @needs-platform-adminlte
34
+ Scenario: A AdminLTE demo site served on Kubernetes runs at the address of its node, with the K8S menu
35
+ Given I am on the folder of the "kubernetes" site
36
+ Then the row of the "kubernetes" site should show "Running"
37
+ And the row of the "kubernetes" site should link to the address of its runtime
38
+ And the address of the "kubernetes" site should answer
39
+ And the row of the "kubernetes" site should carry the "K8S" menu and no DDEV menu
@@ -0,0 +1,36 @@
1
+ Feature: The AdminLTE plugin on the dashboard
2
+ Once the plugin is activated and installed, the sites folders offer the AdminLTE builder, each
3
+ AI folder lists the items of its kind the plugin ships, and the Plugins page lists the plugin
4
+ with what it ships.
5
+
6
+ # Settings lists every plugin that was added; the package and what the plugin ships are on its own page.
7
+ Scenario: Settings lists the plugin, and its own page names its package and what it ships
8
+ Given I am on "/settings"
9
+ Then I should see "AdminLTE"
10
+ When I go to "/settings/plugin/adminlte"
11
+ Then I should see "@webship.co/workspace-adminlte"
12
+ And I should see "cmd-adminlte-project.sh"
13
+ And I should see "adminlte-ui-builder"
14
+
15
+ Scenario: A sites folder offers the AdminLTE builder
16
+ Given I am on "/dev"
17
+ Then "option[value='cmd-adminlte-project.sh']" should be attached
18
+
19
+ # The AI folders are searched by name: with every plugin on, a folder lists more than one page of items.
20
+ Scenario: The AI Agents folder lists the agents the plugin ships
21
+ Given I am on "/ai-agents?q=adminlte-"
22
+ Then I should see "adminlte-ui-builder"
23
+ And I should see "adminlte-tester"
24
+
25
+ Scenario: The AI Skills folder lists the skill the plugin ships
26
+ Given I am on "/ai-skills?q=adminlte-scenarios"
27
+ Then I should see "adminlte-scenarios"
28
+
29
+ Scenario: The AI Commands folder lists the command the plugin ships
30
+ Given I am on "/ai-commands?q=adminlte-test"
31
+ Then I should see "adminlte-test"
32
+
33
+ Scenario: The AI Prompts folder lists the prompts the plugin ships
34
+ Given I am on "/ai-prompts?q=adminlte-"
35
+ Then I should see "adminlte-build-and-test"
36
+ And I should see "adminlte-scenarios-for-a-site"
package/package.json CHANGED
@@ -1,6 +1,101 @@
1
1
  {
2
2
  "name": "@webship.co/workspace-adminlte",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "AdminLTE for Webship Workspace: the builder (`cmd-adminlte-project.sh`) in every sites folder, which serves the components demo site of the AdminLTE step pack in a container (AdminLTE 4, or 3.2; DDEV by default, or Docker Compose, Podman or Kubernetes with --runtime), the AdminLTE and Bootstrap step packs wired into the testing setup of such a site, and its AI items in their folders: two agents, a skill, a command and two prompts for testing and building AdminLTE dashboards.",
5
+ "main": "dist/src/index.js",
6
+ "types": "dist/src/index.d.ts",
7
+ "license": "ISC",
8
+ "engines": {
9
+ "node": ">=24"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/webship/workspace-adminlte.git"
14
+ },
15
+ "files": [
16
+ "dist/src",
17
+ "ai",
18
+ "commands",
19
+ "features",
20
+ "scripts",
21
+ "testing",
22
+ "README.md"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsc -p tsconfig.json",
26
+ "prepare": "npm run build",
27
+ "test": "npm run build && node --test dist/tests/*.test.js",
28
+ "lint": "tsc -p tsconfig.json --noEmit"
29
+ },
30
+ "workspacePlugin": {
31
+ "name": "adminlte",
32
+ "label": "AdminLTE",
33
+ "needs": [
34
+ [
35
+ "dev",
36
+ "test",
37
+ "sandboxes",
38
+ "demos"
39
+ ],
40
+ "ai-agents",
41
+ "ai-skills",
42
+ "ai-commands",
43
+ "ai-prompts"
44
+ ],
45
+ "commands": {
46
+ "types": [
47
+ "sites"
48
+ ],
49
+ "workspaces": [
50
+ "dev",
51
+ "test",
52
+ "sandboxes",
53
+ "demos"
54
+ ],
55
+ "files": [
56
+ "commands/cmd-adminlte-project.sh"
57
+ ]
58
+ },
59
+ "scripts": {
60
+ "functions": [
61
+ "scripts/functions/fun-adminlte.sh"
62
+ ],
63
+ "args": [
64
+ "scripts/args/arg-adminlte.sh"
65
+ ],
66
+ "machine": [
67
+ "scripts/adminlte-serve.js",
68
+ "testing/site.feature"
69
+ ]
70
+ },
71
+ "ai": {
72
+ "agents": [
73
+ "ai/agents/adminlte-ui-builder.md",
74
+ "ai/agents/adminlte-tester.md"
75
+ ],
76
+ "skills": [
77
+ "ai/skills/adminlte-scenarios"
78
+ ],
79
+ "commands": [
80
+ "ai/commands/adminlte-test.md"
81
+ ],
82
+ "prompts": [
83
+ "ai/prompts/adminlte-build-and-test.md",
84
+ "ai/prompts/adminlte-scenarios-for-a-site.md"
85
+ ]
86
+ },
87
+ "features": [
88
+ "features/adminlte.feature",
89
+ "features/adminlte-runtimes.feature"
90
+ ],
91
+ "featuresSite": "cmd-adminlte-project.sh ci-adminlte --install --runtime docker"
92
+ },
93
+ "devDependencies": {
94
+ "@types/node": "^24.0.0",
95
+ "@webship.co/workspace-plugin-api": "^1.0.13",
96
+ "typescript": "^5.9.0"
97
+ },
98
+ "publishConfig": {
99
+ "access": "public"
100
+ }
101
+ }
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ // The static server of the AdminLTE demo site off DDEV (Docker Compose, Podman, Kubernetes): the web container's own server
5
+ // (rt_serve), Node.js's standard library only. Serves the files of one folder as they are: a folder's index.html, the
6
+ // type of each file by its extension, 404 for what is not there, never a file outside the folder or a hidden one.
7
+ // Written by the AdminLTE plugin of the Webship Workspace; the builder copies it into the project's .webship-adminlte/.
8
+ // node adminlte-serve.js <folder> <port>
9
+
10
+ const http = require('http');
11
+ const fs = require('fs');
12
+ const path = require('path');
13
+
14
+ const root = path.resolve(process.argv[2] || '.');
15
+ const port = Number(process.argv[3] || 8080);
16
+ const TYPES = {
17
+ '.html': 'text/html; charset=utf-8', '.css': 'text/css; charset=utf-8', '.js': 'text/javascript; charset=utf-8',
18
+ '.json': 'application/json', '.map': 'application/json', '.svg': 'image/svg+xml', '.png': 'image/png',
19
+ '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.gif': 'image/gif', '.webp': 'image/webp', '.ico': 'image/x-icon',
20
+ '.pdf': 'application/pdf', '.txt': 'text/plain; charset=utf-8', '.woff2': 'font/woff2', '.woff': 'font/woff',
21
+ };
22
+
23
+ function send(res, status, body, type) {
24
+ res.writeHead(status, { 'Content-Type': type || 'text/plain; charset=utf-8', 'Cache-Control': 'no-cache', 'X-Content-Type-Options': 'nosniff' });
25
+ res.end(body);
26
+ }
27
+
28
+ http.createServer((req, res) => {
29
+ if (req.method !== 'GET' && req.method !== 'HEAD') return send(res, 405, 'Method not allowed\n');
30
+ let rel;
31
+ try {
32
+ rel = decodeURIComponent(new URL(req.url, 'http://site').pathname);
33
+ } catch (e) {
34
+ return send(res, 400, 'Bad request\n');
35
+ }
36
+ if (rel.split('/').some((part) => part.startsWith('.'))) return send(res, 404, 'Not found\n');
37
+ let file = path.resolve(root, `.${rel}`);
38
+ if (file !== root && !file.startsWith(root + path.sep)) return send(res, 404, 'Not found\n');
39
+ fs.stat(file, (err, st) => {
40
+ if (!err && st.isDirectory()) {
41
+ if (!rel.endsWith('/')) { res.writeHead(301, { Location: `${rel}/` }); return res.end(); }
42
+ file = path.join(file, 'index.html');
43
+ }
44
+ fs.readFile(file, (readErr, data) => {
45
+ if (readErr) return send(res, 404, 'Not found\n');
46
+ res.writeHead(200, { 'Content-Type': TYPES[path.extname(file).toLowerCase()] || 'application/octet-stream', 'Cache-Control': 'no-cache', 'X-Content-Type-Options': 'nosniff' });
47
+ res.end(req.method === 'HEAD' ? undefined : data);
48
+ });
49
+ });
50
+ }).listen(port, '0.0.0.0', () => {
51
+ console.log(`Serving ${root} on port ${port}`);
52
+ });
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env bash
2
+
3
+ argparse "$@" <<ARGEOF || exit 1
4
+ parser.add_argument('PROJECT_NAME',
5
+ help='The name of the project: its folder, its container project and its host name.')
6
+ parser.add_argument('-v', '--adminlte',
7
+ default="${site_adminlte_version}",
8
+ choices=['4', '3.2'],
9
+ help='The version of AdminLTE to serve: the pages of 4, or the same pages on 3.2. [default %(default)s]')
10
+ parser.add_argument('-s', '--source',
11
+ default="${site_source}",
12
+ help='The git repository the demo site is taken from (its demo-site/ folder). [default %(default)s]')
13
+ parser.add_argument('-r', '--ref',
14
+ default="${site_source_ref}",
15
+ help='A branch or a tag of that repository; empty means its default branch. Example: --ref 2.0.x [default %(default)s]')
16
+ parser.add_argument('--runtime',
17
+ dest='RUNTIME',
18
+ default="_none_",
19
+ choices=['ddev', 'docker', 'podman', 'kubernetes'],
20
+ help='The container runtime to build on: ddev (the default, or container.runtime of settings.yml), docker (Docker Compose), podman or kubernetes.')
21
+ parser.add_argument('-i', '--install',
22
+ action='store_true',
23
+ default=False,
24
+ help='Check that the site answers at the address of the project once it is served.')
25
+ parser.add_argument('-a', '--add-users',
26
+ action='store_true',
27
+ default=False,
28
+ help='Taken so that every builder accepts the same flags: a static site has no accounts, and nothing is added.')
29
+ parser.add_argument('-l', '--launch',
30
+ action='store_true',
31
+ default=False,
32
+ help='Open the site in a browser when it is ready.')
33
+ ARGEOF