Skip to content

Commit

Permalink
build: update infra (#298)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: this package is now pure ESM
  • Loading branch information
ikatyang committed Jul 9, 2023
1 parent badd2c7 commit 4270f16
Show file tree
Hide file tree
Showing 26 changed files with 2,624 additions and 4,811 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

13 changes: 13 additions & 0 deletions .github/actions/setup/action.yml
@@ -0,0 +1,13 @@
name: setup
description: setup
runs:
using: composite
steps:
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
cache: pnpm
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- run: pnpm install
shell: bash
16 changes: 16 additions & 0 deletions .github/workflows/publish.yml
@@ -0,0 +1,16 @@
on:
push:
tags:
- v*

jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: pnpm publish --no-git-checks --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,25 @@
on:
push:
branches:
- master
- release-*
pull_request:
branches:
- master
- release-*

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: pnpm run lint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: pnpm run build
- run: pnpm run test
- run: pnpm run check
8 changes: 5 additions & 3 deletions .gitignore
@@ -1,5 +1,7 @@
coverage/
lib/
node_modules/
/.vscode/
/coverage/
/lib/
/node_modules/

*.generated/
*.generated.*
Empty file removed .npmignore
Empty file.
1 change: 1 addition & 0 deletions .prettierignore
@@ -0,0 +1 @@
/pnpm-lock.yaml
3 changes: 3 additions & 0 deletions .prettierrc.yml
@@ -0,0 +1,3 @@
arrowParens: avoid
semi: false
singleQuote: true
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .versionrc.json
@@ -0,0 +1,6 @@
{
"preset": "angular",
"scripts": {
"postchangelog": "prettier --write CHANGELOG.md"
}
}
30 changes: 11 additions & 19 deletions CHANGELOG.md
Expand Up @@ -3,57 +3,49 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="3.0.0"></a>
# [3.0.0](https://github.com/ikatyang/unicode-regex/compare/v2.0.0...v3.0.0) (2019-09-29)

# [3.0.0](https://github.com/ikatyang/unicode-regex/compare/v2.0.0...v3.0.0) (2019-09-29)

### Features

* support Unicode 12.1.0 ([#256](https://github.com/ikatyang/unicode-regex/issues/256)) ([d27a16f](https://github.com/ikatyang/unicode-regex/commit/d27a16f))

- support Unicode 12.1.0 ([#256](https://github.com/ikatyang/unicode-regex/issues/256)) ([d27a16f](https://github.com/ikatyang/unicode-regex/commit/d27a16f))

### BREAKING CHANGES

* upgrade Unicode data from v10.0.0 to v12.1.0


- upgrade Unicode data from v10.0.0 to v12.1.0

<a name="2.0.0"></a>
# [2.0.0](https://github.com/ikatyang/unicode-regex/compare/v1.0.1...v2.0.0) (2018-02-09)

# [2.0.0](https://github.com/ikatyang/unicode-regex/compare/v1.0.1...v2.0.0) (2018-02-09)

### Features

* rewrite with `node-unicode-data` and `regexp-util` ([#57](https://github.com/ikatyang/unicode-regex/issues/57)) ([c26d703](https://github.com/ikatyang/unicode-regex/commit/c26d703))

- rewrite with `node-unicode-data` and `regexp-util` ([#57](https://github.com/ikatyang/unicode-regex/issues/57)) ([c26d703](https://github.com/ikatyang/unicode-regex/commit/c26d703))

### BREAKING CHANGES

More categories, processable output, and adding codepoints that's greater than `0xffff`.

```js
// before
unicode_regex(['Pc', 'Pd', 'Pe', 'Pf', 'Pi', 'Po', 'Ps']);
unicode_regex(['Pc', 'Pd', 'Pe', 'Pf', 'Pi', 'Po', 'Ps'])

// after
unicode({ General_Category: ['Punctuation'] }).toRegExp();
unicode({ General_Category: ['Punctuation'] }).toRegExp()
```



<a name="1.0.1"></a>
## [1.0.1](https://github.com/ikatyang/unicode-regex/compare/v1.0.0...v1.0.1) (2017-11-12)

## [1.0.1](https://github.com/ikatyang/unicode-regex/compare/v1.0.0...v1.0.1) (2017-11-12)

### Bug Fixes

* no invalid pattern ([#1](https://github.com/ikatyang/unicode-regex/issues/1)) ([fcc7caa](https://github.com/ikatyang/unicode-regex/commit/fcc7caa))


- no invalid pattern ([#1](https://github.com/ikatyang/unicode-regex/issues/1)) ([fcc7caa](https://github.com/ikatyang/unicode-regex/commit/fcc7caa))

<a name="1.0.0"></a>
# 1.0.0 (2017-11-12)

# 1.0.0 (2017-11-12)

### Features

* initial implementation ([3b18748](https://github.com/ikatyang/unicode-regex/commit/3b18748))
- initial implementation ([3b18748](https://github.com/ikatyang/unicode-regex/commit/3b18748))
29 changes: 12 additions & 17 deletions README.md
@@ -1,8 +1,7 @@
# unicode-regex

[![npm](https://img.shields.io/npm/v/unicode-regex.svg)](https://www.npmjs.com/package/unicode-regex)
[![build](https://img.shields.io/travis/ikatyang/unicode-regex/master.svg)](https://travis-ci.org/ikatyang/unicode-regex/builds)
[![coverage](https://img.shields.io/codecov/c/github/ikatyang/unicode-regex/master.svg)](https://codecov.io/gh/ikatyang/unicode-regex)
[![build](https://img.shields.io/github/actions/workflow/status/ikatyang/unicode-regex/test.yml)](https://github.com/ikatyang/unicode-regex/actions?query=branch%3Amaster)

regular expression for matching unicode category.

Expand All @@ -11,30 +10,26 @@ regular expression for matching unicode category.
## Install

```sh
# using npm
npm install --save unicode-regex

# using yarn
yarn add unicode-regex
npm install unicode-regex
```

## Usage

```js
const unicode = require('unicode-regex');
import unicode from 'unicode-regex'

const regex = unicode({ General_Category: ['Punctuation'] }).toRegExp();
regex.test('a'); //=> false
regex.test('"'); //=> true
regex.test(''); //=> true
const regex = unicode({ General_Category: ['Punctuation'] }).toRegExp()
regex.test('a') //=> false
regex.test('"') //=> true
regex.test('') //=> true
```

## API

```ts
declare function unicode(categories: {
[category: string]: SubCategory[];
}): Charset;
[category: string]: SubCategory[]
}): Charset
```

Returns a [Charset](https://github.com/ikatyang/regexp-util#charset) for further processing, e.g. union, intersect, etc.
Expand All @@ -45,13 +40,13 @@ Returns a [Charset](https://github.com/ikatyang/regexp-util#charset) for further

```sh
# lint
yarn run lint
pnpm run lint
# build
yarn run build
pnpm run build
# test
yarn run test
pnpm run test
```

## License
Expand Down
19 changes: 0 additions & 19 deletions jest.config.js

This file was deleted.

52 changes: 22 additions & 30 deletions package.json
@@ -1,13 +1,13 @@
{
"name": "unicode-regex",
"type": "module",
"version": "3.0.0",
"description": "regular expression for matching unicode category",
"keywords": [
"regular-expression",
"unicode"
],
"main": "lib/index.js",
"types": "lib/index.d.ts",
"exports": "./lib/index.js",
"repository": "https://github.com/ikatyang/unicode-regex",
"homepage": "https://github.com/ikatyang/unicode-regex#readme",
"author": {
Expand All @@ -17,44 +17,36 @@
},
"license": "MIT",
"scripts": {
"prepublish": "yarn run build",
"lint": "tslint -p ./tsconfig.json --type-check",
"test": "jest",
"generate": "ts-node ./scripts/generate.ts",
"prebuild": "rm -rf ./lib",
"build": "yarn run generate && tsc -p ./tsconfig.build.json",
"postbuild": "cp -r ./src/data.generated ./lib",
"prepack": "pnpm run build",
"lint": "prettier --check .",
"check": "tsc --noEmit",
"test": "vitest",
"build": "vite-node ./scripts/generate.ts && tsc -p ./tsconfig.build.json",
"release": "standard-version"
},
"dependencies": {
"regexp-util": "^1.2.0"
"regexp-util": "^2.0.0"
},
"devDependencies": {
"@types/del": "3.0.1",
"@types/jest": "21.1.10",
"@types/make-dir": "1.0.3",
"@types/node": "8.10.59",
"@types/prettier": "1.18.3",
"del": "3.0.0",
"jest": "21.2.1",
"make-dir": "1.3.0",
"prettier": "1.19.1",
"prettier-config-ikatyang": "1.1.1",
"standard-version": "4.4.0",
"ts-jest": "21.2.4",
"ts-node": "4.1.0",
"tslint": "5.20.1",
"tslint-config-ikatyang": "2.5.1",
"tslint-config-prettier": "1.18.0",
"tslint-plugin-prettier": "2.0.1",
"typescript": "2.9.2",
"unicode-12.1.0": "0.8.0"
"@types/node": "18.16.19",
"@vitest/coverage-v8": "0.33.0",
"del": "7.0.0",
"make-dir": "4.0.0",
"prettier": "3.0.0",
"standard-version": "9.5.0",
"typescript": "5.1.6",
"unicode-12.1.0": "0.8.0",
"vite": "4.4.2",
"vite-node": "0.33.0",
"vitest": "0.33.0"
},
"engines": {
"node": ">= 4"
},
"files": [
"/lib/**/*",
"/CHANGELOG.md",
"/ThirdPartyNoticeText.txt"
]
],
"packageManager": "pnpm@8.6.6"
}

0 comments on commit 4270f16

Please sign in to comment.