jive-abstract-app-github-pages 0.2.0 → 0.2.1-latest-darwin-arm64
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/multi-call-binary +4 -0
- package/package.json +11 -47
- package/README.md +0 -155
- package/bin/jive-app-github-pages +0 -34
- package/bin/package.json +0 -1
- package/dist/entrypoints/jive-app-github-pages.js +0 -18
- package/dist/entrypoints/jive-app-github-pages.js.map +0 -1
- package/dist/index.js +0 -8
- package/dist/index.js.map +0 -1
- package/dist/internal/commands/cicd/audit.js +0 -10
- package/dist/internal/commands/cicd/audit.js.map +0 -1
- package/dist/internal/commands/cicd/build.js +0 -8
- package/dist/internal/commands/cicd/build.js.map +0 -1
- package/dist/internal/commands/cicd/deploy-plan.js +0 -19
- package/dist/internal/commands/cicd/deploy-plan.js.map +0 -1
- package/dist/internal/commands/cicd/deploy.js +0 -8
- package/dist/internal/commands/cicd/deploy.js.map +0 -1
- package/dist/internal/commands/cicd/get-config.js +0 -9
- package/dist/internal/commands/cicd/get-config.js.map +0 -1
- package/dist/internal/commands/cicd/index.js +0 -16
- package/dist/internal/commands/cicd/index.js.map +0 -1
- package/dist/internal/commands/cicd/upload-artifacts.js +0 -6
- package/dist/internal/commands/cicd/upload-artifacts.js.map +0 -1
- package/dist/internal/commands/create.js +0 -32
- package/dist/internal/commands/create.js.map +0 -1
- package/dist/internal/commands/dev.js +0 -11
- package/dist/internal/commands/dev.js.map +0 -1
- package/dist/internal/common/command.js +0 -5
- package/dist/internal/common/command.js.map +0 -1
- package/dist/internal/common/constants.js +0 -30
- package/dist/internal/common/constants.js.map +0 -1
- package/dist/internal/common/deploy-token.js +0 -17
- package/dist/internal/common/deploy-token.js.map +0 -1
- package/dist/internal/common/layer.js +0 -14
- package/dist/internal/common/layer.js.map +0 -1
- package/dist/internal/modules/deployer/impl.js +0 -111
- package/dist/internal/modules/deployer/impl.js.map +0 -1
- package/dist/internal/modules/deployer/interface.js +0 -1
- package/dist/internal/modules/deployer/interface.js.map +0 -1
- package/dist/internal/modules/https-probe/impl.js +0 -15
- package/dist/internal/modules/https-probe/impl.js.map +0 -1
- package/dist/internal/modules/https-probe/interface.js +0 -1
- package/dist/internal/modules/https-probe/interface.js.map +0 -1
- package/dist/internal/modules/index.js +0 -13
- package/dist/internal/modules/index.js.map +0 -1
- package/dist/internal/modules/package/impl.js +0 -16
- package/dist/internal/modules/package/impl.js.map +0 -1
- package/dist/internal/modules/package/interface.js +0 -1
- package/dist/internal/modules/package/interface.js.map +0 -1
- package/dist/internal/modules/pages-api/impl.js +0 -61
- package/dist/internal/modules/pages-api/impl.js.map +0 -1
- package/dist/internal/modules/pages-api/interface.js +0 -1
- package/dist/internal/modules/pages-api/interface.js.map +0 -1
- package/dist/internal/modules/pages-api/recorded/README.md +0 -11
- package/dist/internal/modules/pages-api/recorded/build-built.json +0 -1
- package/dist/internal/modules/pages-api/recorded/build-errored.json +0 -1
- package/dist/internal/modules/pages-api/recorded/site-legacy-gh-pages.json +0 -1
- package/dist/internal/modules/pages-api/recorded/site-none.json +0 -5
- package/dist/internal/modules/publishing-branch/impl.js +0 -83
- package/dist/internal/modules/publishing-branch/impl.js.map +0 -1
- package/dist/internal/modules/publishing-branch/interface.js +0 -1
- package/dist/internal/modules/publishing-branch/interface.js.map +0 -1
- package/dist/internal/modules/scaffold/impl.js +0 -37
- package/dist/internal/modules/scaffold/impl.js.map +0 -1
- package/dist/internal/modules/scaffold/interface.js +0 -1
- package/dist/internal/modules/scaffold/interface.js.map +0 -1
- package/dist/internal/modules/site/impl.js +0 -71
- package/dist/internal/modules/site/impl.js.map +0 -1
- package/dist/internal/modules/site/interface.js +0 -1
- package/dist/internal/modules/site/interface.js.map +0 -1
- package/dist/internal/public/manifest.js +0 -95
- package/dist/internal/public/manifest.js.map +0 -1
- package/dist/internal/public/scaffold.js +0 -62
- package/dist/internal/public/scaffold.js.map +0 -1
- package/dist/internal/public/site-url.js +0 -16
- package/dist/internal/public/site-url.js.map +0 -1
- package/postinstall.cjs +0 -663
- package/src/entrypoints/jive-app-github-pages.ts +0 -19
- package/src/index.ts +0 -18
- package/src/internal/commands/cicd/audit.ts +0 -14
- package/src/internal/commands/cicd/build.ts +0 -12
- package/src/internal/commands/cicd/deploy-plan.ts +0 -23
- package/src/internal/commands/cicd/deploy.ts +0 -12
- package/src/internal/commands/cicd/get-config.ts +0 -13
- package/src/internal/commands/cicd/index.ts +0 -16
- package/src/internal/commands/cicd/upload-artifacts.ts +0 -10
- package/src/internal/commands/create.ts +0 -36
- package/src/internal/commands/dev.ts +0 -11
- package/src/internal/common/command.ts +0 -7
- package/src/internal/common/constants.ts +0 -34
- package/src/internal/common/deploy-token.ts +0 -20
- package/src/internal/common/layer.ts +0 -25
- package/src/internal/modules/deployer/impl.ts +0 -119
- package/src/internal/modules/deployer/interface.ts +0 -20
- package/src/internal/modules/https-probe/impl.ts +0 -22
- package/src/internal/modules/https-probe/interface.ts +0 -10
- package/src/internal/modules/index.ts +0 -28
- package/src/internal/modules/package/impl.ts +0 -20
- package/src/internal/modules/package/interface.ts +0 -10
- package/src/internal/modules/pages-api/impl.ts +0 -86
- package/src/internal/modules/pages-api/interface.ts +0 -40
- package/src/internal/modules/pages-api/recorded/README.md +0 -11
- package/src/internal/modules/pages-api/recorded/build-built.json +0 -1
- package/src/internal/modules/pages-api/recorded/build-errored.json +0 -1
- package/src/internal/modules/pages-api/recorded/site-legacy-gh-pages.json +0 -1
- package/src/internal/modules/pages-api/recorded/site-none.json +0 -5
- package/src/internal/modules/publishing-branch/impl.ts +0 -95
- package/src/internal/modules/publishing-branch/interface.ts +0 -37
- package/src/internal/modules/scaffold/impl.ts +0 -42
- package/src/internal/modules/scaffold/interface.ts +0 -15
- package/src/internal/modules/site/impl.ts +0 -74
- package/src/internal/modules/site/interface.ts +0 -14
- package/src/internal/public/manifest.ts +0 -117
- package/src/internal/public/scaffold.ts +0 -129
- package/src/internal/public/site-url.ts +0 -18
package/package.json
CHANGED
|
@@ -1,56 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jive-abstract-app-github-pages",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"license": "MIT",
|
|
3
|
+
"version": "0.2.1-latest-darwin-arm64",
|
|
5
4
|
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"os": [
|
|
7
|
+
"darwin"
|
|
8
|
+
],
|
|
9
|
+
"cpu": [
|
|
10
|
+
"arm64"
|
|
11
|
+
],
|
|
12
|
+
"files": [
|
|
13
|
+
"multi-call-binary"
|
|
14
|
+
],
|
|
6
15
|
"description": "Jive abstract for static sites served by GitHub Pages: builds the site, then publishes it to the repository's gh-pages branch and has GitHub Pages build it, with its custom domain",
|
|
7
16
|
"repository": {
|
|
8
17
|
"type": "git",
|
|
9
18
|
"url": "git+https://github.com/jive-sh/jive-abstract-app-github-pages.git"
|
|
10
|
-
},
|
|
11
|
-
"main": "./dist/index.js",
|
|
12
|
-
"module": "./dist/index.js",
|
|
13
|
-
"types": "./src/index.ts",
|
|
14
|
-
"exports": {
|
|
15
|
-
".": {
|
|
16
|
-
"types": "./src/index.ts",
|
|
17
|
-
"import": "./dist/index.js"
|
|
18
|
-
},
|
|
19
|
-
"./README.md": "./README.md"
|
|
20
|
-
},
|
|
21
|
-
"files": [
|
|
22
|
-
"README.md",
|
|
23
|
-
"dist",
|
|
24
|
-
"src",
|
|
25
|
-
"bin",
|
|
26
|
-
"postinstall.cjs"
|
|
27
|
-
],
|
|
28
|
-
"scripts": {
|
|
29
|
-
"postinstall": "node ./postinstall.cjs"
|
|
30
|
-
},
|
|
31
|
-
"bin": {
|
|
32
|
-
"jive-app-github-pages": "./bin/jive-app-github-pages"
|
|
33
|
-
},
|
|
34
|
-
"optionalDependencies": {
|
|
35
|
-
"jive-abstract-app-github-pages-darwin-arm64": "npm:jive-abstract-app-github-pages@0.2.0-latest-darwin-arm64",
|
|
36
|
-
"jive-abstract-app-github-pages-darwin-x64": "npm:jive-abstract-app-github-pages@0.2.0-latest-darwin-x64",
|
|
37
|
-
"jive-abstract-app-github-pages-linux-arm64": "npm:jive-abstract-app-github-pages@0.2.0-latest-linux-arm64",
|
|
38
|
-
"jive-abstract-app-github-pages-linux-x64": "npm:jive-abstract-app-github-pages@0.2.0-latest-linux-x64",
|
|
39
|
-
"jive-abstract-app-github-pages-windows-x64": "npm:jive-abstract-app-github-pages@0.2.0-latest-windows-x64"
|
|
40
|
-
},
|
|
41
|
-
"jive": {
|
|
42
|
-
"daemons": [],
|
|
43
|
-
"completionCommands": [
|
|
44
|
-
"jive-app-github-pages"
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"@effect/platform-bun": "^4.0.0",
|
|
49
|
-
"effective-modules": "0.3.1-effect4",
|
|
50
|
-
"jive-abstract-library": "0.16.0"
|
|
51
|
-
},
|
|
52
|
-
"peerDependencies": {
|
|
53
|
-
"effect": "^4.0.0",
|
|
54
|
-
"typescript": "^5.9.3"
|
|
55
19
|
}
|
|
56
20
|
}
|
package/README.md
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
# jive-abstract-app-github-pages
|
|
2
|
-
|
|
3
|
-
A [Jive](https://github.com/jive-sh/jive) abstract for static sites served by [GitHub Pages](https://pages.github.com).
|
|
4
|
-
A site whose `package.json` extends it gets a full CI/CD pipeline with no pipeline code of its own: every push to
|
|
5
|
-
its deploy branch builds the site with whatever generator it uses (Astro, Vite, Bun's HTML bundler, plain files),
|
|
6
|
-
publishes the result to the repository's `gh-pages` branch, and waits until GitHub Pages reports it built.
|
|
7
|
-
|
|
8
|
-
Its CLI is `jive-app-github-pages`, so the target command for a new site is `jive create app github pages`. Today
|
|
9
|
-
the same thing is `jive-app-github-pages create <directory>`.
|
|
10
|
-
|
|
11
|
-
## Vocabulary
|
|
12
|
-
|
|
13
|
-
- **Site**: the folder the package's own build script writes, `outputDir`. Its contents are exactly what GitHub
|
|
14
|
-
Pages serves.
|
|
15
|
-
- **Publishing branch**: `gh-pages`. Each deploy adds one commit to it whose tree is the site, so its history is
|
|
16
|
-
the history of deploys. GitHub Pages serves it when the repository's Pages source is "Deploy from a branch",
|
|
17
|
-
`gh-pages`, `/`
|
|
18
|
-
([publishing source](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site)).
|
|
19
|
-
- **Custom domain**: the hostname GitHub Pages serves the site at instead of `https://<owner>.github.io/<repository>/`.
|
|
20
|
-
A branch-published site's custom domain is whatever its `CNAME` file names
|
|
21
|
-
([custom domains](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site)),
|
|
22
|
-
so the build writes that file from `domain`.
|
|
23
|
-
|
|
24
|
-
## Extending it
|
|
25
|
-
|
|
26
|
-
```jsonc
|
|
27
|
-
{
|
|
28
|
-
"$schema": "./package.schema.json",
|
|
29
|
-
"name": "@acme/docs",
|
|
30
|
-
"version": "0.1.0",
|
|
31
|
-
"license": "MIT",
|
|
32
|
-
"type": "module",
|
|
33
|
-
"scripts": {
|
|
34
|
-
"jive:cicd:get-config": "jive-app-github-pages cicd get-config",
|
|
35
|
-
"jive:cicd:build": "jive-app-github-pages cicd build",
|
|
36
|
-
"jive:cicd:audit": "jive-app-github-pages cicd audit",
|
|
37
|
-
"jive:cicd:deploy:plan": "jive-app-github-pages cicd deploy-plan",
|
|
38
|
-
"jive:cicd:upload-artifacts": "jive-app-github-pages cicd upload-artifacts",
|
|
39
|
-
"jive:cicd:deploy": "jive-app-github-pages cicd deploy",
|
|
40
|
-
"build": "astro build",
|
|
41
|
-
"dev": "jive-app-github-pages dev"
|
|
42
|
-
},
|
|
43
|
-
"devDependencies": { "jive-abstract-app-github-pages": "^0.1.0" },
|
|
44
|
-
"jive": {
|
|
45
|
-
"cicd": {
|
|
46
|
-
"deploy": { "verb": "Deploy to", "branches": { "main": ["Production"] }, "previews": false, "sequentially": true },
|
|
47
|
-
"runsOnPullRequests": true,
|
|
48
|
-
"runsOn": "ubuntu-latest",
|
|
49
|
-
"requiredSecrets": ["GH_PAGES_DEPLOY_TOKEN"]
|
|
50
|
-
},
|
|
51
|
-
"app-github-pages": {
|
|
52
|
-
"buildScript": "build",
|
|
53
|
-
"outputDir": "dist",
|
|
54
|
-
"domain": "docs.acme.com"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
| Field | Meaning |
|
|
61
|
-
| --- | --- |
|
|
62
|
-
| `buildScript` | The `package.json` script that writes the site into `outputDir`; the build hook runs `bun run <buildScript>`. |
|
|
63
|
-
| `outputDir` | The folder, relative to the package, holding the built site. Never the package itself, never outside it. |
|
|
64
|
-
| `domain` | A bare lowercase hostname (`docs.acme.com`, never `https://…`), or `null` for `https://<owner>.github.io/<repository>/`. |
|
|
65
|
-
|
|
66
|
-
Every field is required, so the schema shows everything you can configure. `jive-app-github-pages dev` keeps
|
|
67
|
-
`package.schema.json` current, so your editor checks the block as you type it. The hooks also enforce rules that
|
|
68
|
-
span fields:
|
|
69
|
-
|
|
70
|
-
- `cicd.deploy.previews` is false, and `cicd.deploy.branches` deploys at most one environment from one branch: a
|
|
71
|
-
repository has one GitHub Pages site, so there is nowhere else to deploy to.
|
|
72
|
-
- `cicd.requiredSecrets` includes `GH_PAGES_DEPLOY_TOKEN`, the token the deploy pushes with (see
|
|
73
|
-
[The deploy token](#the-deploy-token)). The pipeline passes the hooks only the secrets listed.
|
|
74
|
-
- `buildScript` names a script in `package.json`, and not a `jive:cicd:*` hook, which would loop.
|
|
75
|
-
|
|
76
|
-
`jive-app-github-pages create <directory> [--name <package>] [--domain <hostname>] [--skip-install]` writes a package
|
|
77
|
-
in this shape, with a one-page site in `src/index.html` built by Bun's HTML bundler, its `.gitignore`, a README and
|
|
78
|
-
its `.github/workflows/pipeline.yml`.
|
|
79
|
-
|
|
80
|
-
## What each hook does
|
|
81
|
-
|
|
82
|
-
| Hook | Behavior |
|
|
83
|
-
| --- | --- |
|
|
84
|
-
| `get-config` | Prints the validated `jive` block as JSON. |
|
|
85
|
-
| `build` | Runs `bun run <buildScript>` and checks it wrote `<outputDir>/index.html`. Then writes `CNAME` naming `domain`, or removes one when `domain` is null (with a warning naming what it replaced or removed), and writes an empty `.nojekyll`, which tells GitHub Pages the branch needs no Jekyll build. Jekyll would otherwise leave out every file and folder starting with `_`, such as Astro's `_astro/` ([Jekyll](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/about-github-pages-and-jekyll)). |
|
|
86
|
-
| `audit` | Checks the site has `index.html`, `.nojekyll`, and a `CNAME` exactly when `domain` is set, naming it. Replace this script to run the site's own checks as well. |
|
|
87
|
-
| `deploy:plan` | Plans a deploy (`{"deploy":true,"url":…}`) to where the site is served: `https://<domain>/` once the domain answers over https with a valid certificate, `http://<domain>/` before (GitHub Pages issues the certificate only after the domain's DNS points at it), or `https://<owner>.github.io/<repository>/` without a domain. |
|
|
88
|
-
| `upload-artifacts` | Nothing; the pipeline's artifact already carries `outputDir`. |
|
|
89
|
-
| `deploy` | Checks the site again, then publishes it to `gh-pages` as one commit on top of the branch (none when the branch already holds exactly this site), never force-pushed: a deploy that loses a race with another fails and changes nothing. Then it checks the repository's Pages source is `gh-pages` at `/`, and polls every 5 seconds until GitHub reports the build its push started `built` (success) or `errored` (failure, with GitHub's reason), for at most 10 minutes. When the branch already held this site, nothing is pushed: a build of it that is built ends the deploy, one still running is awaited, and otherwise (its build failed, or none ran) the deploy pushes the same site again as a new commit, which starts a new build. |
|
|
90
|
-
|
|
91
|
-
## The deploy token
|
|
92
|
-
|
|
93
|
-
Jive's shared pipeline gives its jobs an ID token and the checkout's read access (`id-token: write`, `contents:
|
|
94
|
-
read`), and nothing more. The Jive server is to read that ID token to decide what the pipeline may reach, so the
|
|
95
|
-
shared pipeline's permissions are never widened: a wider grant would apply to every package's pipeline at once. Until that
|
|
96
|
-
server can grant the push, a package extending this abstract pushes with its own narrowly scoped token instead of the
|
|
97
|
-
job's `GITHUB_TOKEN`.
|
|
98
|
-
|
|
99
|
-
That token is the repository's `GH_PAGES_DEPLOY_TOKEN` GitHub Actions secret: a
|
|
100
|
-
[fine-grained personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#fine-grained-personal-access-tokens)
|
|
101
|
-
limited to that one repository, with these permissions
|
|
102
|
-
([permissions for fine-grained tokens](https://docs.github.com/en/rest/authentication/permissions-required-for-fine-grained-personal-access-tokens)):
|
|
103
|
-
|
|
104
|
-
| Call | Permission |
|
|
105
|
-
| --- | --- |
|
|
106
|
-
| `git push` to `gh-pages` | Contents: read and write |
|
|
107
|
-
| `GET /repos/{owner}/{repo}/pages` and `.../pages/builds/latest` | Pages: read |
|
|
108
|
-
|
|
109
|
-
It needs no Pages write, because the deploy never requests a build: it waits for the one its push starts. GitHub
|
|
110
|
-
builds a branch-published site on every push to its source branch, except a push made with the job's `GITHUB_TOKEN`
|
|
111
|
-
("Commits pushed by a GitHub Actions workflow that uses the GITHUB_TOKEN do not trigger a GitHub Pages build",
|
|
112
|
-
[GITHUB_TOKEN](https://docs.github.com/en/actions/concepts/security/github_token)). The Pages API also needs a token
|
|
113
|
-
for a public repository: an unauthenticated `GET /repos/{owner}/{repo}/pages` answers 404.
|
|
114
|
-
|
|
115
|
-
A repository secret reaches every pull request opened from a branch of the same repository, and not those from forks
|
|
116
|
-
([using secrets](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets#using-secrets-in-a-workflow)).
|
|
117
|
-
So only people who can already push branches to the repository can open a pull request whose build sees it. The
|
|
118
|
-
token is scaffolding with a removal date, its expiry: it goes once the Jive server grants the push from the
|
|
119
|
-
pipeline's ID token. The `pipeline.yml` that `create` writes is Jive's standard caller, granting only `contents:
|
|
120
|
-
read` and `id-token: write`.
|
|
121
|
-
|
|
122
|
-
## Limitations and open questions
|
|
123
|
-
|
|
124
|
-
- **Pages must already be set up on the repository.** Creating a Pages site or changing its source needs the
|
|
125
|
-
repository's Administration permission, which the deploy token does not have, so a repository without Pages, or whose
|
|
126
|
-
source is not `gh-pages` at `/`, fails its deploy with the settings page to change. The site is published first,
|
|
127
|
-
so the branch is there to choose. Provisioning it belongs to a GitHub resource connector holding that permission
|
|
128
|
-
on Jive's server, which does not exist yet.
|
|
129
|
-
- **https is not enforced.** "Enforce HTTPS" is a Pages setting needing the same Administration permission.
|
|
130
|
-
- **The DNS record is not created.** `domain` makes GitHub Pages serve the site there; the record pointing the
|
|
131
|
-
domain at GitHub Pages is yours to create at your DNS provider.
|
|
132
|
-
- **No previews.** A repository has one Pages site, so a pull request has nowhere of its own to deploy to.
|
|
133
|
-
- **One owner's site.** A repository named `<owner>.github.io` is the owner's own site and is served at its root;
|
|
134
|
-
every other repository is served under `/<repository>/`, so a site without a domain must be built for that base
|
|
135
|
-
path (Astro's `base`, Vite's `base`).
|
|
136
|
-
|
|
137
|
-
## How it is tested
|
|
138
|
-
|
|
139
|
-
This repository is a library: its own pipeline publishes it to npm and never deploys a site. `bun run
|
|
140
|
-
jive:cicd:audit` runs `tsc` and every test. Nothing in them reaches GitHub:
|
|
141
|
-
|
|
142
|
-
- Unit tests (`src/**/*.test.ts`) cover the manifest's rules, the site URLs, the scaffold (its `package.json`
|
|
143
|
-
passes every rule), the deploy's sequence against fake modules and a test clock (an already built commit, a
|
|
144
|
-
build still running, a rerun after a failed build pushing the site again, a failing build, a push that starts no
|
|
145
|
-
build, a timeout, a repository without Pages or with another source), the Pages API client
|
|
146
|
-
against GitHub responses recorded from jive-sh/docs (`src/internal/modules/pages-api/recorded/`), and the
|
|
147
|
-
publishing branch with real git against a bare repository on disk: the first commit, an unchanged site, a new
|
|
148
|
-
commit of an unchanged site, removed files, a race with another deploy, and that the token travels only in the
|
|
149
|
-
environment, never in arguments.
|
|
150
|
-
- `test/hooks.test.ts` runs `get-config`, `build`, `audit`, `deploy:plan`, `upload-artifacts` and `deploy`'s token
|
|
151
|
-
check through the CLI from source against the fixture site in `test/fixture`, and `create` followed by the new
|
|
152
|
-
package's own build and audit.
|
|
153
|
-
|
|
154
|
-
What only a consumer's pipeline can test, against its real repository: that GitHub accepts the deploy token for the
|
|
155
|
-
push and the Pages reads with the permissions above, that its push starts a build, and how long a real build takes.
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
/**
|
|
4
|
-
* Every command's file in a built package's bin/, the same for every command: it is the command its own file name says.
|
|
5
|
-
*
|
|
6
|
-
* On macOS and Linux it runs once. It has the package's postinstall.cjs replace it (and every other command's file)
|
|
7
|
-
* with a hard link to the real program, which the package manager skips when it does not run postinstall (Bun, for a
|
|
8
|
-
* package it does not trust), then runs the program with what was typed. On Windows a command starts through its .cmd
|
|
9
|
-
* shim, which always runs this file, so it runs the program every time and sets up again only when the commands are
|
|
10
|
-
* stale.
|
|
11
|
-
*
|
|
12
|
-
* CommonJS for the reason postinstall.cjs gives: bin/package.json makes this extensionless file CommonJS.
|
|
13
|
-
*/
|
|
14
|
-
const { spawnSync } = require("child_process");
|
|
15
|
-
const { realpathSync } = require("fs");
|
|
16
|
-
const { basename, dirname, join } = require("path");
|
|
17
|
-
|
|
18
|
-
// The real path: reached through a link in a bin directory, the package is wherever the link points.
|
|
19
|
-
const launcherPath = realpathSync(__filename);
|
|
20
|
-
const packageDir = dirname(dirname(launcherPath));
|
|
21
|
-
const postinstall = require(join(packageDir, "postinstall.cjs"));
|
|
22
|
-
|
|
23
|
-
if (process.platform !== "win32" || !postinstall.commandsAreCurrent({ packageDir })) {
|
|
24
|
-
// A shell's, a launcher's or the user's own call to the completion code is left to do its job alone.
|
|
25
|
-
const setUpCompletion = !postinstall.COMPLETION_FLAGS.includes(process.argv[2]);
|
|
26
|
-
postinstall.setUp({ packageDir, repairOnly: false, setUpCompletion });
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const result = spawnSync(postinstall.commandTarget({ packageDir, command: basename(launcherPath) }), process.argv.slice(2), { stdio: "inherit" });
|
|
30
|
-
if (result.error) {
|
|
31
|
-
console.error(result.error.message);
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
process.exit(result.status === null ? 1 : result.status);
|
package/bin/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"commonjs"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Effect, Runtime, pipe } from "effect";
|
|
2
|
-
import { BunRuntime, BunServices } from "@effect/platform-bun";
|
|
3
|
-
import { Cli } from "jive-abstract-library";
|
|
4
|
-
import { version } from "../../package.json";
|
|
5
|
-
import { cicd } from "../internal/commands/cicd";
|
|
6
|
-
import { create } from "../internal/commands/create";
|
|
7
|
-
import { dev } from "../internal/commands/dev";
|
|
8
|
-
import { CLI_CMD_NAME } from "../internal/common/constants";
|
|
9
|
-
const cli = Cli.make(CLI_CMD_NAME, { cicd, create, dev });
|
|
10
|
-
BunRuntime.runMain(pipe(Cli.run(cli, { version }), Effect.provide(Cli.terminalLogger), Effect.provide(BunServices.layer)), {
|
|
11
|
-
// Exit as soon as the command is done, whatever it leaves open (an HTTP client's idle connections): a pipeline
|
|
12
|
-
// step waits for the process, not for the command.
|
|
13
|
-
teardown: (exit, onExit) => Runtime.defaultTeardown(exit, (code) => {
|
|
14
|
-
onExit(code);
|
|
15
|
-
process.exit(code);
|
|
16
|
-
}),
|
|
17
|
-
});
|
|
18
|
-
//# sourceMappingURL=jive-app-github-pages.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jive-app-github-pages.js","sourceRoot":"","sources":["../../../../src/entrypoints/jive-app-github-pages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;AAE1D,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE;IACzH,+GAA+G;IAC/G,mDAAmD;IACnD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE;QACjE,MAAM,CAAC,IAAI,CAAC,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC;CACH,CAAC,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The public surface of this abstract: the package.json shape a site extending it must have, and its scaffold. The
|
|
3
|
-
* hooks themselves ship as the `jive-app-github-pages` command.
|
|
4
|
-
*/
|
|
5
|
-
export { ABSTRACT_KEY, AppGithubPagesSchema, DEPLOY_TOKEN_SECRET, JivePackageConfig, PackageJsonSchema, crossFieldErrors, siteDeployTarget, } from "./internal/public/manifest";
|
|
6
|
-
export { scaffoldFiles } from "./internal/public/scaffold";
|
|
7
|
-
export { customDomainUrl, githubIoUrl } from "./internal/public/site-url";
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GAIjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAA0C,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import { makeCicdCommand } from "../../common/command";
|
|
3
|
-
import { appGithubPagesModules } from "../../modules";
|
|
4
|
-
import { ABSTRACT_KEY } from "../../public/manifest";
|
|
5
|
-
export const audit = makeCicdCommand("audit", "check the build left a site ready to publish: index.html, .nojekyll and the CNAME file the config asks for", function* () {
|
|
6
|
-
const config = (yield* (yield* appGithubPagesModules.Package).load()).jive[ABSTRACT_KEY];
|
|
7
|
-
yield* (yield* appGithubPagesModules.Site).check(config);
|
|
8
|
-
yield* Effect.log(`${config.outputDir} is ready to publish`);
|
|
9
|
-
});
|
|
10
|
-
//# sourceMappingURL=audit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../../../../../src/internal/commands/cicd/audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,KAAK,GAAG,eAAe,CAClC,OAAO,EACP,4GAA4G,EAC5G,QAAQ,CAAC;IACP,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzF,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACzD,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,SAAS,sBAAsB,CAAC,CAAC;AAC/D,CAAC,CACF,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { makeCicdCommand } from "../../common/command";
|
|
2
|
-
import { appGithubPagesModules } from "../../modules";
|
|
3
|
-
import { ABSTRACT_KEY } from "../../public/manifest";
|
|
4
|
-
export const build = makeCicdCommand("build", "run the package's build script, then add the CNAME and .nojekyll files GitHub Pages reads", function* () {
|
|
5
|
-
const config = (yield* (yield* appGithubPagesModules.Package).load()).jive[ABSTRACT_KEY];
|
|
6
|
-
yield* (yield* appGithubPagesModules.Site).build(config);
|
|
7
|
-
});
|
|
8
|
-
//# sourceMappingURL=build.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../../../../src/internal/commands/cicd/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,KAAK,GAAG,eAAe,CAClC,OAAO,EACP,2FAA2F,EAC3F,QAAQ,CAAC;IACP,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzF,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC3D,CAAC,CACF,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Effect, Option } from "effect";
|
|
2
|
-
import { makeDeployPlanCommand } from "../../common/command";
|
|
3
|
-
import { appGithubPagesModules } from "../../modules";
|
|
4
|
-
import { ABSTRACT_KEY, siteDeployTarget } from "../../public/manifest";
|
|
5
|
-
import { customDomainUrl, githubIoUrl } from "../../public/site-url";
|
|
6
|
-
export const deployPlan = makeDeployPlanCommand("deploy-plan", "plan a deploy to the URL GitHub Pages serves this site at", function* ({ environment, context }) {
|
|
7
|
-
const { jive } = yield* (yield* appGithubPagesModules.Package).load();
|
|
8
|
-
const target = siteDeployTarget(jive.cicd);
|
|
9
|
-
if (Option.isNone(target) || target.value.environment !== environment) {
|
|
10
|
-
return yield* Effect.fail(`"${environment}" is not the environment this package deploys its site to`);
|
|
11
|
-
}
|
|
12
|
-
const { domain } = jive[ABSTRACT_KEY];
|
|
13
|
-
const url = Option.isSome(domain)
|
|
14
|
-
? customDomainUrl({ domain: domain.value, servesHttps: yield* (yield* appGithubPagesModules.HttpsProbe).servesHttps(domain.value) })
|
|
15
|
-
: githubIoUrl(context.repository);
|
|
16
|
-
yield* Effect.log(`${environment} is served at ${url}`);
|
|
17
|
-
return { deploy: true, url };
|
|
18
|
-
});
|
|
19
|
-
//# sourceMappingURL=deploy-plan.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-plan.js","sourceRoot":"","sources":["../../../../../../src/internal/commands/cicd/deploy-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,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,CAAC,CAAC;IACxD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAW,CAAC;AACxC,CAAC,CACF,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { makeDeployCommand } from "../../common/command";
|
|
2
|
-
import { readDeployToken } from "../../common/deploy-token";
|
|
3
|
-
import { appGithubPagesModules } from "../../modules";
|
|
4
|
-
export const deploy = makeDeployCommand("deploy", "publish the built site to the gh-pages branch and wait for GitHub Pages to build it", function* ({ environment, context }) {
|
|
5
|
-
const token = yield* readDeployToken();
|
|
6
|
-
yield* (yield* appGithubPagesModules.Deployer).deploy({ environment, context, token });
|
|
7
|
-
});
|
|
8
|
-
//# sourceMappingURL=deploy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../../../../src/internal/commands/cicd/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,CAAC,MAAM,MAAM,GAAG,iBAAiB,CACrC,QAAQ,EACR,qFAAqF,EACrF,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE;IACjC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,eAAe,EAAE,CAAC;IACvC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AACzF,CAAC,CACF,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
import { makeCicdCommand } from "../../common/command";
|
|
3
|
-
import { appGithubPagesModules } from "../../modules";
|
|
4
|
-
import { JivePackageConfig } from "../../public/manifest";
|
|
5
|
-
export const getConfig = makeCicdCommand("get-config", "print this package's validated jive config as JSON for the pipeline's context job", function* () {
|
|
6
|
-
const { jive } = yield* (yield* appGithubPagesModules.Package).load();
|
|
7
|
-
process.stdout.write(`${JSON.stringify(Schema.encodeUnknownSync(JivePackageConfig)(jive))}\n`);
|
|
8
|
-
});
|
|
9
|
-
//# sourceMappingURL=get-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-config.js","sourceRoot":"","sources":["../../../../../../src/internal/commands/cicd/get-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CACtC,YAAY,EACZ,mFAAmF,EACnF,QAAQ,CAAC;IACP,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IACtE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AACjG,CAAC,CACF,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { audit } from "./audit";
|
|
2
|
-
import { build } from "./build";
|
|
3
|
-
import { deploy } from "./deploy";
|
|
4
|
-
import { deployPlan } from "./deploy-plan";
|
|
5
|
-
import { getConfig } from "./get-config";
|
|
6
|
-
import { uploadArtifacts } from "./upload-artifacts";
|
|
7
|
-
/** The hooks invoked by Jive's reusable CI/CD pipeline, by the names `CICD_API.md` gives them. */
|
|
8
|
-
export const cicd = {
|
|
9
|
-
"get-config": getConfig,
|
|
10
|
-
build,
|
|
11
|
-
audit,
|
|
12
|
-
"deploy-plan": deployPlan,
|
|
13
|
-
"upload-artifacts": uploadArtifacts,
|
|
14
|
-
deploy,
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/internal/commands/cicd/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,kGAAkG;AAClG,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,YAAY,EAAE,SAAS;IACvB,KAAK;IACL,KAAK;IACL,aAAa,EAAE,UAAU;IACzB,kBAAkB,EAAE,eAAe;IACnC,MAAM;CACP,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import { makePipelineCommand } from "../../common/command";
|
|
3
|
-
export const uploadArtifacts = makePipelineCommand("upload-artifacts", "no-op: the pipeline's own artifact carries the built site to the deploy job", function* (context) {
|
|
4
|
-
yield* Effect.log(`Nothing to upload for ${context.repository.owner}/${context.repository.name}`);
|
|
5
|
-
});
|
|
6
|
-
//# sourceMappingURL=upload-artifacts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload-artifacts.js","sourceRoot":"","sources":["../../../../../../src/internal/commands/cicd/upload-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,CAAC,MAAM,eAAe,GAAG,mBAAmB,CAChD,kBAAkB,EAClB,6EAA6E,EAC7E,QAAQ,CAAC,EAAE,OAAO;IAChB,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;AACpG,CAAC,CACF,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Effect, Option, pipe } from "effect";
|
|
2
|
-
import { effunct } from "effective-modules";
|
|
3
|
-
import { Cli } from "jive-abstract-library";
|
|
4
|
-
import { basename, resolve } from "node:path";
|
|
5
|
-
import { version } from "../../../package.json";
|
|
6
|
-
import { layerLive } from "../common/layer";
|
|
7
|
-
import { appGithubPagesModules } from "../modules";
|
|
8
|
-
const USAGE = "usage: jive-app-github-pages create <directory> [--name <package>] [--domain <hostname>] [--skip-install]";
|
|
9
|
-
/** `jive-app-github-pages create <directory>`: scaffolds a new package extending this abstract. */
|
|
10
|
-
export const create = Cli.command({
|
|
11
|
-
description: "create a new static site package served by GitHub Pages",
|
|
12
|
-
flags: {
|
|
13
|
-
name: Cli.flag.string({ description: "the package's npm name (default: the directory's name)" }),
|
|
14
|
-
domain: Cli.flag.string({ description: 'the custom domain to serve it at, e.g. "docs.example.com" (default: none, served at <owner>.github.io/<repository>)' }),
|
|
15
|
-
"skip-install": Cli.flag.boolean({ description: "only write the files; skip bun install" }),
|
|
16
|
-
},
|
|
17
|
-
*run({ flags, args }) {
|
|
18
|
-
const directoryArg = args[0];
|
|
19
|
-
if (directoryArg === undefined || args.length > 1) {
|
|
20
|
-
return yield* Effect.andThen(Effect.logError(USAGE), Effect.fail(new Cli.CliError({ message: USAGE, exitCode: 2 })));
|
|
21
|
-
}
|
|
22
|
-
const directory = resolve(directoryArg);
|
|
23
|
-
const scaffold = { packageName: Option.getOrElse(flags.name, () => basename(directory)), domain: flags.domain, abstractVersion: version };
|
|
24
|
-
yield* pipe(effunct(function* () {
|
|
25
|
-
const written = yield* (yield* appGithubPagesModules.Scaffold).create({ directory, scaffold, install: !flags["skip-install"] });
|
|
26
|
-
yield* Effect.log(`Wrote ${written.length} files into ${directory}:\n ${written.join("\n ")}`);
|
|
27
|
-
})(), Effect.provide(layerLive),
|
|
28
|
-
// Cli.run leaves printing a command's own failure to the command, as the hooks do.
|
|
29
|
-
Effect.catch((failure) => Effect.andThen(Effect.logError(`✗ ${failure}`), Effect.fail(new Cli.CliError({ message: failure, exitCode: 1 })))));
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/internal/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,MAAM,KAAK,GAAG,2GAA2G,CAAC;AAE1H,mGAAmG;AACnG,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAChC,WAAW,EAAE,yDAAyD;IACtE,KAAK,EAAE;QACL,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,wD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CAAC,MAAM,eAAe,SAAS,QAAQ,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACnG,CAAC,CAAC,EAAE,EACJ,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;QACzB,mFAAmF;QACnF,MAAM,CAAC,KAAK,CAAC,CAAC,OAAe,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CACrJ,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import { Cli, runDevServer } from "jive-abstract-library";
|
|
3
|
-
import { PackageJsonSchema } from "../public/manifest";
|
|
4
|
-
/** `jive-app-github-pages dev`: keeps the package's package.schema.json current while its package.json is edited. */
|
|
5
|
-
export const dev = Cli.command({
|
|
6
|
-
description: "watch this package and keep its generated package.schema.json current while you work",
|
|
7
|
-
*run() {
|
|
8
|
-
yield* Effect.promise(() => runDevServer({ genPackageJsonSchema: Effect.succeed(PackageJsonSchema), watchPaths: ["package.json"] }));
|
|
9
|
-
},
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=dev.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../../../src/internal/commands/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qHAAqH;AACrH,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC;IAC7B,WAAW,EAAE,sFAAsF;IACnG,CAAC,GAAG;QACF,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,oBAAoB,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,UAAU,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC;IACvI,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { makeCicdCommandFactory } from "jive-abstract-library";
|
|
2
|
-
import { layerLive } from "./layer";
|
|
3
|
-
/** Every hook runs against this abstract's whole module graph, platform services included. */
|
|
4
|
-
export const { makeCicdCommand, makePipelineCommand, makeDeployCommand, makeDeployPlanCommand } = makeCicdCommandFactory(layerLive);
|
|
5
|
-
//# sourceMappingURL=command.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../../../src/internal/common/command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAA2B,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,8FAA8F;AAC9F,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,GAC7F,sBAAsB,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export const CLI_CMD_NAME = "jive-app-github-pages";
|
|
2
|
-
/** The package this abstract ships as, which a scaffolded package gets as a dev dependency. */
|
|
3
|
-
export const ABSTRACT_PACKAGE_NAME = "jive-abstract-app-github-pages";
|
|
4
|
-
/**
|
|
5
|
-
* The branch the deploy publishes the site to, at its root. GitHub Pages serves it when the repository's Pages
|
|
6
|
-
* source is this branch and `/`
|
|
7
|
-
* (https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site).
|
|
8
|
-
*/
|
|
9
|
-
export const PUBLISHING_BRANCH = "gh-pages";
|
|
10
|
-
export const PUBLISHING_PATH = "/";
|
|
11
|
-
/**
|
|
12
|
-
* Where the deploy keeps the git repository it publishes the site from, relative to the package. Under
|
|
13
|
-
* `node_modules/.cache`, so no package has to ignore it, and rebuilt by every deploy.
|
|
14
|
-
*/
|
|
15
|
-
export const PUBLISHING_GIT_DIR = "node_modules/.cache/jive-app-github-pages/publishing.git";
|
|
16
|
-
/** Files the build adds to the site, which GitHub Pages reads rather than serves as pages. */
|
|
17
|
-
export const SITE_FILES = {
|
|
18
|
-
/** Holds the custom domain; a branch-published site's domain is whatever this file names. */
|
|
19
|
-
customDomain: "CNAME",
|
|
20
|
-
/**
|
|
21
|
-
* Tells GitHub Pages the branch needs no Jekyll build
|
|
22
|
-
* (https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site).
|
|
23
|
-
* Jekyll would otherwise leave out every file and folder starting with `_`, such as Astro's `_astro/`
|
|
24
|
-
* (https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/about-github-pages-and-jekyll).
|
|
25
|
-
*/
|
|
26
|
-
disableJekyll: ".nojekyll",
|
|
27
|
-
};
|
|
28
|
-
/** The page every built site must have, since GitHub Pages serves it at the site's root. */
|
|
29
|
-
export const SITE_INDEX_FILE = "index.html";
|
|
30
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/internal/common/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAEpD,+FAA+F;AAC/F,MAAM,CAAC,MAAM,qBAAqB,GAAG,gCAAgC,CAAC;AAEtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAC5C,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,0DAA0D,CAAC;AAE7F,8FAA8F;AAC9F,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,6FAA6F;IAC7F,YAAY,EAAE,OAAO;IACrB;;;;;OAKG;IACH,aAAa,EAAE,WAAW;CAClB,CAAC;AAEX,4FAA4F;AAC5F,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Effect, Redacted } from "effect";
|
|
2
|
-
import { DEPLOY_TOKEN_SECRET } from "../public/manifest";
|
|
3
|
-
/**
|
|
4
|
-
* The deploy token, which the pipeline exports into the environment because the package lists it in
|
|
5
|
-
* `cicd.requiredSecrets`. Read once, at the hook's boundary, and passed on as a `Redacted` value so it never
|
|
6
|
-
* reaches a log.
|
|
7
|
-
*/
|
|
8
|
-
export function* readDeployToken() {
|
|
9
|
-
const token = process.env[DEPLOY_TOKEN_SECRET];
|
|
10
|
-
if (token === undefined || token === "") {
|
|
11
|
-
return yield* Effect.fail(`${DEPLOY_TOKEN_SECRET} is not set. Jive's pipeline exports it for this hook when package.json lists it in `
|
|
12
|
-
+ `jive.cicd.requiredSecrets and the repository has a GitHub Actions secret of that name: a fine-grained token `
|
|
13
|
-
+ `limited to the repository, with Contents read and write and Pages read`);
|
|
14
|
-
}
|
|
15
|
-
return Redacted.make(token);
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=deploy-token.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-token.js","sourceRoot":"","sources":["../../../../../src/internal/common/deploy-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;;GAIG;AACH,MAAM,SAAS,CAAC,CAAC,eAAe;IAC9B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAC/C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CACvB,GAAG,mBAAmB,sFAAsF;cAC1G,8GAA8G;cAC9G,wEAAwE,CAC3E,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Layer, pipe } from "effect";
|
|
2
|
-
import { FetchHttpClient } from "effect/http";
|
|
3
|
-
import { BunFileSystem } from "@effect/platform-bun";
|
|
4
|
-
import { OSPlatformImpl } from "jive-abstract-library";
|
|
5
|
-
import { DeployerImpl } from "../modules/deployer/impl";
|
|
6
|
-
import { HttpsProbeImpl } from "../modules/https-probe/impl";
|
|
7
|
-
import { PackageImpl } from "../modules/package/impl";
|
|
8
|
-
import { PagesApiImpl } from "../modules/pages-api/impl";
|
|
9
|
-
import { PublishingBranchImpl } from "../modules/publishing-branch/impl";
|
|
10
|
-
import { ScaffoldImpl } from "../modules/scaffold/impl";
|
|
11
|
-
import { SiteImpl } from "../modules/site/impl";
|
|
12
|
-
/** Every module this abstract owns, composed most-dependent first. */
|
|
13
|
-
export const layerLive = pipe(DeployerImpl.Layer, Layer.provideMerge(ScaffoldImpl.Layer), Layer.provideMerge(PublishingBranchImpl.Layer), Layer.provideMerge(PagesApiImpl.Layer), Layer.provideMerge(HttpsProbeImpl.Layer), Layer.provideMerge(SiteImpl.Layer), Layer.provideMerge(PackageImpl.Layer), Layer.provideMerge(OSPlatformImpl.Layer), Layer.provideMerge(FetchHttpClient.layer), Layer.provideMerge(BunFileSystem.layer));
|
|
14
|
-
//# sourceMappingURL=layer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":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