Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Release + self-update tests
run: |
node --test scripts/release/__tests__/version.test.cjs
node --loader ts-node/esm --test packages/flux/test/self-update.test.mjs
node --test packages/flux/test/self-update.test.mjs

vscode_flux_typecheck:
name: VS Code extension (typecheck only)
Expand Down
50 changes: 28 additions & 22 deletions .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,50 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
registry-url: https://registry.npmjs.org
cache: npm
node-version: "20"
registry-url: "https://registry.npmjs.org"

- name: Configure npm auth
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [ -z "$NPM_TOKEN" ]; then
echo "NPM_TOKEN secret is missing"
exit 1
fi
cat > "$HOME/.npmrc" <<EOF
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
@flux-lang:registry=https://registry.npmjs.org/
always-auth=true
EOF
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.1
run_install: false

- name: Get pnpm store path
id: pnpm-store
shell: bash
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"

- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Build
run: npm run build
run: pnpm run build

- name: Test
run: npm test
run: pnpm test

- name: Sync canary versions
run: node --loader ts-node/esm scripts/release/syncCanary.ts --sha=${{ github.sha }}
run: |
pnpm -w exec tsc -p scripts/release/tsconfig.json
node scripts/release/dist/syncCanary.js --sha=${{ github.sha }}

- name: Publish canary packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: node --loader ts-node/esm scripts/release/publishPackages.ts --tag=canary
run: node scripts/release/dist/publishPackages.js --tag=canary

- name: Apply canary dist-tag
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
VERSION=$(node -e "const pkgs=require('./packages/cli/package.json'); console.log(pkgs.version);")
node --loader ts-node/esm scripts/release/applyDistTags.ts --channel=canary --version=${VERSION}
node scripts/release/dist/applyDistTags.js --channel=canary --version=${VERSION}
14 changes: 13 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,26 @@ jobs:
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
cache: "pnpm"

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.1
run_install: false

- name: Get pnpm store path
id: pnpm-store
shell: bash
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"

- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --frozen-lockfile

Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
link-workspace-packages=true
prefer-workspace-packages=true
8 changes: 4 additions & 4 deletions packages/cli-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"test": "vitest"
},
"dependencies": {
"@flux-lang/core": "^0.1.6",
"@flux-lang/render-html": "^0.1.6",
"@flux-lang/typesetter": "^0.1.6",
"@flux-lang/viewer": "^0.1.6"
"@flux-lang/core": "workspace:^",
"@flux-lang/render-html": "workspace:^",
"@flux-lang/typesetter": "workspace:^",
"@flux-lang/viewer": "workspace:^"
},
"devDependencies": {
"@types/node": "^22.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"test": "vitest"
},
"dependencies": {
"@flux-lang/brand": "^0.1.0",
"@flux-lang/cli-core": "^0.1.6",
"@flux-lang/brand": "workspace:^",
"@flux-lang/cli-core": "workspace:^",
"chalk": "^5.4.1",
"ink": "^4.4.1",
"react": "^18.3.1"
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"prepublishOnly": "npm run build && chmod +x dist/bin/flux.js"
},
"dependencies": {
"@flux-lang/brand": "^0.1.0",
"@flux-lang/core": "^0.1.6",
"@flux-lang/cli-core": "^0.1.6",
"@flux-lang/cli-ui": "^0.1.6"
"@flux-lang/brand": "workspace:^",
"@flux-lang/core": "workspace:^",
"@flux-lang/cli-core": "workspace:^",
"@flux-lang/cli-ui": "workspace:^"
},
"devDependencies": {
"@types/node": "^22.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/editor-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"dependencies": {
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/utilities": "^3.2.2",
"@flux-lang/brand": "^0.1.0",
"@flux-lang/core": "^0.1.6",
"@flux-lang/brand": "workspace:^",
"@flux-lang/core": "workspace:^",
"@monaco-editor/react": "^4.6.0",
"@radix-ui/react-menubar": "^1.1.16",
"@tiptap/core": "^2.11.0",
Expand All @@ -39,7 +39,7 @@
"react-router-dom": "^6.28.0"
},
"devDependencies": {
"@flux-lang/viewer": "^0.1.0",
"@flux-lang/viewer": "workspace:^",
"@playwright/test": "^1.58.1",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^16.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/render-html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test": "vitest"
},
"dependencies": {
"@flux-lang/core": "^0.1.6",
"@flux-lang/core": "workspace:^",
"hyphenation.en-us": "^0.2.1",
"hypher": "^0.2.5"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
"test": "vitest"
},
"dependencies": {
"@flux-lang/brand": "^0.1.0",
"@flux-lang/core": "^0.1.6",
"@flux-lang/render-html": "^0.1.6",
"@flux-lang/typesetter": "^0.1.6"
"@flux-lang/brand": "workspace:^",
"@flux-lang/core": "workspace:^",
"@flux-lang/render-html": "workspace:^",
"@flux-lang/typesetter": "workspace:^"
},
"devDependencies": {
"typescript": "^5.6.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/vscode-flux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"test": "echo \"No tests yet\""
},
"dependencies": {
"@flux-lang/core": "0.1.6"
"@flux-lang/core": "workspace:^"
},
"devDependencies": {
"@types/vscode": "^1.85.0",
Expand Down
3 changes: 3 additions & 0 deletions scripts/release/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
26 changes: 8 additions & 18 deletions scripts/release/syncVersions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,16 @@ type PackageJson = {
optionalDependencies?: Record<string, string>;
};

function alignDependencyVersion(current: string | undefined, nextVersion: string): string {
if (!current) return `^${nextVersion}`;
if (current.startsWith("workspace:")) {
return `workspace:${nextVersion}`;
}
if (current.startsWith("^")) {
return `^${nextVersion}`;
}
if (current.startsWith("~")) {
return `~${nextVersion}`;
}
return nextVersion;
function alignInternalDependency(): string {
return "workspace:^";
}

function updateDeps(deps: Record<string, string> | undefined, packages: Set<string>, nextVersion: string): boolean {
function updateDeps(deps: Record<string, string> | undefined, packages: Set<string>): boolean {
if (!deps) return false;
let changed = false;
for (const [name, value] of Object.entries(deps)) {
if (name.startsWith(INTERNAL_SCOPE) && packages.has(name)) {
const updated = alignDependencyVersion(value, nextVersion);
const updated = alignInternalDependency();
if (updated !== value) {
deps[name] = updated;
changed = true;
Expand All @@ -59,10 +49,10 @@ export async function syncVersions(nextVersion: string): Promise<WorkspacePackag
for (const pkg of packages) {
const pkgJson = await readPackageJson(pkg.dir);
pkgJson.version = nextVersion;
const changed = updateDeps(pkgJson.dependencies, packageNames, nextVersion);
updateDeps(pkgJson.devDependencies, packageNames, nextVersion);
updateDeps(pkgJson.peerDependencies, packageNames, nextVersion);
updateDeps(pkgJson.optionalDependencies, packageNames, nextVersion);
const changed = updateDeps(pkgJson.dependencies, packageNames);
updateDeps(pkgJson.devDependencies, packageNames);
updateDeps(pkgJson.peerDependencies, packageNames);
updateDeps(pkgJson.optionalDependencies, packageNames);
await writePackageJson(pkg.dir, pkgJson);
if (changed) {
// eslint-disable-next-line no-console
Expand Down
16 changes: 5 additions & 11 deletions scripts/release/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
{
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",

"rootDir": ".",
"outDir": "dist",

"strict": true,
"skipLibCheck": true,

"types": ["node"],
"target": "ES2022",
"module": "CommonJS",
"moduleResolution": "Node",
"resolveJsonModule": true,
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["./**/*.ts"]
}
Loading