@_linked/org 1.1.0 → 1.1.1
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/.gitattributes +1 -0
- package/.github/workflows/pr.yml +18 -0
- package/.github/workflows/publish.yml +16 -63
- package/CHANGELOG.md +6 -0
- package/package.json +6 -5
- package/.github/workflows/changeset-check.yml +0 -44
- package/.github/workflows/ci.yml +0 -43
package/.gitattributes
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
package-lock.json linguist-generated=true -diff merge=ours
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: PR
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
checks:
|
|
10
|
+
uses: linked-fw/.github/.github/workflows/pr.yml@v1
|
|
11
|
+
# The changeset reminder posts a PR comment. A reusable workflow only holds what its
|
|
12
|
+
# caller granted, and the org default is read-only.
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
pull-requests: write
|
|
16
|
+
with:
|
|
17
|
+
require-tests: false
|
|
18
|
+
run-e2e: false
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
# Calls the shared workflow in linked-fw/.github.
|
|
2
|
+
#
|
|
3
|
+
# This FILENAME is what npm's trusted-publisher check validates — not the shared workflow's.
|
|
4
|
+
# Renaming this file invalidates this package's trusted publisher, and the only symptom is
|
|
5
|
+
# that releases quietly start needing manual approval again.
|
|
1
6
|
name: Publish
|
|
2
7
|
|
|
3
8
|
on:
|
|
@@ -9,69 +14,17 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
|
9
14
|
|
|
10
15
|
jobs:
|
|
11
16
|
release:
|
|
12
|
-
|
|
13
|
-
runs-on: ubuntu-latest
|
|
17
|
+
uses: linked-fw/.github/.github/workflows/publish.yml@v1
|
|
14
18
|
permissions:
|
|
15
19
|
contents: write
|
|
16
20
|
pull-requests: write
|
|
17
|
-
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- name: Checkout
|
|
29
|
-
uses: actions/checkout@v4
|
|
30
|
-
with:
|
|
31
|
-
token: ${{ steps.app-token.outputs.token }}
|
|
32
|
-
|
|
33
|
-
- name: Setup Node.js
|
|
34
|
-
uses: actions/setup-node@v4
|
|
35
|
-
with:
|
|
36
|
-
node-version: 22.16.0
|
|
37
|
-
registry-url: 'https://registry.npmjs.org'
|
|
38
|
-
|
|
39
|
-
- name: Install dependencies
|
|
40
|
-
run: npm ci --legacy-peer-deps
|
|
41
|
-
|
|
42
|
-
- name: Build
|
|
43
|
-
run: npm run build
|
|
44
|
-
|
|
45
|
-
- name: Create release Pull Request or Publish
|
|
46
|
-
id: changesets
|
|
47
|
-
uses: changesets/action@v1
|
|
48
|
-
with:
|
|
49
|
-
publish: npx changeset publish
|
|
50
|
-
title: 'chore: release'
|
|
51
|
-
commit: 'chore: release'
|
|
52
|
-
env:
|
|
53
|
-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
54
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
55
|
-
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
56
|
-
|
|
57
|
-
# When changesets opened/updated the version PR (rather than publishing), merge it so the
|
|
58
|
-
# release ships without a manual click. App token → the merge's push re-triggers this
|
|
59
|
-
# workflow, which then runs `changeset publish`. DIRECT-merge (not `--auto`): GitHub
|
|
60
|
-
# auto-merge ignores branch-protection review-bypass allowances; main is check-only so a
|
|
61
|
-
# direct merge lands once the required check is green — retry until then.
|
|
62
|
-
- name: Merge the version PR to publish
|
|
63
|
-
if: steps.changesets.outputs.hasChangesets == 'true' && steps.changesets.outputs.published != 'true'
|
|
64
|
-
env:
|
|
65
|
-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
66
|
-
run: |
|
|
67
|
-
pr=$(gh pr list --base main --head changeset-release/main --state open --json number --jq '.[0].number // empty')
|
|
68
|
-
if [ -z "$pr" ]; then echo "No open version PR (nothing to merge)."; exit 0; fi
|
|
69
|
-
for i in $(seq 1 40); do
|
|
70
|
-
if gh pr merge "$pr" --merge 2>/tmp/merge_err; then
|
|
71
|
-
echo "Merged version PR #$pr on attempt $i."
|
|
72
|
-
exit 0
|
|
73
|
-
fi
|
|
74
|
-
echo "Attempt $i/40: version PR #$pr not mergeable yet ($(tr -d '\n' < /tmp/merge_err)); waiting for the required check…"
|
|
75
|
-
sleep 15
|
|
76
|
-
done
|
|
77
|
-
echo "::warning::Version PR #$pr not merged after retries — merge it manually."
|
|
21
|
+
# Needed HERE as well as in the shared workflow: a reusable workflow cannot widen the
|
|
22
|
+
# permissions its caller was granted, and without this npm never gets an id-token and
|
|
23
|
+
# every release silently falls back to the approval queue.
|
|
24
|
+
id-token: write
|
|
25
|
+
# Named rather than `inherit`: `inherit` forwards everything this repo can see, which is
|
|
26
|
+
# how a community repo would end up forwarding a first-party token.
|
|
27
|
+
secrets:
|
|
28
|
+
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
29
|
+
RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }}
|
|
30
|
+
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @\_linked/org
|
|
2
2
|
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#10](https://github.com/linked-fw/org/pull/10) [`21fbfed`](https://github.com/linked-fw/org/commit/21fbfedb722c8b70697fc645f98e11cd2fd2ff58) Thanks [@flyon](https://github.com/flyon)! - Declare npm as the package manager for this repo, convert the build scripts off `yarn`, and mark `package-lock.json` as a generated file.
|
|
8
|
+
|
|
3
9
|
## 1.1.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": ""
|
|
11
|
+
"url": "git+https://github.com/linked-fw/org.git"
|
|
12
12
|
},
|
|
13
|
-
"version": "1.1.
|
|
13
|
+
"version": "1.1.1",
|
|
14
|
+
"packageManager": "npm@11.19.1",
|
|
14
15
|
"linkedPackage": true,
|
|
15
16
|
"type": "module",
|
|
16
17
|
"main": "lib/esm/index.js",
|
|
@@ -18,9 +19,9 @@
|
|
|
18
19
|
"license": "ISC",
|
|
19
20
|
"scripts": {
|
|
20
21
|
"start": "npm exec linked dev",
|
|
21
|
-
"build": "rimraf ./lib &&
|
|
22
|
-
"build-esm": "echo \"compiling ESM\" && rimraf ./lib/esm && (
|
|
23
|
-
"copy-to-lib": "echo 'copying JSON assets to lib folder' &&
|
|
22
|
+
"build": "rimraf ./lib && npm run build-esm && npm run copy-to-lib",
|
|
23
|
+
"build-esm": "echo \"compiling ESM\" && rimraf ./lib/esm && (tsc -p tsconfig-esm.json || echo 'tsc returned non-zero; .js still emitted via noEmitOnError default')",
|
|
24
|
+
"copy-to-lib": "echo 'copying JSON assets to lib folder' && copyfiles -u 1 'src/**/*.json' lib/esm"
|
|
24
25
|
},
|
|
25
26
|
"keywords": [
|
|
26
27
|
"lincd",
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
name: Changeset Check
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
changeset-check:
|
|
10
|
-
name: Check for changeset
|
|
11
|
-
# Skip the check on the automated Release PR.
|
|
12
|
-
if: ${{ github.head_ref != 'changeset-release/main' }}
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
steps:
|
|
15
|
-
- name: Checkout
|
|
16
|
-
uses: actions/checkout@v4
|
|
17
|
-
with:
|
|
18
|
-
fetch-depth: 0
|
|
19
|
-
|
|
20
|
-
- name: Check for changeset files
|
|
21
|
-
uses: actions/github-script@v7
|
|
22
|
-
with:
|
|
23
|
-
script: |
|
|
24
|
-
const { data: files } = await github.rest.pulls.listFiles({
|
|
25
|
-
owner: context.repo.owner,
|
|
26
|
-
repo: context.repo.repo,
|
|
27
|
-
pull_number: context.issue.number,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const hasChangeset = files.some(f =>
|
|
31
|
-
f.filename.startsWith('.changeset/') &&
|
|
32
|
-
f.filename.endsWith('.md') &&
|
|
33
|
-
f.filename !== '.changeset/README.md'
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
if (!hasChangeset) {
|
|
37
|
-
await github.rest.issues.createComment({
|
|
38
|
-
owner: context.repo.owner,
|
|
39
|
-
repo: context.repo.repo,
|
|
40
|
-
issue_number: context.issue.number,
|
|
41
|
-
body: "No changeset found. If this PR should trigger a release, run `npx changeset` and commit the generated file.\n\nIf this change doesn't need a release (docs, CI config, etc.), you can ignore this message."
|
|
42
|
-
});
|
|
43
|
-
core.warning('No changeset file found in this PR.');
|
|
44
|
-
}
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build-and-test:
|
|
10
|
-
name: Build & Test
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- name: Detect Release PR
|
|
14
|
-
id: rpr
|
|
15
|
-
run: |
|
|
16
|
-
if [[ "${{ github.event.pull_request.head.ref }}" == "changeset-release/main" ]]; then
|
|
17
|
-
echo "is_release_pr=true" >> $GITHUB_OUTPUT
|
|
18
|
-
echo "Release PR from changesets/action detected — skipping build/test (auto-generated version+CHANGELOG only)."
|
|
19
|
-
else
|
|
20
|
-
echo "is_release_pr=false" >> $GITHUB_OUTPUT
|
|
21
|
-
fi
|
|
22
|
-
|
|
23
|
-
- name: Checkout
|
|
24
|
-
if: steps.rpr.outputs.is_release_pr == 'false'
|
|
25
|
-
uses: actions/checkout@v4
|
|
26
|
-
|
|
27
|
-
- name: Setup Node.js
|
|
28
|
-
if: steps.rpr.outputs.is_release_pr == 'false'
|
|
29
|
-
uses: actions/setup-node@v4
|
|
30
|
-
with:
|
|
31
|
-
node-version: 22.16.0
|
|
32
|
-
|
|
33
|
-
- name: Install dependencies
|
|
34
|
-
if: steps.rpr.outputs.is_release_pr == 'false'
|
|
35
|
-
run: npm ci --legacy-peer-deps
|
|
36
|
-
|
|
37
|
-
- name: Build
|
|
38
|
-
if: steps.rpr.outputs.is_release_pr == 'false'
|
|
39
|
-
run: npm run build
|
|
40
|
-
|
|
41
|
-
- name: Test
|
|
42
|
-
if: steps.rpr.outputs.is_release_pr == 'false'
|
|
43
|
-
run: npm test --if-present
|