stably 2.0.1 → 2.0.3

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.
@@ -0,0 +1,4 @@
1
+ template: |
2
+ ## What’s Changed
3
+
4
+ $CHANGES
@@ -0,0 +1,69 @@
1
+ name: Release
2
+
3
+ on:
4
+ # Trigger the workflow selectively
5
+ workflow_dispatch:
6
+
7
+ permissions:
8
+ contents: write
9
+ pull-requests: write
10
+
11
+ env:
12
+ NODE_VERSION: 22.17.1
13
+ PNPM_VERSION: 9.14.2
14
+
15
+ jobs:
16
+ release:
17
+ # prevent this action from running on forks
18
+ if: github.repository == 'stablyai/stably'
19
+ permissions:
20
+ contents: write
21
+ pull-requests: read
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ with:
26
+ fetch-depth: 0 # required to get tags
27
+ - uses: actions/setup-node@v4
28
+ with:
29
+ node-version: ${{ env.NODE_VERSION }}
30
+ # Required for npm publish
31
+ registry-url: 'https://registry.npmjs.org'
32
+ - name: Extract version from package.json
33
+ run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV
34
+ - name: Get latest semver tag
35
+ run: |
36
+ # Get all tags that match semver pattern (v1.2.3 or 1.2.3)
37
+ latest_tag=$(git tag -l | grep -E '^v?[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1)
38
+
39
+ # Fallback: if no semver tags found, get the latest tag by date
40
+ if [ -z "$latest_tag" ]; then
41
+ latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "no-tags")
42
+ fi
43
+
44
+ echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV
45
+
46
+ echo "Will release version $VERSION, latest tag is $LATEST_TAG"
47
+ - name: Exit if version already released
48
+ if: ${{ contains(env.LATEST_TAG, env.VERSION) }}
49
+ run: |
50
+ echo "Version $VERSION already released. Exiting workflow early."
51
+ exit 0
52
+ # TODO: we could cache these deps (but not many today)
53
+ - uses: pnpm/action-setup@v4.0.0
54
+ with:
55
+ version: ${{ env.PNPM_VERSION }}
56
+ run_install: true
57
+ - name: Build
58
+ run: pnpm run build
59
+ - name: Publish GitHub Release
60
+ uses: release-drafter/release-drafter@v6
61
+ with:
62
+ version: ${{ env.VERSION }}
63
+ publish: true
64
+ env:
65
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66
+ - name: Publish to NPM
67
+ run: npm publish --access public
68
+ env:
69
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/CONTRIBUTING.md CHANGED
@@ -20,12 +20,12 @@ This guide is for contributors who want to develop and contribute to the Stably
20
20
 
21
21
  ## Available Scripts
22
22
 
23
- - `npm run build` - Compile TypeScript to JavaScript
24
- - `npm run start` - Run the compiled JavaScript
25
- - `npm run dev` - Run TypeScript directly (for development)
26
- - `npm run test` - Run tests
27
- - `npm run lint` - Run ESLint
28
- - `npm run format` - Format code with Prettier
23
+ - `pnpm run build` - Compile TypeScript to JavaScript
24
+ - `pnpm run start` - Run the compiled JavaScript
25
+ - `pnpm run dev` - Run TypeScript directly (for development)
26
+ - `pnpm run test` - Run tests
27
+ - `pnpm run lint` - Run ESLint
28
+ - `pnpm run format` - Format code with Prettier
29
29
 
30
30
  ## Contributing
31
31
 
@@ -41,3 +41,7 @@ For questions about development, please refer to the main [README.md](README.md)
41
41
  | Variable | Description |
42
42
  |------------------|---------------------------------------------|
43
43
  | STABLY_API_URL | Base URL for the Stably API (override default endpoint) |
44
+
45
+ ## Release
46
+ 1. Increment version in package.json according to SemVer
47
+ 2. Build and publish (easiest via GH release action)
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  var import_commander = require("commander");
28
28
 
29
29
  // package.json
30
- var version = "2.0.0";
30
+ var version = "2.0.3";
31
31
 
32
32
  // src/config/config.ts
33
33
  var import_path = __toESM(require("path"));
@@ -148,7 +148,7 @@ async function dev(options) {
148
148
  const s = (0, import_prompts2.spinner)();
149
149
  s.start("Starting development server...");
150
150
  const tunnel = await (0, import_runner_sdk.startTunnel)(`http://localhost:${options.port}`, {
151
- subdomain: `${config.user?.organization}-${config.user?.lastName}`.toLowerCase()
151
+ subdomain: `${config.user?.organization}-${config.user?.lastName}`.toLowerCase().replace(/[^a-z0-9-]/g, "")
152
152
  });
153
153
  s.stop(
154
154
  `Your local environment is available at: ${import_picocolors2.default.underline(
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "stably",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Stably CLI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "bin": {
8
- "stably": "./dist/index.js"
8
+ "stably": "dist/index.js"
9
9
  },
10
10
  "scripts": {
11
11
  "build": "tsup",
package/src/dev/dev.ts CHANGED
@@ -15,8 +15,9 @@ export async function dev(options: { port: number; apiKey: string }) {
15
15
  const s = spinner();
16
16
  s.start("Starting development server...");
17
17
  const tunnel = await startTunnel(`http://localhost:${options.port}`, {
18
- subdomain:
19
- `${config.user?.organization}-${config.user?.lastName}`.toLowerCase(),
18
+ subdomain: `${config.user?.organization}-${config.user?.lastName}`
19
+ .toLowerCase()
20
+ .replace(/[^a-z0-9-]/g, ""),
20
21
  });
21
22
  s.stop(
22
23
  `Your local environment is available at: ${pc.underline(