forked from ianstormtaylor/slate
-
Notifications
You must be signed in to change notification settings - Fork 1
chore: publish npm packages under @deepnote org without any other changes #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
fddfdc9
chore: publish npm packages under @deepnote org without any other cha…
saltenasl 697ea28
chore: ci workflows should use node 18
saltenasl a4a28ae
chore: dont use yarn cache
saltenasl 06ded87
chore: use --openssl-legacy-provider
saltenasl 2958645
chore: fix custom type
saltenasl 61b8abe
chore: run prettier on the newly added file
saltenasl 017df66
chore: bump node version to at least be officially supported
saltenasl ac4f391
chore: refine usage of openssl-legacy-provider
saltenasl 308e7bc
revert: back to using node 16
saltenasl 939f8ab
revert: dont supress implicit any index errors
saltenasl f70d008
Revert "chore: refine usage of openssl-legacy-provider"
saltenasl 13106ef
Revert "chore: use --openssl-legacy-provider"
saltenasl e953b5f
revert: yarn ignore node
saltenasl 07b8c02
chore: fixup tsconfig
saltenasl 5b123ee
chore: change linking strategy
saltenasl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| compressionLevel: mixed | ||
|
|
||
| nodeLinker: node-modules | ||
|
|
||
| enableGlobalCache: false | ||
|
|
||
| packageExtensions: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ declare module 'slate' { | |
| } | ||
| Range: BaseRange & { | ||
| placeholder?: string | ||
| multiBlock?: boolean | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.') | ||
| } | ||
saltenasl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change contradicts PR title.
The PR title states "without any other changes" but adding
multiBlockis a functional change to the type system.🤖 Prompt for AI Agents
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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