Skip to content

Commit

Permalink
Upgrade dependencies, adapt workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
adanski committed Dec 5, 2023
1 parent 539aae8 commit 529fc79
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 36 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,30 @@ name: build

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{matrix.node-version}}
- run: npm install
- run: npm run build
- name: Build
run: |
npm install
npm run build
test:
needs: build
uses: ./.github/workflows/test.yml
secrets: inherit
18 changes: 11 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ on:

jobs:
publish-npm:
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm run build
- run: npm publish
- name: Build and publish
run: |
npm install
npm run build
npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
16 changes: 10 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ on:

jobs:
test:
runs-on: windows-latest
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{matrix.node-version}}
- run: npm install
- run: npm test
- name: Test
run: |
npm install
npm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ target/
# Dependencies
node_modules/
jspm_packages/
# Libraries should not commit package-lock
package-lock.json

# Logs
Expand Down
29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"build": "npm run build:tsc && npm run build:bundle && npm run build:css",
"build:tsc": "tsc --project src/tsconfig.json",
"build:bundle": "esbuild src/index.ts --bundle --format=esm --platform=browser --target=esnext --outfile=dist/bundle/comments-element-esm.js --legal-comments=none",
"build:css": "ts-node --esm -P tsconfig-template.json -O {\\\"moduleResolution\\\":\\\"node\\\"} compact-css.ts",
"build:css": "tsx --tsconfig tsconfig-template.json compact-css.ts",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest"
},
"files": [
Expand Down Expand Up @@ -57,24 +57,25 @@
"url": "https://github.com/adanski/ax-comments.git"
},
"engines": {
"node": ">=16.0.0 <21.0.0"
"node": ">=18.0.0 <21.0.0"
},
"dependencies": {
"@textcomplete/core": "~0.1.12",
"@textcomplete/textarea": "~0.1.12",
"dompurify": "~2.4.3"
"eventemitter3": "^5.0.1",
"dompurify": "~3.0.6"
},
"devDependencies": {
"@types/node": "~16.18.10",
"@jest/globals": "~29.3.1",
"@types/dompurify": "~2.4.0",
"typescript": "~4.9.4",
"tslib": "~2.4.1",
"jest": "~29.3.1",
"jest-environment-jsdom": "~29.3.1",
"ts-jest": "~29.0.3",
"ts-node": "~10.9.1",
"esbuild": "~0.16.14",
"magic-string": "~0.27.0"
"@types/node": "~20.10.3",
"@jest/globals": "~29.7.0",
"@types/dompurify": "~3.0.5",
"typescript": "~5.3.2",
"tslib": "~2.6.2",
"jest": "~29.7.0",
"jest-environment-jsdom": "~29.7.0",
"ts-jest": "~29.1.1",
"tsx": "~4.6.2",
"esbuild": "~0.19.8",
"magic-string": "~0.30.5"
}
}
2 changes: 1 addition & 1 deletion src/comment-view-model.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {CommentsById, CommentModelEnriched, CommentId} from './comments-by-id.js';
import EventEmitter from 'EventEmitter3';
import {CommentModel} from './options/models.js';
import {EventEmitter} from 'eventemitter3';

export class CommentViewModel {

Expand Down
2 changes: 1 addition & 1 deletion src/comments-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {CommentSorter} from './comment-sorter.js';
import {NavigationElement} from './subcomponent/navigation-element.js';
import {SpinnerFactory} from './subcomponent/spinner-factory.js';
import {CommentViewModel, CommentViewModelEvent} from './comment-view-model.js';
import {findParentsBySelector, findSiblingsBySelector, hideElement, showElement} from './html-util.js';
import {findParentsBySelector, hideElement} from './html-util.js';
import {STYLE_SHEET} from './css/stylesheet.js';
import {RegisterCustomElement} from './register-custom-element.js';
import {createDynamicStylesheet} from './css/dynamic-stylesheet-factory.js';
Expand Down
2 changes: 1 addition & 1 deletion tsconfig-template.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"module": "nodenext",
"moduleResolution": "nodenext",
"noEmitOnError": true,
"lib": ["esnext", "dom", "dom.iterable"],
Expand Down

0 comments on commit 529fc79

Please sign in to comment.