Skip to content

Commit 88c77a1

Browse files
committed
Merge branch 'main' into format-stacks-on-remote-op
2 parents fc106f6 + bffd733 commit 88c77a1

File tree

90 files changed

+1395
-353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1395
-353
lines changed

.github/actions/mutation-tests-all-files/action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,20 @@ runs:
1919
- name: Setup environment
2020
uses: ./.github/actions/setup
2121

22+
- name: Get changed files
23+
uses: tj-actions/[email protected]
24+
id: changed-files
25+
with:
26+
files_yaml: |
27+
src:
28+
- 'src/**/*.ts'
29+
- '!src/**/*.spec.ts'
30+
- '!src/**/__mocks__/**'
31+
separator: "','"
32+
path: ${{ inputs.working-directory }}
33+
2234
- name: Run mutation tests
35+
if: steps.changed-files.outputs.src_any_changed == 'true'
2336
env:
2437
STRYKER_DASHBOARD_API_KEY: ${{ inputs.stryker_dashboard_api_key }}
2538
shell: bash
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and push docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Login to GitHub registry
20+
uses: docker/login-action@v3
21+
with:
22+
registry: ${{ env.REGISTRY }}
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Extract metadata (tags, labels) for Docker
27+
id: meta
28+
uses: docker/metadata-action@v5
29+
with:
30+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
31+
tags: |
32+
type=ref,event=branch
33+
type=ref,event=pr
34+
type=raw,value={{branch}}-{{sha}}-{{date 'X'}},enable=${{ startsWith(github.ref, 'refs/heads') }}
35+
type=semver,pattern={{version}}
36+
type=semver,pattern={{major}}.{{minor}}
37+
38+
- name: Build and push image
39+
uses: docker/build-push-action@v6
40+
with:
41+
context: .
42+
tags: ${{ steps.meta.outputs.tags }}
43+
labels: ${{ steps.meta.outputs.labels }}
44+
push: true

.github/workflows/core.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Core check
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Run ESLint check
11+
uses: ./.github/actions/lint
12+
with:
13+
package-name: '@editorjs/core'
14+
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Build the package
20+
uses: ./.github/actions/build
21+
with:
22+
package-name: '@editorjs/core'

.github/workflows/sdk.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: SDK check
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Run ESLint check
11+
uses: ./.github/actions/lint
12+
with:
13+
package-name: '@editorjs/sdk'
14+
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Build the package
20+
uses: ./.github/actions/build
21+
with:
22+
package-name: '@editorjs/sdk'

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ reports/
2525
*.tsbuildinfo
2626

2727
.DS_Store
28+
29+
# ENV
30+
**/.env

packages/core/eslint.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ export default [
2121
],
2222
ignoreTypeImport: true,
2323
}],
24+
// @todo: remove when we setup eslint to correctly handle the types
25+
'n/no-missing-import': 'off',
26+
'@typescript-eslint/no-unsafe-call': 'off',
27+
'@typescript-eslint/no-unsafe-member-access': 'off',
28+
'@typescript-eslint/no-unsafe-assignment': 'off',
29+
'@typescript-eslint/no-unsafe-argument': 'off',
30+
'@typescript-eslint/no-missing-import': 'off',
31+
'@typescript-eslint/no-unsafe-return': 'off',
2432
},
2533
},
2634
];

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "yarn clear && tsc --build tsconfig.build.json",
99
"dev": "yarn build --watch",
1010
"lint": "eslint ./src",
11-
"lint:ci": "yarn lint --max-warnings 0",
11+
"lint:ci": "eslint --config ./eslint.config.mjs ./src --max-warnings 0",
1212
"lint:fix": "yarn lint --fix",
1313
"clear": "rm -rf ./dist && rm -rf ./tsconfig.build.tsbuildinfo"
1414
},

packages/core/src/api/BlocksAPI.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import 'reflect-metadata';
22
import { Inject, Service } from 'typedi';
33
import { BlocksManager } from '../components/BlockManager.js';
44
import { BlockToolData, ToolConfig } from '@editorjs/editorjs';
5-
import { CoreConfigValidated } from '../entities/index.js';
5+
import { CoreConfigValidated } from '@editorjs/sdk';
6+
import { BlocksAPI as BlocksApiInterface } from '@editorjs/sdk';
67

78
/**
89
* Blocks API
910
* - provides methods to work with blocks
1011
*/
1112
@Service()
12-
export class BlocksAPI {
13+
export class BlocksAPI implements BlocksApiInterface {
1314
/**
1415
* BlocksManager instance to work with blocks
1516
*/
@@ -58,7 +59,6 @@ export class BlocksAPI {
5859
): void {
5960
this.#blocksManager.insert({
6061
type,
61-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
6262
data,
6363
index,
6464
replace,

packages/core/src/api/SelectionAPI.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import { Service } from 'typedi';
44
import { SelectionManager } from '../components/SelectionManager.js';
55
import { createInlineToolName } from '@editorjs/model';
66
import { InlineToolFormatData } from '@editorjs/sdk';
7+
import { SelectionAPI as SelectionApiInterface } from '@editorjs/sdk';
78

89
/**
910
* Selection API class
1011
* - provides methods to work with selection
1112
*/
1213
@Service()
13-
export class SelectionAPI {
14+
export class SelectionAPI implements SelectionApiInterface {
1415
#selectionManager: SelectionManager;
1516

1617
/**

packages/core/src/api/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import 'reflect-metadata';
22
import { Inject, Service } from 'typedi';
3+
import { EditorAPI as EditorApiInterface } from '@editorjs/sdk';
34
import { BlocksAPI } from './BlocksAPI.js';
45
import { SelectionAPI } from './SelectionAPI.js';
56

67
/**
78
* Class gathers all Editor's APIs
89
*/
910
@Service()
10-
export class EditorAPI {
11+
export class EditorAPI implements EditorApiInterface {
1112
/**
1213
* Blocks API instance to work with blocks
1314
*/

0 commit comments

Comments
 (0)