@archoleat/reglib 1.0.3 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. package/README.md +33 -2
  2. package/index.d.ts +21 -0
  3. package/index.js +1 -0
  4. package/package.json +32 -42
package/README.md CHANGED
@@ -4,19 +4,50 @@
4
4
  ![NPM Downloads](https://img.shields.io/npm/dm/%40archoleat%2Freglib)
5
5
  ![ESM](https://img.shields.io/badge/ESM-fe0)
6
6
  ![Provenance](https://img.shields.io/badge/Provenance-fo0)
7
- ![CodeQL](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/codeql.yaml?label=CodeQL)
8
7
  ![Specs](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/spec.yaml?label=Specs)
9
8
  ![Commitlint](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/commitlint.yaml?label=Commitlint)
10
9
  ![Editorconfig](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/editorconfig.yaml?label=Editorconfig)
11
10
  ![Prettier](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/prettier.yaml?label=Prettier)
12
11
  ![ESLint](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/eslint.yaml?label=ESLint)
13
- ![Markdown](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/markdown.yaml?label=Markdown)
12
+ ![Remark](https://img.shields.io/github/actions/workflow/status/archoleat/reglib/remark.yaml?label=Remark)
14
13
 
15
14
  ## Table of Contents
16
15
 
16
+ - [Installation](#installtion)
17
+ - [List of Regex](#list-of-regex)
17
18
  - [Contributing](#contributing)
18
19
  - [License](#license)
19
20
 
21
+ ## Installation
22
+
23
+ ```shell
24
+ bun i -D @archoleat/reglib
25
+ ```
26
+
27
+ ## List of Regex
28
+
29
+ - `FONT_FILE_NAME_REGEX`: Matches FontFamily-FontWeight.woff2
30
+
31
+ - `ITALIC_REGEX`: Searches for the words `Italic` or `italic`.
32
+
33
+ - `VARIABLE_FONT_REGEX`: Searches for the words `var` or `variable`.
34
+
35
+ - `selectors`
36
+ - `bem`
37
+ - `BLOCK_REGEX`
38
+ - `ELEMENT_REGEX`
39
+ - `MODIFIER_REGEX`
40
+
41
+ - `child`
42
+ - `ATTRIBUTE_REGEX`
43
+ - `CLASS_REGEX`
44
+
45
+ - `nested`
46
+ - `ATTRIBUTE_REGEX`
47
+ - `CLASS_REGEX`
48
+ - `ELEMENT_REGEX`
49
+ - `MODIFIER_REGEX`
50
+
20
51
  ## Contributing
21
52
 
22
53
  Please read [**CONTRIBUTING**](https://github.com/archoleat/.github/blob/main/CONTRIBUTING.md)
package/index.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ declare const FONT_FILE_NAME_REGEX: RegExp;
2
+
3
+ declare const selectors: {
4
+ bem: {
5
+ BLOCK_REGEX: string;
6
+ ELEMENT_REGEX: string;
7
+ MODIFIER_REGEX: string;
8
+ };
9
+ child: {
10
+ ATTRIBUTE_REGEX: string;
11
+ CLASS_REGEX: string;
12
+ };
13
+ nested: {
14
+ ATTRIBUTE_REGEX: string;
15
+ CLASS_REGEX: string;
16
+ ELEMENT_REGEX: string;
17
+ MODIFIER_REGEX: string;
18
+ };
19
+ };
20
+
21
+ export { FONT_FILE_NAME_REGEX, selectors };
package/index.js ADDED
@@ -0,0 +1 @@
1
+ const c="(Italic)",G="(Variable)",t="[A-Z][a-z]",X=`^${t}+(${t}+)?`,T=["Thin","Hairline","ExtraLight","UltraLight","Light","Regular","Medium","SemiBold","DemiBold","Bold","ExtraBold","UltraBold","Black","Heavy","ExtraBlack","UltraBlack"].join("|"),$=["otf","ttf","woff","woff2"].join("|"),a=`(${X})`,s=`(${T})`,L=`(${$})$`,i=[`${a}-${s}`,`(${c}?)(${G}?)`,`\\.${L}`].join(""),l=new RegExp(i),E="[a-z0-9]",o=String.raw`?\[(.*)\]`,_=String.raw`?\.(.*)`,R="--",n="__",I={bem:{BLOCK_REGEX:`[a-z]${E}*(-${E}+)`,ELEMENT_REGEX:`(${n}${E}+(-${E}+)*)`,MODIFIER_REGEX:`(${R}${E}+(-${E}+)*)`},child:{ATTRIBUTE_REGEX:`${o} &`,CLASS_REGEX:`${_} &`},nested:{ATTRIBUTE_REGEX:o,CLASS_REGEX:_,ELEMENT_REGEX:n,MODIFIER_REGEX:R}};export{l as FONT_FILE_NAME_REGEX,I as selectors};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@archoleat/reglib",
3
3
  "description": "Library with ready-to-use regex",
4
- "version": "1.0.3",
4
+ "version": "1.2.0",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "email": "archoleat@gmail.com",
@@ -20,26 +20,22 @@
20
20
  "archoleat-reglib",
21
21
  "archoleat",
22
22
  "library",
23
+ "plugin",
23
24
  "ready-to-use",
24
25
  "regex",
25
26
  "reglib",
26
27
  "regular-expression",
27
28
  "regular-expressions"
28
29
  ],
29
- "packageManager": "pnpm@9.4.0",
30
+ "packageManager": "pnpm@9.7.0",
30
31
  "engines": {
31
32
  "node": ">=20.0.0",
32
33
  "pnpm": ">=9.0.0"
33
34
  },
34
- "volta": {
35
- "node": "20.16.0",
36
- "pnpm": "9.4.0"
37
- },
38
35
  "type": "module",
39
36
  "imports": {
40
- "#font": "./src/regex/font/index.ts",
41
- "#regex": "./src/regex/index.ts",
42
- "#shared": "./src/shared/index.ts"
37
+ "#index": "./src/index.ts",
38
+ "#validators": "./src/validators/index.ts"
43
39
  },
44
40
  "exports": {
45
41
  ".": "./index.js",
@@ -50,56 +46,50 @@
50
46
  "index.js"
51
47
  ],
52
48
  "scripts": {
53
- "init": "pnpm i && husky",
54
- "spec": "vitest",
55
- "spec:coverage": "vitest run --coverage",
56
- "build": "rollup -c rollup.config.ts --configPlugin typescript",
57
- "release": "semantic-release",
58
- "lint:editorconfig": "editorconfig-checker",
59
- "lint:formatting": "prettier . --check",
60
- "lint:md": "remark . --quiet --frail",
61
- "lint:ts": "eslint src/**/*.ts --fix",
62
- "prettify": "prettier . --write",
63
- "commit": "cz"
49
+ "init": "pnpm i && husky"
64
50
  },
65
51
  "devDependencies": {
66
- "@archoleat/commitlint-define-config": "^1.0.7",
67
- "@archoleat/eslint-flat-compatibility": "^1.1.6",
68
- "@archoleat/semantic-release-define-config": "^1.1.7",
69
- "@commitlint/cli": "^19.3.0",
70
- "@commitlint/config-conventional": "^19.2.2",
71
- "@commitlint/types": "^19.0.3",
72
- "@rollup/plugin-alias": "^5.1.0",
73
- "@rollup/plugin-typescript": "^11.1.6",
52
+ "@archoleat/commitlint-define-config": "^1.1.0",
53
+ "@archoleat/eslint-flat-compatibility": "^1.2.1",
54
+ "@archoleat/prettier-define-config": "^1.1.0",
55
+ "@archoleat/semantic-release-define-config": "^1.2.0",
56
+ "@commitlint/cli": "^19.5.0",
57
+ "@commitlint/config-conventional": "^19.5.0",
58
+ "@commitlint/types": "^19.5.0",
59
+ "@rollup/plugin-alias": "^5.1.1",
60
+ "@rollup/plugin-typescript": "^12.1.1",
74
61
  "@semantic-release/changelog": "^6.0.3",
75
62
  "@semantic-release/git": "^10.0.1",
63
+ "@types/node": "^22.9.0",
76
64
  "@typescript-eslint/eslint-plugin": "^7.18.0",
77
65
  "@typescript-eslint/parser": "^7.18.0",
78
- "@vitest/coverage-v8": "^2.0.4",
66
+ "@vitest/coverage-v8": "^2.1.4",
79
67
  "conventional-changelog-conventionalcommits": "^8.0.0",
80
- "cz-conventional-changelog": "^3.3.0",
81
- "editorconfig-checker": "^5.1.8",
82
- "eslint": "^8.57.0",
68
+ "editorconfig-checker": "^6.0.0",
69
+ "eslint": "^8.57.1",
70
+ "eslint-config-airbnb": "^19.0.4",
83
71
  "eslint-config-airbnb-typescript": "^18.0.0",
84
72
  "eslint-config-prettier": "^9.1.0",
85
73
  "eslint-define-config": "^2.1.0",
86
- "eslint-import-resolver-typescript": "^3.6.1",
87
- "eslint-plugin-import": "^2.29.1",
88
- "eslint-plugin-unicorn": "^55.0.0",
89
- "globals": "^15.8.0",
90
- "husky": "^9.1.4",
91
- "lint-staged": "^15.2.7",
74
+ "eslint-import-resolver-typescript": "^3.6.3",
75
+ "eslint-plugin-import": "^2.31.0",
76
+ "eslint-plugin-simple-import-sort": "^12.1.1",
77
+ "eslint-plugin-unicorn": "^56.0.0",
78
+ "git-pull-run": "^1.4.0",
79
+ "globals": "^15.12.0",
80
+ "husky": "^9.1.6",
81
+ "lint-staged": "^15.2.10",
92
82
  "prettier": "^3.3.3",
93
83
  "remark": "15.0.1",
94
84
  "remark-cli": "^12.0.1",
95
85
  "remark-preset-lint-consistent": "^6.0.0",
96
86
  "remark-preset-lint-markdown-style-guide": "^6.0.0",
97
87
  "remark-preset-lint-recommended": "^7.0.0",
98
- "rollup": "^4.19.1",
88
+ "rollup": "^4.25.0",
99
89
  "rollup-plugin-dts": "^6.1.1",
100
90
  "rollup-plugin-esbuild": "^6.1.1",
101
- "semantic-release": "^24.0.0",
102
- "typescript": "^5.5.4",
103
- "vitest": "^2.0.4"
91
+ "semantic-release": "^24.2.0",
92
+ "typescript": "^5.6.3",
93
+ "vitest": "^2.1.4"
104
94
  }
105
95
  }