From e0305bc2b652a4314fe6814d21ff9fbfbb187f0a Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Thu, 29 Feb 2024 10:04:52 +0000 Subject: [PATCH 1/4] ci: update github actions --- .github/workflows/build-and-test.yml | 5 ++++- .github/workflows/coverage.yml | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0a350bc10..2bb331343 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -5,6 +5,8 @@ on: [pull_request] jobs: build-and-test: runs-on: ${{ matrix.os }} + permissions: + contents: read strategy: matrix: @@ -13,13 +15,14 @@ jobs: steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: use node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: npm - cache-dependency-path: package-lock.json - name: install run: | diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ff15cc052..bb51dd12f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -9,14 +9,18 @@ on: jobs: getCoverage: runs-on: ubuntu-latest - + permissions: + contents: read + steps: - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: actions/setup-node@v4 with: node-version: '16' cache: npm - cache-dependency-path: package-lock.json - run: npm ci - run: npm i -g c8 codecov From 7f799d8e9cbb5bbb393e49536fc87d57a10e7b8a Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Thu, 25 Apr 2024 09:56:19 +0100 Subject: [PATCH 2/4] chore: export view types --- package.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package.json b/package.json index b8e863253..f15f631ed 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,15 @@ "import": "./src/three.js", "require": "./builds/three/compromise-three.cjs", "types": "./types/three.d.ts" + }, + "./view/one": { + "types": "./types/view/one.d.ts" + }, + "./view/two": { + "types": "./types/view/two.d.ts" + }, + "./view/three": { + "types": "./types/view/three.d.ts" } }, "typesVersions": { From c5a56779e165d9e267f40df6dc8318fd14cde6d8 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Mon, 29 Apr 2024 10:42:13 +0100 Subject: [PATCH 3/4] chore(package): export misc types --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index f15f631ed..f566407c7 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,9 @@ "require": "./builds/three/compromise-three.cjs", "types": "./types/three.d.ts" }, + "./misc": { + "types": "./types/misc.d.ts" + }, "./view/one": { "types": "./types/view/one.d.ts" }, From a15e44449b7246a1b04d3b983cd32655de437705 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Wed, 24 Jul 2024 14:34:59 +0100 Subject: [PATCH 4/4] fix(plugins/dates): limit values for days and months in `mm/dd` format --- plugins/dates/src/model/regex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dates/src/model/regex.js b/plugins/dates/src/model/regex.js index 36276c4df..c70486cd8 100644 --- a/plugins/dates/src/model/regex.js +++ b/plugins/dates/src/model/regex.js @@ -10,7 +10,7 @@ export default [ // @4pm [/^@[1-9]+(am|pm)$/, 'Time', '@5pm'], // 03/02 - [/^[0-9]{2}\/[0-9]{2}$/, 'Date', '03/02'], + [/^(?:0[1-9]|1[0-2])\/(?:0[1-9]|[12]\d|3[01])$/, 'Date', '03/02'], // iso-time // [/^[0-9]{4}[:-][0-9]{2}[:-][0-9]{2}T[0-9]/i, 'Time', 'iso-time-tag']