diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index aa12b819..72dc82b8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..b5db5b3b --- /dev/null +++ b/.github/workflows/test.yml @@ -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 diff --git a/src/plugins/sync-plugin.js b/src/plugins/sync-plugin.js index 6c4183d1..668f727a 100644 --- a/src/plugins/sync-plugin.js +++ b/src/plugins/sync-plugin.js @@ -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) => { @@ -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) => {