Skip to content
Closed
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 @@ -24,10 +24,10 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: yarn
key: node16

- name: Run ${{ matrix.command }}
run: yarn && yarn build && yarn ${{ matrix.command }}
env:
CI: true
YARN_IGNORE_NODE: 1
5 changes: 2 additions & 3 deletions .github/workflows/comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ jobs:
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: yarn
node-version: 20.x
registry-url: https://registry.npmjs.org
key: node16
key: node20

- name: Install dependencies
run: yarn
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: yarn
registry-url: https://registry.npmjs.org
key: node16

- name: Install dependencies
run: yarn
env:
YARN_IGNORE_NODE: 1

- name: Prepare release
run: yarn prerelease
env:
YARN_IGNORE_NODE: 1

# https://github.com/changesets/action
- name: Create release pull request or Publish to npm
Expand All @@ -43,7 +46,7 @@ jobs:
with:
# defined in package.json#scripts
version: yarn changesetversion
publish: yarn changeset publish
publish: node scripts/publish-fork.js
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
compressionLevel: mixed

nodeLinker: node-modules

enableGlobalCache: false

packageExtensions:
Expand Down
1 change: 1 addition & 0 deletions packages/slate-react/src/custom-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ declare module 'slate' {
}
Range: BaseRange & {
placeholder?: string
multiBlock?: boolean
Copy link

@coderabbitai coderabbitai bot Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Change contradicts PR title.

The PR title states "without any other changes" but adding multiBlock is a functional change to the type system.

🤖 Prompt for AI Agents
In packages/slate-react/src/custom-types.ts around line 12, the new optional
property `multiBlock?: boolean` was added which is a functional type-system
change that contradicts the PR title claiming "without any other changes";
either remove/revert the `multiBlock` addition to keep the change purely
non-functional, or if the property is required, update the PR title and
description to reflect this behavioral/type change and add a brief rationale in
the PR body explaining why the new field is necessary and any downstream
impacts.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know, but this was missing

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saltenasl, understood! Since this was a necessary addition, you might want to mention it briefly in the PR description for future reference—but that's up to you.

🐰
(•‿•)
/>📝


✏️ Learnings added
Learnt from: saltenasl
Repo: deepnote/slate PR: 5
File: packages/slate-react/src/custom-types.ts:12-12
Timestamp: 2025-11-24T16:52:16.764Z
Learning: In packages/slate-react/src/custom-types.ts, the multiBlock?: boolean property was intentionally added to the Range interface as it was missing functionality, even though the PR title mentioned "without any other changes".

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

}
}
}
57 changes: 57 additions & 0 deletions scripts/publish-fork.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const fs = require('fs')
const path = require('path')
const { execSync } = require('child_process')

const SLATE_PKG_PATH = path.resolve(__dirname, '../packages/slate/package.json')
const SLATE_REACT_PKG_PATH = path.resolve(
__dirname,
'../packages/slate-react/package.json'
)

const originalSlatePkg = fs.readFileSync(SLATE_PKG_PATH, 'utf8')
const originalSlateReactPkg = fs.readFileSync(SLATE_REACT_PKG_PATH, 'utf8')

try {
console.log('Mutating package.json files for @deepnote fork publication...')

// 1. Mutate packages/slate/package.json
const slatePkg = JSON.parse(originalSlatePkg)
const slateVersion = slatePkg.version
slatePkg.name = '@deepnote/slate'
fs.writeFileSync(SLATE_PKG_PATH, JSON.stringify(slatePkg, null, 2) + '\n')
console.log(`Updated ${SLATE_PKG_PATH} name to @deepnote/slate`)

// 2. Mutate packages/slate-react/package.json
const slateReactPkg = JSON.parse(originalSlateReactPkg)
slateReactPkg.name = '@deepnote/slate-react'

const dependencyString = `npm:@deepnote/slate@${slateVersion}`

if (slateReactPkg.dependencies && slateReactPkg.dependencies.slate) {
slateReactPkg.dependencies.slate = dependencyString
}
if (slateReactPkg.peerDependencies && slateReactPkg.peerDependencies.slate) {
slateReactPkg.peerDependencies.slate = dependencyString
}

fs.writeFileSync(
SLATE_REACT_PKG_PATH,
JSON.stringify(slateReactPkg, null, 2) + '\n'
)
console.log(
`Updated ${SLATE_REACT_PKG_PATH} name to @deepnote/slate-react and dependencies`
)

// 3. Run changeset publish
console.log('Running yarn changeset publish...')
execSync('yarn changeset publish', { stdio: 'inherit' })
} catch (error) {
console.error('Error during publish-fork script:', error)
process.exit(1)
} finally {
// 4. Restore original package.json files
console.log('Restoring original package.json files...')
fs.writeFileSync(SLATE_PKG_PATH, originalSlatePkg)
fs.writeFileSync(SLATE_REACT_PKG_PATH, originalSlateReactPkg)
console.log('Restoration complete.')
}
Loading