Skip to content

Commit

Permalink
reset: 2.1.6v
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-logan committed Jul 25, 2024
1 parent 6fc87c2 commit ba7ea58
Show file tree
Hide file tree
Showing 6 changed files with 1,056 additions and 34 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ Feel free to find bugs and report them to me. Your feedback is highly appreciate
jsDelivr:

```bash
https://cdn.jsdelivr.net/npm/multiform-validator@2.1.7/dist/cjs/index.min.js
https://cdn.jsdelivr.net/npm/multiform-validator@2.1.8/dist/bundle.min.js
```

```html
<script src="https://cdn.jsdelivr.net/npm/multiform-validator@2.1.7/dist/cjs/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/multiform-validator@2.1.8/dist/bundle.min.js"></script>
```

unpkg:

```bash
https://unpkg.com/multiform-validator@2.1.7/dist/cjs/index.js
https://unpkg.com/multiform-validator@2.1.8/dist/bundle.js
```

```html
<script src="https://unpkg.com/multiform-validator@2.1.7/dist/cjs/index.js"></script>
<script src="https://unpkg.com/multiform-validator@2.1.8/dist/bundle.js"></script>
```

### Example of use with CDN

```html
<script src="https://cdn.jsdelivr.net/npm/multiform-validator@2.1.7/dist/cjs/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/multiform-validator@2.1.8/dist/bundle.min.js"></script>
<script>
const emailResult = isEmail("123456");
const cpfResult = cpfIsValid("123456");
Expand Down
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "multiform-validator",
"version": "2.1.7",
"version": "2.1.8",
"description": "Javascript library made to validate, several form fields, such as: email, phone, password, cpf etc.",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"main": "./dist/index.js",
"types": "./types/index.d.ts",
"unpkg": "./dist/cjs/index.js",
"unpkg": "./dist/bundle.js",
"scripts": {
"test": "jest --coverage",
"test:file": "jest tests/src/isDecimal.test --watch",
Expand Down Expand Up @@ -58,6 +57,8 @@
"Breno A"
],
"devDependencies": {
"@rollup/plugin-replace": "^5.0.7",
"@rollup/plugin-typescript": "^11.1.6",
"@types/jest": "^29.5.12",
"@types/mocha": "^10.0.6",
"@types/node": "^20.5.1",
Expand All @@ -66,14 +67,17 @@
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"gulp": "^5.0.0",
"jest": "^29.6.4",
"prettier": "^3.2.5",
"rollup": "^4.19.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-ts": "^3.4.5",
"ts-jest": "^29.1.1",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.2",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
},
"dependencies": {}
}
}
7 changes: 7 additions & 0 deletions test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import a from './dist/esm/index'

console.log(a.isEmail('awd'))

import { isEmail } from './dist/esm/index'

console.log(isEmail('awd'))
7 changes: 3 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */

/* Modules */
"module": "NodeNext" /* Specify what module code is generated. */,
"module": "commonjs" /* Specify what module code is generated. */,
// "rootDir": "./src", /* Specify the root folder within your source files. */
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
Expand Down Expand Up @@ -55,7 +55,7 @@
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "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. */
"outDir": "./dist/esm" /* Specify an output folder for all emitted files. */,
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
"removeComments": true /* Disable emitting comments. */,
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
Expand Down Expand Up @@ -104,8 +104,7 @@

/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"moduleResolution": "NodeNext"
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": ["src/**/*", "index.ts", ".eslintrc.js"]
}
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const commonjsWebpackConfig = {
mode: "production", // production mode
entry: "./index.ts", // entry point of your application
output: {
filename: "cjs/index.js", // output file name
filename: "bundle.js", // output file name
path: path.resolve(__dirname, "dist"), // output folder
libraryTarget: "umd", // this allows your module to be used via require() and as a global
globalObject: "this", // this ensures that 'this' is 'window' in a browser environment
Expand Down
Loading

0 comments on commit ba7ea58

Please sign in to comment.