Skip to content

Commit

Permalink
chore - Fix lint and add test github action (#15)
Browse files Browse the repository at this point in the history
* fix lint

* add test job and update node
  • Loading branch information
jamesopti authored Apr 9, 2024
1 parent e2997d8 commit cfa0665
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
# Setup .npmrc file to publish to GitHub Packages

- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: "14.x"
node-version: "18.x"
registry-url: "https://npm.pkg.github.com"
# Defaults to the user or organization that owns the workflow file

Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: test-and-lint

# on events
on:
pull_request:
branches:
- master
push:
branches:
- master

# env
env:
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}

jobs:
test-and-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: "18.x"

- name: Install dependencies
run: npm install

- name: Lint
run: npm run lint

- name: Test
run: npm run test
8 changes: 4 additions & 4 deletions src/plugins/sync-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,10 +701,10 @@ const createNodeFromYElement = (
message: e.message,
el: JSON.stringify(el),
attrs: JSON.stringify(attrs),
children: JSON.stringify(children),
});
children: JSON.stringify(children)
})
} catch (_e) {
console.error('[@gamma-app/y-prosemirror][sync-plugin] createNodeFromYElement error forming error message:', _e);
console.error('[@gamma-app/y-prosemirror][sync-plugin] createNodeFromYElement error forming error message:', _e)
}
// an error occured while creating the node. This is probably a result of a concurrent action.
/** @type {Y.Doc} */ (el.doc).transact((transaction) => {
Expand Down Expand Up @@ -747,7 +747,7 @@ const createTextNodesFromYText = (
} catch (e) {
console.error('[@gamma-app/y-prosemirror][sync-plugin] createTextNodesFromYText error:', {
message: e.message,
text,
text
});
// an error occured while creating the node. This is probably a result of a concurrent action.
/** @type {Y.Doc} */ (text.doc).transact((transaction) => {
Expand Down

0 comments on commit cfa0665

Please sign in to comment.