Skip to content

Commit c385ad6

Browse files
committed
fix(cli): align manifest files and publish overrides
1 parent c3609d0 commit c385ad6

4 files changed

Lines changed: 109 additions & 15 deletions

File tree

packages/cli/CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## 0.2.1
6+
7+
### Changed
8+
9+
- Remote public-mode access no longer hard-requires HTTPS. HTTP access is now allowed, while HTTPS remains recommended for public deployment.
10+
- The auth gate now shows the normal sign-in flow on remote HTTP hosts instead of blocking with an HTTPS requirement.
11+
- Deployment docs now document the HTTP/HTTPS tradeoff and the `Secure` cookie behavior more clearly.
12+
13+
### Added
14+
15+
- Release E2E coverage for remote HTTP sign-in.
16+
- Community support acknowledgement for LinuxDo in the Chinese homepage README.
17+
18+
## 0.2.0
19+
20+
### Added
21+
22+
- Initial local-server + web-ui workbench release for local folders and remote Git repositories.
23+
- Claude-based workspace flow with draft tasks, split panes, and PTY-style agent interaction.
24+
- Code browsing and editing with file tree, file search, Monaco preview/edit, and save.
25+
- Git workflow support with diff review, stage, unstage, discard, and commit actions.
26+
- Embedded multi-terminal workspace panel.
27+
- Public-mode auth with passphrase login, session cookies, root-path restrictions, and IP blocking.
28+
- npm CLI packaging, release verification, and cross-platform runtime publishing flow.

packages/cli/package.json

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
11
{
22
"name": "@spencer-kit/coder-studio",
3-
"version": "0.0.1",
3+
"version": "0.2.6",
44
"type": "module",
55
"description": "Coder Studio CLI - The only published package",
6+
"main": "./src/index.ts",
67
"bin": {
7-
"coder-studio": "./dist/bin.js"
8+
"coder-studio": "./src/bin.ts"
89
},
910
"exports": {
1011
".": {
11-
"import": "./dist/esm/index.mjs",
12-
"types": "./dist/esm/index.d.mts"
12+
"import": "./src/index.ts",
13+
"types": "./src/index.ts"
14+
}
15+
},
16+
"files": ["dist", "src", "README.md", "CHANGELOG.md", "package.json"],
17+
"publishConfig": {
18+
"main": "./dist/esm/index.mjs",
19+
"bin": {
20+
"coder-studio": "./dist/bin.js"
21+
},
22+
"exports": {
23+
".": {
24+
"import": "./dist/esm/index.mjs",
25+
"types": "./dist/esm/index.d.mts"
26+
}
1327
}
1428
},
15-
"files": ["dist"],
1629
"scripts": {
1730
"build": "tsx ../../scripts/build-cli.ts",
1831
"dev": "tsx ../../scripts/dev-server.ts",

scripts/publish-cli.test.ts

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,19 @@ describe("publish-cli", () => {
9999
JSON.stringify({
100100
name: "@spencer-kit/coder-studio",
101101
version: "1.2.3",
102-
bin: { "coder-studio": "./dist/bin.js" },
102+
bin: { "coder-studio": "./src/bin.ts" },
103103
files: ["dist"],
104+
publishConfig: {
105+
bin: { "coder-studio": "./dist/bin.js" },
106+
exports: {
107+
".": {
108+
import: "./dist/esm/index.mjs",
109+
},
110+
},
111+
},
104112
exports: {
105113
".": {
106-
import: "./dist/esm/index.mjs",
114+
import: "./src/index.ts",
107115
},
108116
},
109117
dependencies: {
@@ -138,11 +146,19 @@ describe("publish-cli", () => {
138146
JSON.stringify({
139147
name: "@spencer-kit/coder-studio",
140148
version: "1.2.3",
141-
bin: { "coder-studio": "./dist/bin.js" },
149+
bin: { "coder-studio": "./src/bin.ts" },
142150
files: ["dist"],
151+
publishConfig: {
152+
bin: { "coder-studio": "./dist/bin.js" },
153+
exports: {
154+
".": {
155+
import: "./dist/esm/index.mjs",
156+
},
157+
},
158+
},
143159
exports: {
144160
".": {
145-
import: "./dist/esm/index.mjs",
161+
import: "./src/index.ts",
146162
},
147163
},
148164
dependencies: {},
@@ -169,11 +185,19 @@ describe("publish-cli", () => {
169185
JSON.stringify({
170186
name: "@spencer-kit/coder-studio",
171187
version: "1.2.3",
172-
bin: { "coder-studio": "./dist/bin.js" },
188+
bin: { "coder-studio": "./src/bin.ts" },
173189
files: ["dist"],
190+
publishConfig: {
191+
bin: { "coder-studio": "./dist/bin.js" },
192+
exports: {
193+
".": {
194+
import: "./dist/esm/index.mjs",
195+
},
196+
},
197+
},
174198
exports: {
175199
".": {
176-
import: "./dist/esm/index.mjs",
200+
import: "./src/index.ts",
177201
},
178202
},
179203
dependencies: {

scripts/publish-cli.ts

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export async function assertCliPublishArtifacts(
129129
bin?: unknown;
130130
files?: unknown;
131131
exports?: unknown;
132+
publishConfig?: unknown;
132133
dependencies?: unknown;
133134
};
134135

@@ -138,14 +139,20 @@ export async function assertCliPublishArtifacts(
138139
if (typeof pkg.version !== "string" || pkg.version.length === 0) {
139140
throw new Error(`Missing CLI package version in ${packageJsonPath}`);
140141
}
142+
143+
const publishBin = readPublishBin(pkg);
144+
const publishExports = readPublishExports(pkg);
145+
141146
if (!Array.isArray(pkg.files) || !pkg.files.includes("dist")) {
142147
throw new Error('CLI package.json must publish only the "dist" files entry');
143148
}
144-
if (!hasRecordValue(pkg.bin, "coder-studio", "./dist/bin.js")) {
145-
throw new Error('CLI package.json bin must point "coder-studio" to "./dist/bin.js"');
149+
if (!hasRecordValue(publishBin, "coder-studio", "./dist/bin.js")) {
150+
throw new Error('CLI package.json publish bin must point "coder-studio" to "./dist/bin.js"');
146151
}
147-
if (!hasNestedRecordValue(pkg.exports, ".", "import", "./dist/esm/index.mjs")) {
148-
throw new Error('CLI package.json exports must point "." import to "./dist/esm/index.mjs"');
152+
if (!hasNestedRecordValue(publishExports, ".", "import", "./dist/esm/index.mjs")) {
153+
throw new Error(
154+
'CLI package.json publish exports must point "." import to "./dist/esm/index.mjs"'
155+
);
149156
}
150157
assertPublishDependenciesResolvable(pkg.dependencies, packageJsonPath);
151158

@@ -168,6 +175,28 @@ export async function assertCliPublishArtifacts(
168175
return { name: pkg.name, version: pkg.version };
169176
}
170177

178+
function readPublishBin(pkg: { bin?: unknown; publishConfig?: unknown }): unknown {
179+
if (typeof pkg.publishConfig === "object" && pkg.publishConfig !== null) {
180+
const publishBin = (pkg.publishConfig as Record<string, unknown>).bin;
181+
if (publishBin !== undefined) {
182+
return publishBin;
183+
}
184+
}
185+
186+
return pkg.bin;
187+
}
188+
189+
function readPublishExports(pkg: { exports?: unknown; publishConfig?: unknown }): unknown {
190+
if (typeof pkg.publishConfig === "object" && pkg.publishConfig !== null) {
191+
const publishExports = (pkg.publishConfig as Record<string, unknown>).exports;
192+
if (publishExports !== undefined) {
193+
return publishExports;
194+
}
195+
}
196+
197+
return pkg.exports;
198+
}
199+
171200
export async function runPublishCli({
172201
cliDir = CLI_DIR,
173202
exec = execCommand,

0 commit comments

Comments
 (0)