@scaleway/regex 5.6.1 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +20 -0
- package/CHANGELOG.md +12 -0
- package/biome.json +10 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -4
- package/package.json +3 -1
- package/vite.config.ts +2 -5
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
> @scaleway/regex@5.8.0 prebuild /home/runner/work/scaleway-lib/scaleway-lib/packages/regex
|
|
3
|
+
> shx rm -rf dist
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
> @scaleway/regex@5.8.0 build /home/runner/work/scaleway-lib/scaleway-lib/packages/regex
|
|
7
|
+
> vite build --config vite.config.ts && pnpm run type:generate
|
|
8
|
+
|
|
9
|
+
[36mvite v7.3.1 [32mbuilding client environment for production...[36m[39m
|
|
10
|
+
transforming...
|
|
11
|
+
[32m✓[39m 1 modules transformed.
|
|
12
|
+
rendering chunks...
|
|
13
|
+
computing gzip size...
|
|
14
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m5.22 kB[22m[1m[22m[2m │ gzip: 1.59 kB[22m
|
|
15
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m5.22 kB[22m[1m[22m[2m │ gzip: 1.59 kB[22m
|
|
16
|
+
[32m✓ built in 257ms[39m
|
|
17
|
+
|
|
18
|
+
> @scaleway/regex@5.8.0 type:generate /home/runner/work/scaleway-lib/scaleway-lib/packages/regex
|
|
19
|
+
> tsc --declaration -p tsconfig.build.json
|
|
20
|
+
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 5.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#2975](https://github.com/scaleway/scaleway-lib/pull/2975) [`7f38853`](https://github.com/scaleway/scaleway-lib/commit/7f38853ffee6111a70e679452245dfe5369e2480) Thanks [@johnnydoubt](https://github.com/johnnydoubt)! - feat: add alphanumDashSegment regex for serverlessdb and datawarehouse resource names
|
|
8
|
+
|
|
9
|
+
## 5.7.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#2846](https://github.com/scaleway/scaleway-lib/pull/2846) [`abe485e`](https://github.com/scaleway/scaleway-lib/commit/abe485e07c8ac15bf9af8e63b991961d5f12c309) Thanks [@MathildeJolly](https://github.com/MathildeJolly)! - feat: add webhosting username email regex
|
|
14
|
+
|
|
3
15
|
## 5.6.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/biome.json
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const alphanumDashDots: RegExp;
|
|
|
8
8
|
export declare const alphanumDashDotsOrEmpty: RegExp;
|
|
9
9
|
export declare const alphanumDashDotsSpaces: RegExp;
|
|
10
10
|
export declare const alphanumDashLowercase: RegExp;
|
|
11
|
+
export declare const alphanumDashSegment: RegExp;
|
|
11
12
|
export declare const alphanumDashSpaces: RegExp;
|
|
12
13
|
export declare const alphaUpperUnderscore: RegExp;
|
|
13
14
|
export declare const alphanumDashOrEmpty: RegExp;
|
|
@@ -53,3 +54,4 @@ export declare const absolutePath: RegExp;
|
|
|
53
54
|
export declare const sgPortRange: RegExp;
|
|
54
55
|
export declare const password: RegExp;
|
|
55
56
|
export declare const kafkaUsernameRegex: RegExp;
|
|
57
|
+
export declare const webhostingUsernameEmailRegex: RegExp;
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const alphanumDashDots = /^[a-zA-Z0-9-.]*$/;
|
|
|
8
8
|
const alphanumDashDotsOrEmpty = /^$|^[a-zA-Z0-9-.]*$/;
|
|
9
9
|
const alphanumDashDotsSpaces = /^[a-zA-Z0-9-.\s]*$/;
|
|
10
10
|
const alphanumDashLowercase = /^[a-z0-9-]+$/;
|
|
11
|
+
const alphanumDashSegment = /^[A-Za-z](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/;
|
|
11
12
|
const alphanumDashSpaces = /^[a-zA-Z0-9-\s]*$/;
|
|
12
13
|
const alphaUpperUnderscore = /^[A-Z_]+$/;
|
|
13
14
|
const alphanumDashOrEmpty = /^$|^[a-zA-Z0-9-]*$/;
|
|
@@ -19,7 +20,7 @@ const alphanumDashUnderscoreDollar = /^[a-zA-Z0-9_$-]*$/;
|
|
|
19
20
|
const alphanumDots = /^[a-zA-Z0-9.]*$/;
|
|
20
21
|
const alphanumLowercase = /^[a-z0-9]+$/;
|
|
21
22
|
const absoluteLinuxPath = /(^\/$|^(\/[a-zA-Z0-9_]+)*$)/;
|
|
22
|
-
const ascii = /^[\
|
|
23
|
+
const ascii = /^[\u0000-\u007F]+$/;
|
|
23
24
|
const organizationAlias = /^[a-z0-9]{2,32}$/;
|
|
24
25
|
const backupKey = /^[A-Z0-9]{8}$|^[A-Z0-9]{32}$/;
|
|
25
26
|
const basicDomain = /^[a-z0-9-]+(\.[a-z0-9-]{1,63})+$/;
|
|
@@ -40,8 +41,8 @@ const url = /^http(s)?:\/\/?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=.]+$
|
|
|
40
41
|
const hexadecimal = /^[0-9a-fA-F]+$/;
|
|
41
42
|
const s3BucketName = /^[a-z0-9][-.a-z0-9]{1,61}[a-z0-9]$/;
|
|
42
43
|
const uuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
43
|
-
const v4 =
|
|
44
|
-
const v6segment =
|
|
44
|
+
const v4 = String.raw`(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}`;
|
|
45
|
+
const v6segment = String.raw`[a-fA-F\d]{1,4}`;
|
|
45
46
|
const v6 = `
|
|
46
47
|
(?:
|
|
47
48
|
(?:${v6segment}:){7}(?:${v6segment}|:)|
|
|
@@ -69,6 +70,7 @@ const absolutePath = /^\/(([\w. -]*)[^\s?]\/?)+$/;
|
|
|
69
70
|
const sgPortRange = /^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5]?[0-9]{1,4})(-(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5]?[0-9]{1,4}))?$/;
|
|
70
71
|
const password = /^(?!@)[^`]*$/;
|
|
71
72
|
const kafkaUsernameRegex = /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/;
|
|
73
|
+
const webhostingUsernameEmailRegex = /^(?!.*\.\.)[a-zA-Z0-9_-][a-zA-Z0-9._-]*[a-zA-Z0-9_-]$/;
|
|
72
74
|
export {
|
|
73
75
|
absoluteLinuxPath,
|
|
74
76
|
absolutePath,
|
|
@@ -85,6 +87,7 @@ export {
|
|
|
85
87
|
alphanumDashDotsSpaces,
|
|
86
88
|
alphanumDashLowercase,
|
|
87
89
|
alphanumDashOrEmpty,
|
|
90
|
+
alphanumDashSegment,
|
|
88
91
|
alphanumDashSpaces,
|
|
89
92
|
alphanumDashUnderscore,
|
|
90
93
|
alphanumDashUnderscoreDollar,
|
|
@@ -124,5 +127,6 @@ export {
|
|
|
124
127
|
uppercaseBasicDomain,
|
|
125
128
|
uppercaseBasicSubdomain,
|
|
126
129
|
url,
|
|
127
|
-
uuid
|
|
130
|
+
uuid,
|
|
131
|
+
webhostingUsernameEmailRegex
|
|
128
132
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/regex",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.0",
|
|
4
4
|
"description": "A small utility to use regex",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
"scripts": {
|
|
30
30
|
"prebuild": "shx rm -rf dist",
|
|
31
31
|
"typecheck": "tsc --noEmit",
|
|
32
|
+
"typecheck:go": "tsgo --noEmit",
|
|
32
33
|
"type:generate": "tsc --declaration -p tsconfig.build.json",
|
|
34
|
+
"type:generate:go": "tsgo --declaration -p tsconfig.build.json",
|
|
33
35
|
"build": "vite build --config vite.config.ts && pnpm run type:generate",
|
|
34
36
|
"build:profile": "npx vite-bundle-visualizer -c vite.config.ts",
|
|
35
37
|
"lint": "eslint --report-unused-disable-directives --cache --cache-strategy content --ext ts,tsx .",
|
package/vite.config.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mergeConfig } from 'vite'
|
|
2
2
|
import { defaultConfig } from '../../vite.config'
|
|
3
3
|
import { defaultConfig as vitestDefaultConfig } from '../../vitest.config'
|
|
4
4
|
|
|
5
|
-
const config =
|
|
6
|
-
...defineConfig(defaultConfig),
|
|
7
|
-
...vitestDefaultConfig,
|
|
8
|
-
}
|
|
5
|
+
const config = mergeConfig(defaultConfig, vitestDefaultConfig)
|
|
9
6
|
|
|
10
7
|
export default mergeConfig(config, {
|
|
11
8
|
build: {
|