@webship.co/workspace-learnpress 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.
- package/LICENSE +15 -0
- package/README.md +312 -2
- package/ai/agents/learnpress-site-builder.md +112 -0
- package/ai/agents/learnpress-tester.md +163 -0
- package/ai/commands/learnpress-test.md +97 -0
- package/ai/prompts/learnpress-build-and-test.md +25 -0
- package/ai/prompts/learnpress-quiz-round.md +32 -0
- package/ai/skills/learnpress-scenarios/SKILL.md +211 -0
- package/ai/skills/learnpress-scenarios/examples/enrolling-and-lessons.feature +34 -0
- package/ai/skills/learnpress-scenarios/examples/the-course-editor.feature +29 -0
- package/ai/skills/learnpress-scenarios/examples/the-quiz.feature +43 -0
- package/commands/cmd-learnpress-project.sh +37 -0
- package/commands/cmd-tools-learnpress-courses.sh +26 -0
- package/dist/src/index.d.ts +37 -0
- package/dist/src/index.js +60 -0
- package/dist/src/index.js.map +1 -0
- package/features/learnpress-runtimes.feature +54 -0
- package/features/learnpress.feature +44 -0
- package/package.json +102 -4
- package/scripts/args/arg-learnpress-courses.sh +22 -0
- package/scripts/args/arg-learnpress.sh +40 -0
- package/scripts/functions/fun-learnpress.sh +415 -0
- package/scripts/learning-site.php +442 -0
- package/testing/courses.feature +38 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AA8BH,4CAgBC;AAED,4BAEC;AA9CD;;;;GAIG;AACU,QAAA,QAAQ,GAAG,YAAY,CAAC;AAErC,8GAA8G;AACjG,QAAA,IAAI,GAAG,WAAW,CAAC;AAEhC,+DAA+D;AAClD,QAAA,QAAQ,GAAG,CAAC,2BAA2B,EAAE,iCAAiC,CAAC,CAAC;AAEzF,+DAA+D;AAClD,QAAA,MAAM,GAAG,CAAC,yBAAyB,EAAE,mBAAmB,CAAC,CAAC;AAEvE,iGAAiG;AACpF,QAAA,MAAM,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAE/C,wEAAwE;AAC3D,QAAA,WAAW,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAE/C,gHAAgH;AACnG,QAAA,OAAO,GAAG,CAAC,2BAA2B,EAAE,uBAAuB,CAAC,CAAC;AAE9E,qEAAqE;AACrE,SAAgB,gBAAgB;IAC9B,OAAO;QACL,0HAA0H;QAC1H,kIAAkI;QAClI,gLAAgL;QAChL,iNAAiN;QACjN,qLAAqL;QACrL,kHAAkH;QAClH,gKAAgK;QAChK,2HAA2H;QAC3H,gJAAgJ;QAChJ,gDAAgD,cAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG;QAC9F,oCAAoC,cAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,oDAAoD;QAChI,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,kIAAkI;KACnI,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,54 @@
|
|
|
1
|
+
Feature: A site on Docker Compose and on Kubernetes
|
|
2
|
+
The builder builds on DDEV by default, and with --runtime on Docker Compose, Podman, Kubernetes, Lando or
|
|
3
|
+
Docksal. A site built on Docker Compose or Kubernetes has the row a DDEV site has: its state, its own
|
|
4
|
+
address, the runtime's menu, and the test users of the plugin in its Tests menu.
|
|
5
|
+
|
|
6
|
+
# Each scenario drives a real site of that runtime, built with cmd-learnpress-project.sh --runtime: the first running
|
|
7
|
+
# one the workspace holds that the plugin claims. Without one it is skipped, with the reason. In the plugin's CI the
|
|
8
|
+
# Docker Compose site is the one the manifest's featuresSite builds.
|
|
9
|
+
|
|
10
|
+
@needs-runtime-docker @needs-platform-learnpress
|
|
11
|
+
Scenario: A site built 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-learnpress
|
|
19
|
+
Scenario: The Tests menu of a site on Docker Compose offers the test users
|
|
20
|
+
Given I am on the folder of the "docker" site
|
|
21
|
+
When I open the "tests" menu of the "docker" site
|
|
22
|
+
Then the open menu should offer "Add the test users"
|
|
23
|
+
And the open menu should offer "Cancel the test users"
|
|
24
|
+
|
|
25
|
+
@needs-runtime-docker @needs-platform-learnpress
|
|
26
|
+
Scenario: The site on Docker Compose is installed: its course list and a course of the sample content
|
|
27
|
+
Given I am on the folder of the "docker" site
|
|
28
|
+
When I open "/courses/" on the "docker" site
|
|
29
|
+
Then I should see "Courses"
|
|
30
|
+
When I open "/courses/webship-testing-basics/" on the "docker" site
|
|
31
|
+
Then I should see "Webship Testing Basics"
|
|
32
|
+
|
|
33
|
+
@needs-runtime-kubernetes @needs-platform-learnpress
|
|
34
|
+
Scenario: A site built 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
|
|
40
|
+
|
|
41
|
+
@needs-runtime-kubernetes @needs-platform-learnpress
|
|
42
|
+
Scenario: The Tests menu of a site on Kubernetes offers the test users
|
|
43
|
+
Given I am on the folder of the "kubernetes" site
|
|
44
|
+
When I open the "tests" menu of the "kubernetes" site
|
|
45
|
+
Then the open menu should offer "Add the test users"
|
|
46
|
+
And the open menu should offer "Cancel the test users"
|
|
47
|
+
|
|
48
|
+
@needs-runtime-kubernetes @needs-platform-learnpress
|
|
49
|
+
Scenario: The site on Kubernetes is installed: its course list and a course of the sample content
|
|
50
|
+
Given I am on the folder of the "kubernetes" site
|
|
51
|
+
When I open "/courses/" on the "kubernetes" site
|
|
52
|
+
Then I should see "Courses"
|
|
53
|
+
When I open "/courses/webship-testing-basics/" on the "kubernetes" site
|
|
54
|
+
Then I should see "Webship Testing Basics"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Feature: The LearnPress plugin on the dashboard
|
|
2
|
+
Once the plugin is activated and installed, with the WordPress plugin it needs, the sites folders offer the
|
|
3
|
+
LearnPress builder, each AI folder lists the items of its kind the plugin ships, and the Settings page lists the
|
|
4
|
+
plugin with its own page.
|
|
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 "LearnPress"
|
|
10
|
+
When I go to "/settings/plugin/learnpress"
|
|
11
|
+
Then I should see "@webship.co/workspace-learnpress"
|
|
12
|
+
And I should see "cmd-learnpress-project.sh"
|
|
13
|
+
And I should see "cmd-tools-learnpress-courses.sh"
|
|
14
|
+
And I should see "learnpress-site-builder"
|
|
15
|
+
|
|
16
|
+
# The plugin builds on the WordPress plugin: activating it with what it needs brings that one too.
|
|
17
|
+
Scenario: The WordPress plugin it needs is on Settings as well
|
|
18
|
+
Given I am on "/settings/plugin/wordpress"
|
|
19
|
+
Then I should see "@webship.co/workspace-wordpress"
|
|
20
|
+
And I should see "cmd-wordpress-project.sh"
|
|
21
|
+
|
|
22
|
+
Scenario: A sites folder offers the LearnPress builder next to the WordPress one
|
|
23
|
+
Given I am on "/dev"
|
|
24
|
+
Then "option[value='cmd-learnpress-project.sh']" should be attached
|
|
25
|
+
And "option[value='cmd-wordpress-project.sh']" should be attached
|
|
26
|
+
|
|
27
|
+
# The AI folders are searched by name: with every plugin on, a folder lists more than one page of items.
|
|
28
|
+
Scenario: The AI Agents folder lists the agents the plugin ships
|
|
29
|
+
Given I am on "/ai-agents?q=learnpress-"
|
|
30
|
+
Then I should see "learnpress-site-builder"
|
|
31
|
+
And I should see "learnpress-tester"
|
|
32
|
+
|
|
33
|
+
Scenario: The AI Skills folder lists the skill the plugin ships
|
|
34
|
+
Given I am on "/ai-skills?q=learnpress-scenarios"
|
|
35
|
+
Then I should see "learnpress-scenarios"
|
|
36
|
+
|
|
37
|
+
Scenario: The AI Commands folder lists the command the plugin ships
|
|
38
|
+
Given I am on "/ai-commands?q=learnpress-test"
|
|
39
|
+
Then I should see "learnpress-test"
|
|
40
|
+
|
|
41
|
+
Scenario: The AI Prompts folder lists the prompts the plugin ships
|
|
42
|
+
Given I am on "/ai-prompts?q=learnpress-"
|
|
43
|
+
Then I should see "learnpress-build-and-test"
|
|
44
|
+
And I should see "learnpress-quiz-round"
|
package/package.json
CHANGED
|
@@ -1,6 +1,104 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webship.co/workspace-learnpress",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "LearnPress for Webship Workspace, on top of its WordPress plugin: the builder (`cmd-learnpress-project.sh`) in every sites folder, a site of courses with LearnPress's pages and roles, the default accounts (one per place in the courses), the sample courses (two free courses, their lessons, a quiz, an enrolment), the courses' tool (`cmd-tools-learnpress-courses.sh`), the LearnPress step pack wired into the testing setup next to the WordPress one, and its AI items in their folders: two agents, a skill, a command and two prompts.",
|
|
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-learnpress.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": "learnpress",
|
|
32
|
+
"label": "LearnPress",
|
|
33
|
+
"needs": [
|
|
34
|
+
[
|
|
35
|
+
"dev",
|
|
36
|
+
"test",
|
|
37
|
+
"sandboxes",
|
|
38
|
+
"demos"
|
|
39
|
+
],
|
|
40
|
+
"wordpress",
|
|
41
|
+
"ai-agents",
|
|
42
|
+
"ai-skills",
|
|
43
|
+
"ai-commands",
|
|
44
|
+
"ai-prompts"
|
|
45
|
+
],
|
|
46
|
+
"commands": {
|
|
47
|
+
"types": [
|
|
48
|
+
"sites"
|
|
49
|
+
],
|
|
50
|
+
"workspaces": [
|
|
51
|
+
"dev",
|
|
52
|
+
"test",
|
|
53
|
+
"sandboxes",
|
|
54
|
+
"demos"
|
|
55
|
+
],
|
|
56
|
+
"files": [
|
|
57
|
+
"commands/cmd-learnpress-project.sh",
|
|
58
|
+
"commands/cmd-tools-learnpress-courses.sh"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"functions": [
|
|
63
|
+
"scripts/functions/fun-learnpress.sh"
|
|
64
|
+
],
|
|
65
|
+
"args": [
|
|
66
|
+
"scripts/args/arg-learnpress.sh",
|
|
67
|
+
"scripts/args/arg-learnpress-courses.sh"
|
|
68
|
+
],
|
|
69
|
+
"machine": [
|
|
70
|
+
"testing/courses.feature",
|
|
71
|
+
"scripts/learning-site.php"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"ai": {
|
|
75
|
+
"agents": [
|
|
76
|
+
"ai/agents/learnpress-site-builder.md",
|
|
77
|
+
"ai/agents/learnpress-tester.md"
|
|
78
|
+
],
|
|
79
|
+
"skills": [
|
|
80
|
+
"ai/skills/learnpress-scenarios"
|
|
81
|
+
],
|
|
82
|
+
"commands": [
|
|
83
|
+
"ai/commands/learnpress-test.md"
|
|
84
|
+
],
|
|
85
|
+
"prompts": [
|
|
86
|
+
"ai/prompts/learnpress-build-and-test.md",
|
|
87
|
+
"ai/prompts/learnpress-quiz-round.md"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
"features": [
|
|
91
|
+
"features/learnpress.feature",
|
|
92
|
+
"features/learnpress-runtimes.feature"
|
|
93
|
+
],
|
|
94
|
+
"featuresSite": "cmd-learnpress-project.sh ci-learnpress --install --add-users --sample-course --runtime docker"
|
|
95
|
+
},
|
|
96
|
+
"devDependencies": {
|
|
97
|
+
"@types/node": "^24.0.0",
|
|
98
|
+
"@webship.co/workspace-plugin-api": "^1.0.11",
|
|
99
|
+
"typescript": "^5.9.0"
|
|
100
|
+
},
|
|
101
|
+
"publishConfig": {
|
|
102
|
+
"access": "public"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
argparse "$@" <<ARGEOF || exit 1
|
|
4
|
+
parser.add_argument('PROJECT_NAME',
|
|
5
|
+
help='The name of the project: a site of this folder that has LearnPress.')
|
|
6
|
+
parser.add_argument('-a', '--add-users',
|
|
7
|
+
action='store_true',
|
|
8
|
+
default=False,
|
|
9
|
+
help='Add the default accounts, one per place in the courses: administrator, instructor, student and student2. An account that is there keeps its password and gets its role and its name back.')
|
|
10
|
+
parser.add_argument('-c', '--cancel-users',
|
|
11
|
+
action='store_true',
|
|
12
|
+
default=False,
|
|
13
|
+
help='Delete the default accounts, with their courses, enrolments, progress and history; --add-users then --sample-course bring them back.')
|
|
14
|
+
parser.add_argument('-s', '--sample-course',
|
|
15
|
+
action='store_true',
|
|
16
|
+
default=False,
|
|
17
|
+
help='Add the courses the test scenarios name (what is there already is kept): two free courses of the instructor, their lessons, a quiz, the student enrolled in the first.')
|
|
18
|
+
parser.add_argument('-t', '--tidy',
|
|
19
|
+
action='store_true',
|
|
20
|
+
default=False,
|
|
21
|
+
help='Take away what a stopped test run left (the orders, enrolments, progress, quiz attempts and history of the learners, the courses, lessons and quizzes named "Webship test …"), and enrol the student in the first course again.')
|
|
22
|
+
ARGEOF
|
|
@@ -0,0 +1,40 @@
|
|
|
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, and its name on the container runtime (on DDEV its host name too).')
|
|
6
|
+
parser.add_argument('--runtime',
|
|
7
|
+
dest='RUNTIME',
|
|
8
|
+
default="_none_",
|
|
9
|
+
choices=['ddev', 'docker', 'podman', 'kubernetes', 'lando', 'docksal'],
|
|
10
|
+
help='The container runtime to build on: ddev (the default, or container.runtime of settings.yml), docker (Docker Compose), podman, kubernetes, lando or docksal.')
|
|
11
|
+
parser.add_argument('-v', '--version',
|
|
12
|
+
default="${site_version}",
|
|
13
|
+
help='The LearnPress release to add, from the plugin directory: latest, or a version number. Example: --version 4.5.0 [default %(default)s]')
|
|
14
|
+
parser.add_argument('-w', '--wordpress-version',
|
|
15
|
+
default="${wordpress_version}",
|
|
16
|
+
help='The WordPress release to download: latest, nightly, or a version number. Example: --wordpress-version 7.1.5 [default %(default)s]')
|
|
17
|
+
parser.add_argument('-i', '--install',
|
|
18
|
+
action='store_true',
|
|
19
|
+
default=False,
|
|
20
|
+
help='Install WordPress with the workspace account as the administrator, and add LearnPress: its activation makes its tables, its pages (Courses, Profile, Checkout, Instructors) and its roles.')
|
|
21
|
+
parser.add_argument('-a', '--add-users',
|
|
22
|
+
action='store_true',
|
|
23
|
+
default=False,
|
|
24
|
+
help='With --install, add the default accounts, one per place in the courses: administrator, instructor, student and student2, the ones the test scenarios log in as.')
|
|
25
|
+
parser.add_argument('-s', '--sample-course',
|
|
26
|
+
action='store_true',
|
|
27
|
+
default=False,
|
|
28
|
+
help='With --install, add the courses the test scenarios name: two free courses of the instructor, their sections and lessons, a quiz with three questions, and the student enrolled in the first.')
|
|
29
|
+
parser.add_argument('-l', '--launch',
|
|
30
|
+
action='store_true',
|
|
31
|
+
default=False,
|
|
32
|
+
help='Open the course list in a browser when it is ready.')
|
|
33
|
+
parser.add_argument('--locale',
|
|
34
|
+
default="en_US",
|
|
35
|
+
help='The language WordPress is downloaded in. Example: --locale ar [default %(default)s]')
|
|
36
|
+
parser.add_argument('--php-version',
|
|
37
|
+
default="",
|
|
38
|
+
choices=['8.5', '8.4', '8.3', '8.2'],
|
|
39
|
+
help='PHP version for the project container; empty means the default of the container tool. Example: --php-version 8.4')
|
|
40
|
+
ARGEOF
|