diff --git a/.gitignore b/.gitignore index 2aed53e..0ea380e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ coverage # Dependency directories node_modules/ + +build/ diff --git a/LICENSE b/LICENSE index fd1d5af..f0c5049 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Chen Asraf +Copyright (c) 2022 Chen Asraf Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index af45fc4..89b53dd 100644 --- a/README.md +++ b/README.md @@ -90,11 +90,11 @@ const result = [ ## How to use -Simply pass a string to the parse to get the result. +Simply pass a string to the parse function to get the results. ```js import { parse } from 'search-query-parser' -const result = parse('(mango banana lemon) OR apple -pineapple') +const results = parse('(mango banana lemon) OR apple -pineapple') ``` ## Supported operators diff --git a/package.json b/package.json index d54d194..938389c 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,9 @@ "typescript": "^4.7.4" }, "scripts": { - "test": "jest" + "test": "jest", + "build": "tsc && yarn copy-files && yarn package", + "copy-files": "cp README.md LICENSE build/", + "package": "jq 'del(.scripts, .devDependencies)' < package.json > build/package.json" } } diff --git a/tsconfig.json b/tsconfig.json index b231aca..5af8067 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,10 @@ { + "files": [ + "./src/index.ts" + ], + "exclude": [ + "__tests__/**/*", + ], "compilerOptions": { /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ @@ -39,7 +45,7 @@ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ // "declarationMap": true, /* Create sourcemaps for d.ts files. */ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ @@ -90,6 +96,6 @@ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ /* Completeness */ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ + "skipLibCheck": true, /* Skip type checking all .d.ts files. */ } }