@webship.co/workspace-upsun 0.0.0-stage → 1.0.0-beta1

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,38 @@
1
- # Temporary Holding Version
1
+ # @webship.co/workspace-upsun
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
+ Upsun for the [Webship Workspace](https://github.com/webship/workspace) dashboard: the **UPSUN**
4
+ menu on every site row (link, environments and live sites, activities, the deploy log, deploy, get
5
+ database and files, branch and data), a live-site chip on the project card, "Link to Upsun" when a new folder
6
+ is made, and the `upsun` CLI in the dashboard container with the host's session mounted in.
7
+
8
+ ## Use it
9
+
10
+ ```bash
11
+ cd ~/workspace
12
+ bash core/scripts/plugins.sh --require github:webship/workspace-upsun # npm install into the dashboard
13
+ bash core/scripts/plugins.sh --activate upsun # plugins.upsun in settings.yml
14
+ bash core/scripts/plugins.sh --install upsun # scripts, commands, compose, theme
15
+ bash core/scripts/plugins.sh --configure upsun # core/config/plugin.upsun.settings.yml
16
+ ```
17
+
18
+ The same four steps are buttons on the dashboard's **Settings → Plugins** page. `--install` is
19
+ idempotent and says when the dashboard container needs `ddev restart` (it does the first time: the
20
+ compose file mounts `~/.upsun-cli`).
21
+
22
+ ## What the package holds
23
+
24
+ | Path | What it is |
25
+ | --- | --- |
26
+ | `src/index.ts` | `register(api)`: `registerHosting(api, upsunProvider(api))` — the menu, chip, modal, pull flow and New-folder section are the hosting family's (`@webship.co/workspace-hosting`) |
27
+ | `src/lib/provider.ts` | The Upsun provider: the link, the token, the environments and their URLs, the verbs (status, activities, logs, deploy), the pulls, the console |
28
+ | `src/lib/link.ts` | Whether a project is linked, and to what (its `.upsun/local/project.yaml` and `upsun` remote) |
29
+ | `commands/cmd-tools-upsun.sh` | The per-workspace command, installed into every `sites` workspace |
30
+ | `scripts/functions/fun-upsun.sh` | The bash functions behind it, sourced by bootstrap once installed |
31
+ | `scripts/args/arg-upsun.sh` | Its argparse |
32
+ | `scripts/upsun-ai.sh` | Upsun's agent skill and read-only MCP |
33
+ | `scripts/host-install.sh` | The host side: the CLI, the token check, the AI toolkit |
34
+ | `ddev/docker-compose.upsun-cli.yaml` | Mounts the host's upsun session into the dashboard container |
35
+ | `config/plugin.upsun.settings.yml` | The settings template (`cli_token`) |
36
+ | `config/theme.upsun.yml` | A dashboard theme in Upsun's colours |
37
+
38
+ The `workspacePlugin` block in `package.json` is the manifest the installer reads.
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Installed by the Upsun plugin (plugins.sh --install upsun); __WORKSPACE__ is the workspace it was installed into.
4
+ #
5
+ # The local ⇄ cloud bridge for one project: show its Upsun link and
6
+ # environments, link it (upsun project:set-remote), scaffold its
7
+ # .upsun/config.yaml, or deploy the current branch with upsun push.
8
+
9
+ # Bootstrap.
10
+ # Find the workspace tooling from this script, so a fresh clone needs no setup.
11
+ WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
12
+ source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
13
+
14
+ # Load workspace settings and extra lists.
15
+ eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.__WORKSPACE__.settings.yml);
16
+
17
+ ARGPARSE_DESCRIPTION="Show, link or deploy a __WORKSPACE__ project on Upsun"
18
+ # The args file comes with the plugin: core/scripts/plugins/upsun/ is where plugins.sh --install puts it.
19
+ source ${WORKSPACE_SCRIPTS}/plugins/upsun/args/arg-upsun.sh || exit 1 ;
20
+
21
+ shift $#;
22
+
23
+ upsun_project_tool ;
@@ -0,0 +1,7 @@
1
+ # Upsun — core/config/plugin.upsun.settings.yml
2
+ #
3
+ # The Upsun CLI inside the dashboard container. The host login (`upsun login`) lives in the
4
+ # system keyring, which a container cannot reach, so the dashboard needs an API token: Upsun
5
+ # console → My profile → API tokens. Not an Atlassian token (those start ATATT): Upsun refuses
6
+ # them with a message that reads like an expiry. Injected only into Upsun jobs, never printed.
7
+ cli_token: CHANGE_ME
@@ -0,0 +1,4 @@
1
+ # Labels for core/config/plugin.upsun.settings.yml, merged into the Settings page.
2
+ cli_token:
3
+ label: Upsun API token
4
+ info: 'What "Get database & files" and the environment lists use to reach Upsun from the dashboard: an API token from the Upsun console (My profile → API tokens). Not an Atlassian token.'
@@ -0,0 +1,174 @@
1
+ # UPSUN — core/config/theme.upsun.yml
2
+ #
3
+ # A style in the shape of the Upsun console. The values were read out of the console's own design
4
+ # system — 584 custom properties on auth.upsun.com, which is the same system the console wears — so
5
+ # the indigo, the ebony and the ice below are the ones it actually uses, not colours picked off a
6
+ # screenshot.
7
+ #
8
+ # Its signatures: the #6046ff indigo primary, a very dark ebony-to-night ink, an #f2f3f4 page under
9
+ # white cards, and Open Sans throughout. Open Sans is not vendored here, so a machine without it
10
+ # falls back through the stack.
11
+
12
+ # What was measured and what was not, because the two are different here.
13
+ #
14
+ # The COLOURS are the console's own, read from the 584 custom properties its design system declares.
15
+ # The FAMILY is its own too: Open Sans, throughout, for headings as well as body.
16
+ #
17
+ # The heading SCALE is not. The page those values came from leaves bare headings at the browser's
18
+ # defaults — 32 / 24 / 18.72px and so on — which is the user agent stylesheet, not a design system,
19
+ # and the console itself is behind a login. So the heading ramp here is this workspace's, not
20
+ # Upsun's, and that is stated rather than implied by a number that looks measured.
21
+
22
+ name: UPSUN
23
+
24
+ tokens:
25
+ brand-primary: "#6046ff"
26
+ brand-secondary: "#302f45"
27
+ brand-accent: "#efe7ff"
28
+ brand-dark: "#01001a"
29
+ brand-light: "#f5f7fa"
30
+ subtle-light: "#f5f7fa"
31
+ subtle-brand: "#efedff"
32
+ subtle-accent: "#efe7ff"
33
+ text-default: "#1a192b"
34
+ text-subtle: "#5f5e70"
35
+ text-inverse: "#ffffff"
36
+ text-light: "#f5f7fa"
37
+ text-brand: "var(--brand-primary)"
38
+ text-accent: "var(--brand-accent)"
39
+ font-primary: "\"Open Sans\", Helvetica, Arial, sans-serif"
40
+ font-secondary: "\"Open Sans\", Helvetica, Arial, sans-serif"
41
+ font-code: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
42
+ weight-regular: 400
43
+ weight-semibold: 600
44
+ leading-heading: 1.4
45
+ leading-display: 1.3
46
+ leading-body: 1.5
47
+ tracking-wide: 0.0625em
48
+ size-h1: 2rem
49
+ size-h2: 1.625rem
50
+ size-h3: 1.5rem
51
+ size-h4: 1.25rem
52
+ size-h5: 1.125rem
53
+ size-h6: 1rem
54
+ size-body: 0.9375rem
55
+ size-small: 0.875rem
56
+ type-h1: "var(--weight-semibold) var(--size-h1)/1.2 var(--font-primary)"
57
+ type-h2: "var(--weight-semibold) var(--size-h2)/1.25 var(--font-primary)"
58
+ type-h3: "var(--weight-semibold) var(--size-h3)/1.25 var(--font-primary)"
59
+ type-h4: "var(--weight-semibold) var(--size-h4)/1.3 var(--font-primary)"
60
+ type-h5: "var(--weight-semibold) var(--size-h5)/1.35 var(--font-primary)"
61
+ type-h6: "var(--weight-semibold) var(--size-h6)/1 var(--font-primary)"
62
+ type-body: "var(--weight-regular) var(--size-body)/var(--leading-body) var(--font-primary)"
63
+ type-body-sm: "var(--weight-regular) var(--size-small)/1.45 var(--font-primary)"
64
+ type-label: "var(--weight-semibold) var(--size-body)/1 var(--font-primary)"
65
+ type-caption: "var(--weight-regular) var(--size-small)/1.35 var(--font-primary)"
66
+ type-mono: "var(--weight-regular) var(--size-body)/1.5 var(--font-code)"
67
+ type-mono-sm: "var(--weight-regular) var(--size-small)/1.4 var(--font-code)"
68
+ tracking-h1: normal
69
+ tracking-h2: normal
70
+ tracking-h3: normal
71
+ tracking-h4: normal
72
+ tracking-h5: normal
73
+ tracking-h6: "var(--tracking-wide)"
74
+ surface: "#f2f3f4"
75
+ surface-card: "#ffffff"
76
+ surface-muted: "#f9f9f9"
77
+ surface-input: "#ffffff"
78
+ text-subtle-2: "#302f45"
79
+ line: "#e7e7e7"
80
+ line-strong: "#c9d0e4"
81
+ link: "#6046ff"
82
+ brand-pressed: "#3a2a99"
83
+ brand-2-pressed: "#1a192b"
84
+ focus-ring: "#86b5ff4c"
85
+ ok: "#23b7b7"
86
+ ok-soft: "#d6f6ef"
87
+ pcard-tool-label: 0rem
88
+ ok-ink: "#188181"
89
+ danger: "#fb3728"
90
+ danger-soft: "#fce1e1"
91
+ danger-ink: "#6d144f"
92
+ danger-armed: "#ff5d25"
93
+ danger-text: "#fb3728"
94
+ warning: "#eda900"
95
+ warning-soft: "#fcf4db"
96
+ warning-ink: "#9a6f1e"
97
+ info: "#86b5ff"
98
+ info-soft: "#efedff"
99
+ info-ink: "#302f45"
100
+ success: "#146c43"
101
+ success-soft: "#d0e2d9"
102
+ success-ink: "#0f5132"
103
+ busy-soft: "var(--subtle-brand)"
104
+ busy-ink: "var(--brand-secondary)"
105
+ accent-soft: "#efe7ff"
106
+ accent-ink: "#9d67ff"
107
+ chip-bg: "#6046ff"
108
+ chip-ink: "#ffffff"
109
+ shadow-card: "0 4px 16px rgba(35, 41, 70, .06)"
110
+ shadow-card-hover: "0 12px 28px rgba(43, 68, 124, .16)"
111
+ shadow-float: "0 1.5rem 3rem rgba(43, 68, 124, .28)"
112
+ shadow-toast: "0 14px 34px rgba(35, 41, 70, .26)"
113
+ toast-ring: "rgba(255, 255, 255, .9)"
114
+ code-bg: "#1a192b"
115
+ code-ink: "#f5f7fa"
116
+ terminal-ink: "#c9f7d4"
117
+ media-bg: "#000000"
118
+ paper: "#ffffff"
119
+ checker-a: "#dcdcdc"
120
+ checker-b: "#d8d8d8"
121
+ checker-bg: "#f4f4f4"
122
+ overlay: "#1a1a2be5"
123
+ brand-1: "var(--brand-primary)"
124
+ brand-2: "var(--brand-secondary)"
125
+ brand-3: "var(--brand-accent)"
126
+ brand-grad: "linear-gradient(135deg, var(--brand-primary), var(--brand-secondary))"
127
+ ink: "var(--brand-secondary)"
128
+
129
+ # The dark half.
130
+ dark:
131
+ surface: "#1a192b"
132
+ surface-card: "#232235"
133
+ surface-muted: "#302f45"
134
+ surface-input: "#1a1a2b"
135
+ text-default: "#f5f7fa"
136
+ text-subtle-2: "#c9d0e4"
137
+ text-subtle: "#98a0ab"
138
+ line: "#4a495e"
139
+ line-strong: "#5f5e70"
140
+ link: "#86b5ff"
141
+ brand-pressed: "#9d67ff"
142
+ brand-2-pressed: "#302f45"
143
+ focus-ring: "#86b5ff4c"
144
+ ok-soft: "#188181"
145
+ ok-ink: "#d6f6ef"
146
+ danger-soft: "#6d144f"
147
+ danger-ink: "#fce1e1"
148
+ danger-armed: "#e0466b"
149
+ danger-text: "#ff8fa3"
150
+ warning-soft: "#9a6f1e"
151
+ warning-ink: "#fcf4db"
152
+ info-soft: "#302f45"
153
+ info-ink: "#86b5ff"
154
+ success-soft: "#10291d"
155
+ success-ink: "#a3d9bd"
156
+ busy-soft: "#1a2440"
157
+ busy-ink: "#b9c9ff"
158
+ accent-soft: "#4a495e"
159
+ accent-ink: "#c9d0e4"
160
+ chip-bg: "#6046ff"
161
+ chip-ink: "#ffffff"
162
+ subtle-light: "#232235"
163
+ subtle-brand: "#302f45"
164
+ subtle-accent: "#4a495e"
165
+ shadow-card: "0 4px 16px rgba(0, 0, 0, .35)"
166
+ shadow-card-hover: "0 12px 28px rgba(0, 0, 0, .50)"
167
+ shadow-float: "0 1.5rem 3rem rgba(0, 0, 0, .55)"
168
+ shadow-toast: "0 14px 34px rgba(0, 0, 0, .50)"
169
+ toast-ring: "rgba(0, 0, 0, .5)"
170
+ checker-a: "#2a3550"
171
+ checker-b: "#26314a"
172
+ checker-bg: "#131b2c"
173
+ overlay: "#01001ae5"
174
+ ink: "var(--text-default)"
@@ -0,0 +1,8 @@
1
+ # The upsun CLI session, shared FROM THE HOST like the twg one: one login, token
2
+ # refreshes land on the host, rebuilds keep it. This is what turns the Upsun
3
+ # branch-and-data commands from shown-to-copy into runnable dashboard actions.
4
+ # A machine without a session mounts an empty dir and the actions say so.
5
+ services:
6
+ web:
7
+ volumes:
8
+ - "${HOME}/.upsun-cli:/home/${USER}/.upsun-cli:rw"
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Upsun for Webship Workspace.
3
+ *
4
+ * The UPSUN menu on every site row (link, environments, live sites, activities, the deploy log, a
5
+ * deploy, get database and files, branch and data), a live-site chip on the project card, a "Link
6
+ * to Upsun" option when a new folder is made, and the `/upsun-site/<workspace>/<project>` jump to
7
+ * the environment the local code is on. All of that is the hosting family's surface
8
+ * (@webship.co/workspace-hosting); this package is the Upsun provider plus what the installer places.
9
+ *
10
+ * Everything the dashboard is asked for goes through `api`; this package requires nothing from
11
+ * the dashboard's own files, so it can be installed from npm and removed without a trace.
12
+ */
13
+ import type { PluginApi } from '@webship.co/workspace-plugin-api';
14
+ import { upsunProvider } from './lib/provider';
15
+ export { upsunLinkOf } from './lib/link';
16
+ export { upsunProvider };
17
+ export declare function register(api: PluginApi): void;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /**
3
+ * Upsun for Webship Workspace.
4
+ *
5
+ * The UPSUN menu on every site row (link, environments, live sites, activities, the deploy log, a
6
+ * deploy, get database and files, branch and data), a live-site chip on the project card, a "Link
7
+ * to Upsun" option when a new folder is made, and the `/upsun-site/<workspace>/<project>` jump to
8
+ * the environment the local code is on. All of that is the hosting family's surface
9
+ * (@webship.co/workspace-hosting); this package is the Upsun provider plus what the installer places.
10
+ *
11
+ * Everything the dashboard is asked for goes through `api`; this package requires nothing from
12
+ * the dashboard's own files, so it can be installed from npm and removed without a trace.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.upsunProvider = exports.upsunLinkOf = void 0;
16
+ exports.register = register;
17
+ const workspace_hosting_1 = require("@webship.co/workspace-hosting");
18
+ const provider_1 = require("./lib/provider");
19
+ Object.defineProperty(exports, "upsunProvider", { enumerable: true, get: function () { return provider_1.upsunProvider; } });
20
+ var link_1 = require("./lib/link");
21
+ Object.defineProperty(exports, "upsunLinkOf", { enumerable: true, get: function () { return link_1.upsunLinkOf; } });
22
+ function register(api) {
23
+ (0, workspace_hosting_1.registerHosting)(api, (0, provider_1.upsunProvider)(api));
24
+ }
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAUH,4BAEC;AATD,qEAAgE;AAEhE,6CAA+C;AAGtC,8FAHA,wBAAa,OAGA;AADtB,mCAAyC;AAAhC,mGAAA,WAAW,OAAA;AAGpB,SAAgB,QAAQ,CAAC,GAAc;IACrC,IAAA,mCAAe,EAAC,GAAG,EAAE,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The Upsun bridge: environments, live URLs, and getting a database and files into the local site.
3
+ *
4
+ * A factory over the dashboard's `api`: everything it needs comes through `api.lib` and
5
+ * `api.settings`, so this file imports nothing from the dashboard.
6
+ */
7
+ import type { ActionContext, PluginApi } from '@webship/workspace-plugin-api';
8
+ export interface EnvRow {
9
+ title: string;
10
+ envId: string;
11
+ status: string;
12
+ url?: string;
13
+ }
14
+ export interface EnvInfo {
15
+ id: string | null;
16
+ rows: EnvRow[];
17
+ branch?: string | null;
18
+ env?: string | null;
19
+ why?: string;
20
+ }
21
+ export default function environments(api: PluginApi): {
22
+ upsunEnvironments: (dir: string, projectName: string) => Promise<EnvInfo | null>;
23
+ upsunJobEnv: () => NodeJS.ProcessEnv | null;
24
+ actions: {
25
+ envs: ({ form, send, workspace }: ActionContext) => Promise<void>;
26
+ 'pull-form': ({ form, send, workspace }: ActionContext) => Promise<void>;
27
+ pull: ({ form, send, workspace }: ActionContext) => Promise<void>;
28
+ environments: ({ form, send, workspace }: ActionContext) => Promise<void>;
29
+ 'site-url': ({ form, send, workspace }: ActionContext) => Promise<void>;
30
+ };
31
+ };