-
Notifications
You must be signed in to change notification settings - Fork 122
feat: migrate Header tool to the Editor.js v3 SDK #130
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
Open
Reversean
wants to merge
8
commits into
v3
Choose a base branch
from
feat/sdk-v3-migration
base: v3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fa7677b
initial
khaydarov f62291d
prepare for version 3
khaydarov 28d36a4
feat: migrate Header tool to the Editor.js v3 SDK
Reversean ceb78ca
docs: update README for the v3 API and document workspace-only usage
Reversean 7fab8b0
refactor: address review feedback on the v3 migration
Reversean a7c8211
docs: document levels as reserved, not yet enforced
Reversean aa7f944
docs: minimize README changes to what this PR actually affects
Reversean f11ad33
docs: refine JSDoc wording and fix stray formatting
Reversean 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,30 @@ | ||
| .yarn/* | ||
| !.yarn/patches | ||
| !.yarn/plugins | ||
| !.yarn/releases | ||
| !.yarn/sdks | ||
| !.yarn/versions | ||
|
|
||
| # Swap the comments on the following lines if you don't wish to use zero-installs | ||
| # Documentation here: https://yarnpkg.com/features/zero-installs | ||
| #!.yarn/cache | ||
| #.pnp.* | ||
|
|
||
| # IDE | ||
| .idea/* | ||
|
|
||
| node_modules/* | ||
| npm-debug.log | ||
| .idea/ | ||
| dist/* | ||
|
|
||
| # tests | ||
| coverage/ | ||
| reports/ | ||
|
|
||
| # stryker temp files | ||
| .stryker-tmp | ||
| *.tsbuildinfo | ||
|
|
||
| .DS_Store | ||
| dist | ||
|
|
||
| # ENV | ||
| **/.env |
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 |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import CodeX from 'eslint-config-codex'; | ||
|
|
||
| export default [ | ||
| ...CodeX, | ||
|
|
||
| { | ||
| ignores: ['vite.config.ts', 'postcss.config.js', 'src/__mocks__/*'], | ||
| }, | ||
|
|
||
| { | ||
| languageOptions: { | ||
| parserOptions: { | ||
| project: './tsconfig.eslint.json', | ||
| tsconfigRootDir: import.meta.dirname, | ||
| sourceType: 'module', | ||
| }, | ||
| }, | ||
| rules: { | ||
| 'n/no-unpublished-import': ['error', { | ||
| allowModules: ['eslint-config-codex'], | ||
| ignoreTypeImport: true, | ||
| }], | ||
| 'n/no-missing-import': ['error', { | ||
| allowModules: ['@editorjs/model', '@editorjs/sdk', '@editorjs/dom-adapters'], | ||
| }], | ||
| }, | ||
| }, | ||
|
|
||
| { | ||
| files: ['**/*.spec.ts'], | ||
| rules: { | ||
| 'n/no-unpublished-import': ['error', { | ||
| allowModules: ['@jest/globals'], | ||
| }], | ||
| }, | ||
| }, | ||
| ]; |
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,19 @@ | ||
| import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
|
||
| export default { | ||
| preset: 'ts-jest', | ||
| testEnvironment: 'jsdom', | ||
| testMatch: ['<rootDir>/src/**/*.spec.ts'], | ||
| extensionsToTreatAsEsm: ['.ts'], | ||
| moduleNameMapper: { | ||
| '^(\\.{1,2}/.*)\\.js$': '$1', | ||
| '\\.pcss$': '<rootDir>/src/__mocks__/styleMock.cjs', | ||
| }, | ||
| coverageReporters: ['lcov', 'json-summary', 'text-summary'], | ||
| transform: { | ||
| '^.+\\.tsx?$': [ | ||
| 'ts-jest', | ||
| { useESM: true }, | ||
| ], | ||
| }, | ||
| } as JestConfigWithTsJest; |
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 |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /** | ||
| * PostCSS configuration | ||
| */ | ||
| export default { | ||
| plugins: { | ||
| 'postcss-preset-env': {}, | ||
| 'postcss-apply': {}, | ||
| }, | ||
| }; |
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,3 @@ | ||
| module.exports = new Proxy({}, { | ||
| get: (_target, prop) => prop, | ||
| }); |
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
| .header { | ||
| outline: none; | ||
| white-space: pre-wrap; | ||
| margin: 0; | ||
| min-height: 1em; | ||
| } |
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.
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.
why "levels" configuration was dropped?
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 initially dropped the
levelsbecause it was non-functional (even in #128).Fully implementing
levelsisn't possible right now — there's an active discussion on the architecture of mechanisms like this (Block Tunes): editor-js/document-model#157 (review)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.
Levels in configuration were limiting available levels.
e.g.
levels: [2,3,4]would allow only levels form 2 to 4 for the Header tool, it's not related to the tunes themselves