Skip to content

Commit ba7ea58

Browse files
committed
reset: 2.1.6v
1 parent 6fc87c2 commit ba7ea58

File tree

6 files changed

+1056
-34
lines changed

6 files changed

+1056
-34
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ Feel free to find bugs and report them to me. Your feedback is highly appreciate
1818
jsDelivr:
1919

2020
```bash
21-
https://cdn.jsdelivr.net/npm/[email protected].7/dist/cjs/index.min.js
21+
https://cdn.jsdelivr.net/npm/[email protected].8/dist/bundle.min.js
2222
```
2323

2424
```html
25-
<script src="https://cdn.jsdelivr.net/npm/[email protected].7/dist/cjs/index.min.js"></script>
25+
<script src="https://cdn.jsdelivr.net/npm/[email protected].8/dist/bundle.min.js"></script>
2626
```
2727

2828
unpkg:
2929

3030
```bash
31-
https://unpkg.com/[email protected].7/dist/cjs/index.js
31+
https://unpkg.com/[email protected].8/dist/bundle.js
3232
```
3333

3434
```html
35-
<script src="https://unpkg.com/[email protected].7/dist/cjs/index.js"></script>
35+
<script src="https://unpkg.com/[email protected].8/dist/bundle.js"></script>
3636
```
3737

3838
### Example of use with CDN
3939

4040
```html
41-
<script src="https://cdn.jsdelivr.net/npm/[email protected].7/dist/cjs/index.min.js"></script>
41+
<script src="https://cdn.jsdelivr.net/npm/[email protected].8/dist/bundle.min.js"></script>
4242
<script>
4343
const emailResult = isEmail("123456");
4444
const cpfResult = cpfIsValid("123456");

package.json

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"name": "multiform-validator",
3-
"version": "2.1.7",
3+
"version": "2.1.8",
44
"description": "Javascript library made to validate, several form fields, such as: email, phone, password, cpf etc.",
5-
"main": "./dist/cjs/index.js",
6-
"module": "./dist/esm/index.js",
5+
"main": "./dist/index.js",
76
"types": "./types/index.d.ts",
8-
"unpkg": "./dist/cjs/index.js",
7+
"unpkg": "./dist/bundle.js",
98
"scripts": {
109
"test": "jest --coverage",
1110
"test:file": "jest tests/src/isDecimal.test --watch",
@@ -58,6 +57,8 @@
5857
"Breno A"
5958
],
6059
"devDependencies": {
60+
"@rollup/plugin-replace": "^5.0.7",
61+
"@rollup/plugin-typescript": "^11.1.6",
6162
"@types/jest": "^29.5.12",
6263
"@types/mocha": "^10.0.6",
6364
"@types/node": "^20.5.1",
@@ -66,14 +67,17 @@
6667
"eslint": "^8.57.0",
6768
"eslint-config-prettier": "^9.1.0",
6869
"eslint-plugin-prettier": "^5.1.3",
70+
"gulp": "^5.0.0",
6971
"jest": "^29.6.4",
7072
"prettier": "^3.2.5",
73+
"rollup": "^4.19.0",
74+
"rollup-plugin-terser": "^7.0.2",
75+
"rollup-plugin-ts": "^3.4.5",
7176
"ts-jest": "^29.1.1",
7277
"ts-loader": "^9.5.1",
7378
"ts-node": "^10.9.2",
7479
"typescript": "^5.4.2",
7580
"webpack": "^5.91.0",
7681
"webpack-cli": "^5.1.4"
77-
},
78-
"dependencies": {}
82+
}
7983
}

test.mjs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import a from './dist/esm/index'
2+
3+
console.log(a.isEmail('awd'))
4+
5+
import { isEmail } from './dist/esm/index'
6+
7+
console.log(isEmail('awd'))

tsconfig.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
2626

2727
/* Modules */
28-
"module": "NodeNext" /* Specify what module code is generated. */,
28+
"module": "commonjs" /* Specify what module code is generated. */,
2929
// "rootDir": "./src", /* Specify the root folder within your source files. */
3030
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
3131
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
@@ -55,7 +55,7 @@
5555
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
5656
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
5757
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
58-
"outDir": "./dist/esm" /* Specify an output folder for all emitted files. */,
58+
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
5959
"removeComments": true /* Disable emitting comments. */,
6060
// "noEmit": true, /* Disable emitting files from a compilation. */
6161
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
@@ -104,8 +104,7 @@
104104

105105
/* Completeness */
106106
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
107-
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
108-
"moduleResolution": "NodeNext"
107+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
109108
},
110109
"include": ["src/**/*", "index.ts", ".eslintrc.js"]
111110
}

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const commonjsWebpackConfig = {
44
mode: "production", // production mode
55
entry: "./index.ts", // entry point of your application
66
output: {
7-
filename: "cjs/index.js", // output file name
7+
filename: "bundle.js", // output file name
88
path: path.resolve(__dirname, "dist"), // output folder
99
libraryTarget: "umd", // this allows your module to be used via require() and as a global
1010
globalObject: "this", // this ensures that 'this' is 'window' in a browser environment

0 commit comments

Comments
 (0)