@diagonal-hq/pages 0.0.0-stage → 0.1.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 ADDED
@@ -0,0 +1,28 @@
1
+ Copyright (c) 2026 Diagonal Software Corp. All rights reserved.
2
+
3
+ This software is the proprietary property of Diagonal Software Corp. ("Diagonal"). It is
4
+ licensed, not sold.
5
+
6
+ Diagonal grants you a limited, non-exclusive, non-transferable, revocable
7
+ license to install and use this software only to develop, check, build, and
8
+ deploy workspaces for the Diagonal platform, in accordance with your agreement
9
+ with Diagonal.
10
+
11
+ You may not:
12
+
13
+ - modify, adapt, translate, or create derivative works of this software;
14
+ - copy, distribute, sublicense, sell, or otherwise make this software available
15
+ to any third party, except as an unmodified dependency of a Diagonal
16
+ workspace;
17
+ - use this software with any service other than the Diagonal platform;
18
+ - remove or change this notice.
19
+
20
+ This license ends automatically when you stop using the Diagonal platform or
21
+ when you breach its terms.
22
+
23
+ THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
25
+ FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL DIAGONAL BE
26
+ LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF
27
+ CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE
28
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,39 @@
1
- # Temporary Holding Version
1
+ # `@diagonal-hq/pages`
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
+ This package is the Page SDK for file-based workspaces. The pages of a workspace import its components, hooks, and providers. The package does not export them yet. It has no exports until the Page SDK moves into it.
4
+
5
+ The package is ESM JavaScript with declarations. Its `exports` map has the package root and `package.json` only. A deep import into `dist/` fails.
6
+
7
+ ## Dependencies
8
+
9
+ React, React DOM, and `@inertiajs/react` are peer dependencies. The workspace installs them, so the application has one React instance and one Inertia instance.
10
+
11
+ The package must not depend on `@diagonal-hq/workflow` or `@diagonal-hq/cli`. It must not import them, or their old module names `@diagonal/workflow` and `@diagonal/runtime`, from a source file. `npm run lint:package-boundaries` (`scripts/check-package-boundaries.mjs`) checks the manifest and the sources. CI runs it.
12
+
13
+ ## Build the package
14
+
15
+ `npm run build:pages-package` (`scripts/build-pages-package.mjs`) compiles `src/` with `tsconfig.json` into `dist/` and packs `scripts/dist/npm/diagonal-hq-pages-<version>.tgz`. A type error fails the build. `npm run generate-typescript` runs the script.
16
+
17
+ `tsconfig.json` uses `NodeNext` module resolution. A relative import in `src/` must use the `.js` extension of the compiled file, so Node and a bundler can both load `dist/`.
18
+
19
+ `node scripts/smoke-pages-package.mjs [tarball]` installs the packed tarball in a consumer outside the repository, with the React, React DOM, and Inertia versions of the platform. It checks the packed file list, the peer dependencies, the package boundaries of the packed manifest and of the installed dependency tree, the package root through the `exports` map, and a `tsc` check against the packed declarations. The `generated-assets` job of PR CI runs it.
20
+
21
+ ## Publish the package
22
+
23
+ The `Publish npm package` workflow (`.github/workflows/publish-npm-package.yml`) publishes the package to npm. It runs only from `main`.
24
+
25
+ 1. Set `version` in `package.json` to a version that npm does not have. A version with a prerelease part, such as `0.2.0-next.1`, gets the `next` tag. Other versions get `latest`.
26
+ 2. Merge the change to `main`.
27
+ 3. Run the workflow from the Actions tab and select `pages`.
28
+
29
+ The build job builds the package, packs it, and runs the smoke test on the tarball. The publish job runs in the `npm-publish` environment and publishes those exact bytes with npm trusted publishing. It refuses a version that npm already has.
30
+
31
+ npm must list `Diagonal-HQ/diagonal`, the `publish-npm-package.yml` workflow, and the `npm-publish` environment as the trusted publisher of `@diagonal-hq/pages`.
32
+
33
+ npm accepts a trusted publisher only for a package that exists. A member of the `diagonal-hq` npm organization publishes the first version from the CLI:
34
+
35
+ 1. Run `npm run build:pages-package`.
36
+ 2. Run `npm publish ./scripts/dist/npm/diagonal-hq-pages-0.1.0.tgz --access public --tag latest`.
37
+ 3. Add the trusted publisher in the package settings on npmjs.com.
38
+
39
+ The workflow publishes each later version.
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,34 @@
1
1
  {
2
2
  "name": "@diagonal-hq/pages",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "The Page SDK for the pages of file-based Diagonal workspaces.",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Diagonal-HQ/diagonal.git",
9
+ "directory": "packages/pages"
10
+ },
11
+ "type": "module",
12
+ "sideEffects": false,
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ },
19
+ "./package.json": "./package.json"
20
+ },
21
+ "peerDependencies": {
22
+ "@inertiajs/react": "^3.9.0",
23
+ "react": "^19.3.0",
24
+ "react-dom": "^19.3.0"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "LICENSE",
32
+ "README.md"
33
+ ]
34
+ }