jive-abstract-app-github-pages 0.1.0 → 0.1.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.
Files changed (110) hide show
  1. package/multi-call-binary +4 -0
  2. package/package.json +11 -40
  3. package/README.md +0 -146
  4. package/bin/jive-app-github-pages +0 -611
  5. package/bin/package.json +0 -1
  6. package/dist/entrypoints/jive-app-github-pages.js +0 -18
  7. package/dist/entrypoints/jive-app-github-pages.js.map +0 -1
  8. package/dist/index.js +0 -8
  9. package/dist/index.js.map +0 -1
  10. package/dist/internal/commands/cicd/audit.js +0 -10
  11. package/dist/internal/commands/cicd/audit.js.map +0 -1
  12. package/dist/internal/commands/cicd/build.js +0 -8
  13. package/dist/internal/commands/cicd/build.js.map +0 -1
  14. package/dist/internal/commands/cicd/deploy-plan.js +0 -19
  15. package/dist/internal/commands/cicd/deploy-plan.js.map +0 -1
  16. package/dist/internal/commands/cicd/deploy.js +0 -8
  17. package/dist/internal/commands/cicd/deploy.js.map +0 -1
  18. package/dist/internal/commands/cicd/get-config.js +0 -9
  19. package/dist/internal/commands/cicd/get-config.js.map +0 -1
  20. package/dist/internal/commands/cicd/index.js +0 -16
  21. package/dist/internal/commands/cicd/index.js.map +0 -1
  22. package/dist/internal/commands/cicd/upload-artifacts.js +0 -6
  23. package/dist/internal/commands/cicd/upload-artifacts.js.map +0 -1
  24. package/dist/internal/commands/create.js +0 -32
  25. package/dist/internal/commands/create.js.map +0 -1
  26. package/dist/internal/commands/dev.js +0 -11
  27. package/dist/internal/commands/dev.js.map +0 -1
  28. package/dist/internal/common/command.js +0 -5
  29. package/dist/internal/common/command.js.map +0 -1
  30. package/dist/internal/common/constants.js +0 -30
  31. package/dist/internal/common/constants.js.map +0 -1
  32. package/dist/internal/common/github-token.js +0 -16
  33. package/dist/internal/common/github-token.js.map +0 -1
  34. package/dist/internal/common/layer.js +0 -14
  35. package/dist/internal/common/layer.js.map +0 -1
  36. package/dist/internal/modules/deployer/impl.js +0 -101
  37. package/dist/internal/modules/deployer/impl.js.map +0 -1
  38. package/dist/internal/modules/deployer/interface.js +0 -2
  39. package/dist/internal/modules/deployer/interface.js.map +0 -1
  40. package/dist/internal/modules/https-probe/impl.js +0 -15
  41. package/dist/internal/modules/https-probe/impl.js.map +0 -1
  42. package/dist/internal/modules/https-probe/interface.js +0 -2
  43. package/dist/internal/modules/https-probe/interface.js.map +0 -1
  44. package/dist/internal/modules/index.js +0 -13
  45. package/dist/internal/modules/index.js.map +0 -1
  46. package/dist/internal/modules/package/impl.js +0 -16
  47. package/dist/internal/modules/package/impl.js.map +0 -1
  48. package/dist/internal/modules/package/interface.js +0 -2
  49. package/dist/internal/modules/package/interface.js.map +0 -1
  50. package/dist/internal/modules/pages-api/impl.js +0 -65
  51. package/dist/internal/modules/pages-api/impl.js.map +0 -1
  52. package/dist/internal/modules/pages-api/interface.js +0 -2
  53. package/dist/internal/modules/pages-api/interface.js.map +0 -1
  54. package/dist/internal/modules/publishing-branch/impl.js +0 -83
  55. package/dist/internal/modules/publishing-branch/impl.js.map +0 -1
  56. package/dist/internal/modules/publishing-branch/interface.js +0 -2
  57. package/dist/internal/modules/publishing-branch/interface.js.map +0 -1
  58. package/dist/internal/modules/scaffold/impl.js +0 -37
  59. package/dist/internal/modules/scaffold/impl.js.map +0 -1
  60. package/dist/internal/modules/scaffold/interface.js +0 -2
  61. package/dist/internal/modules/scaffold/interface.js.map +0 -1
  62. package/dist/internal/modules/site/impl.js +0 -71
  63. package/dist/internal/modules/site/impl.js.map +0 -1
  64. package/dist/internal/modules/site/interface.js +0 -2
  65. package/dist/internal/modules/site/interface.js.map +0 -1
  66. package/dist/internal/public/manifest.js +0 -94
  67. package/dist/internal/public/manifest.js.map +0 -1
  68. package/dist/internal/public/scaffold.js +0 -62
  69. package/dist/internal/public/scaffold.js.map +0 -1
  70. package/dist/internal/public/site-url.js +0 -16
  71. package/dist/internal/public/site-url.js.map +0 -1
  72. package/install.cjs +0 -611
  73. package/src/entrypoints/jive-app-github-pages.ts +0 -19
  74. package/src/index.ts +0 -18
  75. package/src/internal/commands/cicd/audit.ts +0 -14
  76. package/src/internal/commands/cicd/build.ts +0 -12
  77. package/src/internal/commands/cicd/deploy-plan.ts +0 -23
  78. package/src/internal/commands/cicd/deploy.ts +0 -12
  79. package/src/internal/commands/cicd/get-config.ts +0 -13
  80. package/src/internal/commands/cicd/index.ts +0 -16
  81. package/src/internal/commands/cicd/upload-artifacts.ts +0 -10
  82. package/src/internal/commands/create.ts +0 -36
  83. package/src/internal/commands/dev.ts +0 -11
  84. package/src/internal/common/command.ts +0 -7
  85. package/src/internal/common/constants.ts +0 -34
  86. package/src/internal/common/github-token.ts +0 -19
  87. package/src/internal/common/layer.ts +0 -25
  88. package/src/internal/modules/deployer/impl.ts +0 -111
  89. package/src/internal/modules/deployer/interface.ts +0 -20
  90. package/src/internal/modules/https-probe/impl.ts +0 -22
  91. package/src/internal/modules/https-probe/interface.ts +0 -10
  92. package/src/internal/modules/index.ts +0 -28
  93. package/src/internal/modules/package/impl.ts +0 -20
  94. package/src/internal/modules/package/interface.ts +0 -10
  95. package/src/internal/modules/pages-api/impl.ts +0 -90
  96. package/src/internal/modules/pages-api/interface.ts +0 -44
  97. package/src/internal/modules/pages-api/recorded/README.md +0 -15
  98. package/src/internal/modules/pages-api/recorded/build-built.json +0 -1
  99. package/src/internal/modules/pages-api/recorded/build-errored.json +0 -1
  100. package/src/internal/modules/pages-api/recorded/site-legacy-gh-pages.json +0 -1
  101. package/src/internal/modules/pages-api/recorded/site-none.json +0 -5
  102. package/src/internal/modules/publishing-branch/impl.ts +0 -95
  103. package/src/internal/modules/publishing-branch/interface.ts +0 -32
  104. package/src/internal/modules/scaffold/impl.ts +0 -42
  105. package/src/internal/modules/scaffold/interface.ts +0 -15
  106. package/src/internal/modules/site/impl.ts +0 -74
  107. package/src/internal/modules/site/interface.ts +0 -14
  108. package/src/internal/public/manifest.ts +0 -116
  109. package/src/internal/public/scaffold.ts +0 -128
  110. package/src/internal/public/site-url.ts +0 -18
@@ -0,0 +1,4 @@
1
+ [diffend] Oversized file quarantined before diffing.
2
+ name: package/multi-call-binary
3
+ size: 91521122 bytes
4
+ sha256: 7973b14260bf0bc9da09b1c3ca94975f461766f04edea6ddd05d1f18b81abede
package/package.json CHANGED
@@ -1,49 +1,20 @@
1
1
  {
2
2
  "name": "jive-abstract-app-github-pages",
3
- "version": "0.1.0",
4
- "license": "MIT",
3
+ "version": "0.1.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
- },
20
- "files": [
21
- "README.md",
22
- "dist",
23
- "src",
24
- "bin",
25
- "install.cjs"
26
- ],
27
- "scripts": {
28
- "postinstall": "node ./install.cjs"
29
- },
30
- "bin": {
31
- "jive-app-github-pages": "./bin/jive-app-github-pages"
32
- },
33
- "optionalDependencies": {
34
- "jive-abstract-app-github-pages-darwin-arm64": "npm:jive-abstract-app-github-pages@0.1.0-latest-darwin-arm64",
35
- "jive-abstract-app-github-pages-darwin-x64": "npm:jive-abstract-app-github-pages@0.1.0-latest-darwin-x64",
36
- "jive-abstract-app-github-pages-linux-arm64": "npm:jive-abstract-app-github-pages@0.1.0-latest-linux-arm64",
37
- "jive-abstract-app-github-pages-linux-x64": "npm:jive-abstract-app-github-pages@0.1.0-latest-linux-x64",
38
- "jive-abstract-app-github-pages-windows-x64": "npm:jive-abstract-app-github-pages@0.1.0-latest-windows-x64"
39
- },
40
- "dependencies": {
41
- "@effect/platform-bun": "^4.0.0",
42
- "effective-modules": "0.3.1-effect4",
43
- "jive-abstract-library": "0.13.1"
44
- },
45
- "peerDependencies": {
46
- "effect": "^4.0.0",
47
- "typescript": "^5.9.3"
48
19
  }
49
20
  }
package/README.md DELETED
@@ -1,146 +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": ["GITHUB_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 `GITHUB_TOKEN`. It is the deploy job's own token, which GitHub puts in every
73
- workflow's secrets context
74
- ([contexts](https://docs.github.com/en/actions/reference/workflows-and-actions/contexts)); nobody creates or
75
- stores it, but the pipeline passes the hooks only the secrets listed.
76
- - `buildScript` names a script in `package.json`, and not a `jive:cicd:*` hook, which would loop.
77
-
78
- `jive-app-github-pages create <directory> [--name <package>] [--domain <hostname>] [--skip-install]` writes a package
79
- in this shape, with a one-page site in `src/index.html` built by Bun's HTML bundler, its `.gitignore`, a README and
80
- its `.github/workflows/pipeline.yml`.
81
-
82
- ## What each hook does
83
-
84
- | Hook | Behavior |
85
- | --- | --- |
86
- | `get-config` | Prints the validated `jive` block as JSON. |
87
- | `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)). |
88
- | `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. |
89
- | `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. |
90
- | `upload-artifacts` | Nothing; the pipeline's artifact already carries `outputDir`. |
91
- | `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 `/`, requests a GitHub Pages build of the commit, and polls every 5 seconds until GitHub reports that commit `built` (success) or `errored` (failure, with GitHub's reason), for at most 10 minutes. A commit GitHub has already built is not requested again. |
92
-
93
- The deploy requests the build itself because a push made with a job's token starts none: "Commits pushed by a
94
- GitHub Actions workflow that uses the GITHUB_TOKEN do not trigger a GitHub Pages build"
95
- ([GITHUB_TOKEN](https://docs.github.com/en/actions/concepts/security/github_token)).
96
-
97
- ## The deploy job's permissions
98
-
99
- The deploy uses the job's `GITHUB_TOKEN` for three things, each needing a permission
100
- ([permissions for GitHub Apps](https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps)):
101
-
102
- | Call | Permission |
103
- | --- | --- |
104
- | `git push` to `gh-pages` | `contents: write` |
105
- | `POST /repos/{owner}/{repo}/pages/builds` | `pages: write` |
106
- | `GET /repos/{owner}/{repo}/pages` and `.../pages/builds/latest` | `pages: read` (part of `pages: write`) |
107
-
108
- A caller workflow grants the job's token its permissions, and a reusable workflow can only reduce them. The
109
- `pipeline.yml` that `create` writes grants `contents: write`, `pages: write` and `id-token: write`. **Jive's shared
110
- deploy job does not yet pass them on:** [reusable-pipeline.yml](https://github.com/jive-sh/jive/blob/main/.github/workflows/reusable-pipeline.yml)
111
- sets the deploy job's permissions to `contents: read` and `id-token: write` for every package, so until it changes
112
- the push is refused with HTTP 403 and the deploy fails.
113
-
114
- ## Limitations and open questions
115
-
116
- - **Pages must already be set up on the repository.** Creating a Pages site or changing its source needs the
117
- repository's Administration permission, which no job token can have, so a repository without Pages, or whose
118
- source is not `gh-pages` at `/`, fails its deploy with the settings page to change. The site is published first,
119
- so the branch is there to choose. Provisioning it belongs to a GitHub resource connector holding that permission
120
- on Jive's server, which does not exist yet.
121
- - **https is not enforced.** "Enforce HTTPS" is a Pages setting needing the same Administration permission.
122
- - **The DNS record is not created.** `domain` makes GitHub Pages serve the site there; the record pointing the
123
- domain at GitHub Pages is yours to create at your DNS provider.
124
- - **No previews.** A repository has one Pages site, so a pull request has nowhere of its own to deploy to.
125
- - **One owner's site.** A repository named `<owner>.github.io` is the owner's own site and is served at its root;
126
- every other repository is served under `/<repository>/`, so a site without a domain must be built for that base
127
- path (Astro's `base`, Vite's `base`).
128
-
129
- ## How it is tested
130
-
131
- This repository is a library: its own pipeline publishes it to npm and never deploys a site. `bun run
132
- jive:cicd:audit` runs `tsc` and every test. Nothing in them reaches GitHub:
133
-
134
- - Unit tests (`src/**/*.test.ts`) cover the manifest's rules, the site URLs, the scaffold (its `package.json`
135
- passes every rule), the deploy's sequence against fake modules and a test clock (an already built commit, a
136
- refused or failing build, a timeout, a repository without Pages or with another source), the Pages API client
137
- against GitHub responses recorded from jive-sh/docs (`src/internal/modules/pages-api/recorded/`), and the
138
- publishing branch with real git against a bare repository on disk: the first commit, an unchanged site, removed
139
- files, a race with another deploy, and that the token travels only in the environment, never in arguments.
140
- - `test/hooks.test.ts` runs `get-config`, `build`, `audit`, `deploy:plan`, `upload-artifacts` and `deploy`'s token
141
- check through the CLI from source against the fixture site in `test/fixture`, and `create` followed by the new
142
- package's own build and audit.
143
-
144
- What only a consumer's pipeline can test, against its real repository: that GitHub accepts the job's token for the
145
- push and the build request with the permissions above, the request's real `201` body (taken from the docs, not
146
- recorded), and how long a real build takes.