ic-mops 2.6.0 → 2.7.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/CHANGELOG.md +7 -0
- package/RELEASE.md +18 -15
- package/bundle/cli.tgz +0 -0
- package/commands/publish.ts +20 -15
- package/dist/commands/publish.js +15 -12
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## Next
|
|
4
4
|
|
|
5
|
+
## 2.7.0
|
|
6
|
+
|
|
7
|
+
- `mops publish` no longer requires a `repository` field — it is now optional metadata (used by the registry UI for source links)
|
|
8
|
+
- `mops publish` now hard-errors on GitHub `[dependencies]` instead of prompting; the backend has rejected them for some time and the prompt was misleading
|
|
9
|
+
- `mops publish` now fails fast with a clear error when unsupported fields (`dfx`, `moc`, `homepage`, `documentation`, `donation`) are set in `mops.toml`
|
|
10
|
+
- Fix `mops publish` reporting incorrect max length for `license` field (was 30, now matches backend limit of 40)
|
|
11
|
+
|
|
5
12
|
## 2.6.0
|
|
6
13
|
|
|
7
14
|
- Packages can ship lintoko rules for consumers in a `rules/` directory (distinct from `lint/`/`lints/` which check the package itself); `rules/*.toml` files are included automatically when running `mops publish`
|
package/RELEASE.md
CHANGED
|
@@ -21,33 +21,36 @@ cd cli
|
|
|
21
21
|
npm version patch --no-git-tag-version # or: minor / major
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
## 3. Create a release PR
|
|
24
|
+
## 3. Create a release PR and enable auto-merge
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
27
|
git checkout -b <username>/release-X.Y.Z
|
|
28
28
|
git add cli/CHANGELOG.md cli/package.json cli/package-lock.json
|
|
29
29
|
git commit -m "release: CLI vX.Y.Z"
|
|
30
30
|
git push -u origin <username>/release-X.Y.Z
|
|
31
|
-
gh pr create
|
|
31
|
+
gh pr create \
|
|
32
|
+
--title "release: CLI vX.Y.Z" \
|
|
33
|
+
--body "Release CLI vX.Y.Z." \
|
|
34
|
+
--label release
|
|
35
|
+
gh pr merge --auto --squash
|
|
32
36
|
```
|
|
33
37
|
|
|
34
|
-
|
|
38
|
+
The [`release-pr.yml`](../.github/workflows/release-pr.yml) workflow runs on every update and validates:
|
|
39
|
+
- PR title matches `release: CLI vX.Y.Z`
|
|
40
|
+
- `cli/CHANGELOG.md` has an entry for the version
|
|
41
|
+
- `cli/package.json` version matches
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
Once all required checks pass the PR merges automatically. On merge, `release-pr.yml` pushes the `cli-vX.Y.Z` tag, which triggers the [`release.yml`](../.github/workflows/release.yml) workflow — it builds, publishes to npm, creates a GitHub Release, and deploys canisters (`cli.mops.one` and `docs.mops.one`).
|
|
37
44
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
This triggers the [`release.yml`](../.github/workflows/release.yml) workflow which builds, publishes to npm, creates a GitHub Release, deploys canisters (`cli.mops.one` and `docs.mops.one`), and opens a PR with on-chain release artifacts.
|
|
45
|
-
|
|
46
|
-
Monitor at [Actions → Release CLI](https://github.com/caffeinelabs/mops/actions/workflows/release.yml).
|
|
45
|
+
> **Note:** This workflow only deploys the `cli` and `docs` canisters. The `main`, `assets`, `blog`, and `play-frontend` canisters require a manual deploy. If a release includes changes to any of those (e.g. `backend/main/` or `frontend/`), upgrade them manually (staging first, then `ic`):
|
|
46
|
+
>
|
|
47
|
+
> ```bash
|
|
48
|
+
> NODE_ENV=production dfx deploy --no-wallet --identity mops --network <staging|ic> <canister>
|
|
49
|
+
> ```
|
|
47
50
|
|
|
48
|
-
## 5.
|
|
51
|
+
## 5. Artifacts PR
|
|
49
52
|
|
|
50
|
-
After the
|
|
53
|
+
After the release pipeline completes, it creates and auto-merges a `cli-releases: vX.Y.Z artifacts` PR. No action needed unless it fails — monitor at [Actions → Release CLI](https://github.com/caffeinelabs/mops/actions/workflows/release.yml) and merge the artifacts PR manually if needed.
|
|
51
54
|
|
|
52
55
|
## Verify build
|
|
53
56
|
|
package/bundle/cli.tgz
CHANGED
|
Binary file
|
package/commands/publish.ts
CHANGED
|
@@ -83,7 +83,7 @@ export async function publish(
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
// desired fields
|
|
86
|
-
for (let key of ["description"
|
|
86
|
+
for (let key of ["description"]) {
|
|
87
87
|
// @ts-ignore
|
|
88
88
|
if (!config.package[key] && !process.env.CI) {
|
|
89
89
|
let res = await prompts({
|
|
@@ -120,6 +120,14 @@ export async function publish(
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
// disabled fields
|
|
124
|
+
for (let key of ["dfx", "moc", "homepage", "documentation", "donation"]) {
|
|
125
|
+
if ((config.package as any)[key]) {
|
|
126
|
+
console.log(chalk.red("Error: ") + `package.${key} is not supported yet`);
|
|
127
|
+
process.exit(1);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
123
131
|
// check lengths
|
|
124
132
|
let keysMax = {
|
|
125
133
|
name: 50,
|
|
@@ -130,7 +138,7 @@ export async function publish(
|
|
|
130
138
|
documentation: 300,
|
|
131
139
|
homepage: 300,
|
|
132
140
|
readme: 100,
|
|
133
|
-
license:
|
|
141
|
+
license: 40,
|
|
134
142
|
files: 20,
|
|
135
143
|
dfx: 10,
|
|
136
144
|
moc: 10,
|
|
@@ -166,18 +174,12 @@ export async function publish(
|
|
|
166
174
|
}
|
|
167
175
|
|
|
168
176
|
for (let dep of Object.values(config.dependencies)) {
|
|
169
|
-
if (dep.repo
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
"GitHub dependencies make the registry less reliable and limit its capabilities.\nIf you are the owner of the dependency, please consider publishing it to the Mops registry.",
|
|
176
|
-
) + "\n\nPublish anyway?",
|
|
177
|
-
});
|
|
178
|
-
if (!res.ok) {
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
177
|
+
if (dep.repo) {
|
|
178
|
+
console.log(
|
|
179
|
+
chalk.red("Error: ") +
|
|
180
|
+
"GitHub dependencies are no longer supported.\nIf you are the owner of the dependency, please publish it to the Mops registry.",
|
|
181
|
+
);
|
|
182
|
+
process.exit(1);
|
|
181
183
|
}
|
|
182
184
|
}
|
|
183
185
|
}
|
|
@@ -345,7 +347,10 @@ export async function publish(
|
|
|
345
347
|
// parse changelog
|
|
346
348
|
console.log("Parsing CHANGELOG.md...");
|
|
347
349
|
let changelog = parseChangelog(config.package.version);
|
|
348
|
-
if (
|
|
350
|
+
if (
|
|
351
|
+
!changelog &&
|
|
352
|
+
config.package.repository?.startsWith("https://github.com/")
|
|
353
|
+
) {
|
|
349
354
|
console.log("Fetching release notes from GitHub...");
|
|
350
355
|
changelog = await fetchGitHubReleaseNotes(
|
|
351
356
|
config.package.repository,
|
package/dist/commands/publish.js
CHANGED
|
@@ -50,7 +50,7 @@ export async function publish(options = {}) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
// desired fields
|
|
53
|
-
for (let key of ["description"
|
|
53
|
+
for (let key of ["description"]) {
|
|
54
54
|
// @ts-ignore
|
|
55
55
|
if (!config.package[key] && !process.env.CI) {
|
|
56
56
|
let res = await prompts({
|
|
@@ -85,6 +85,13 @@ export async function publish(options = {}) {
|
|
|
85
85
|
process.exit(1);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
+
// disabled fields
|
|
89
|
+
for (let key of ["dfx", "moc", "homepage", "documentation", "donation"]) {
|
|
90
|
+
if (config.package[key]) {
|
|
91
|
+
console.log(chalk.red("Error: ") + `package.${key} is not supported yet`);
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
88
95
|
// check lengths
|
|
89
96
|
let keysMax = {
|
|
90
97
|
name: 50,
|
|
@@ -95,7 +102,7 @@ export async function publish(options = {}) {
|
|
|
95
102
|
documentation: 300,
|
|
96
103
|
homepage: 300,
|
|
97
104
|
readme: 100,
|
|
98
|
-
license:
|
|
105
|
+
license: 40,
|
|
99
106
|
files: 20,
|
|
100
107
|
dfx: 10,
|
|
101
108
|
moc: 10,
|
|
@@ -123,15 +130,10 @@ export async function publish(options = {}) {
|
|
|
123
130
|
delete dep.path;
|
|
124
131
|
}
|
|
125
132
|
for (let dep of Object.values(config.dependencies)) {
|
|
126
|
-
if (dep.repo
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
message: chalk.yellow("GitHub dependencies make the registry less reliable and limit its capabilities.\nIf you are the owner of the dependency, please consider publishing it to the Mops registry.") + "\n\nPublish anyway?",
|
|
131
|
-
});
|
|
132
|
-
if (!res.ok) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
133
|
+
if (dep.repo) {
|
|
134
|
+
console.log(chalk.red("Error: ") +
|
|
135
|
+
"GitHub dependencies are no longer supported.\nIf you are the owner of the dependency, please publish it to the Mops registry.");
|
|
136
|
+
process.exit(1);
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
139
|
}
|
|
@@ -272,7 +274,8 @@ export async function publish(options = {}) {
|
|
|
272
274
|
// parse changelog
|
|
273
275
|
console.log("Parsing CHANGELOG.md...");
|
|
274
276
|
let changelog = parseChangelog(config.package.version);
|
|
275
|
-
if (!changelog &&
|
|
277
|
+
if (!changelog &&
|
|
278
|
+
config.package.repository?.startsWith("https://github.com/")) {
|
|
276
279
|
console.log("Fetching release notes from GitHub...");
|
|
277
280
|
changelog = await fetchGitHubReleaseNotes(config.package.repository, config.package.version);
|
|
278
281
|
}
|
package/dist/package.json
CHANGED