From d2d9ec56028e578d621e209e719f1844be0df54a Mon Sep 17 00:00:00 2001 From: AlexVipond Date: Mon, 17 May 2021 12:45:56 -0600 Subject: [PATCH] generate types for package --- .npmignore | 7 ++++ package-lock.json | 94 ---------------------------------------------- package.json | 16 +++----- tsconfig.json | 4 +- vite.config.ts | 2 +- vite.lib.config.ts | 3 +- 6 files changed, 18 insertions(+), 108 deletions(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..0685a46 --- /dev/null +++ b/.npmignore @@ -0,0 +1,7 @@ +# Ignore everything +* + +# Except these files +# !dist/**/*.js +!lib/**/*.js +!lib/index.d.ts diff --git a/package-lock.json b/package-lock.json index 31a41a1..faeda3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,13 +13,11 @@ "@headlessui/vue": "^1.2.0", "@heroicons/vue": "^1.0.1", "nanoid": "^3.1.23", - "query-string": "^7.0.0", "vue": "^3.0.11" }, "devDependencies": { "@fontsource/inconsolata": "^4.3.0", "@fontsource/inter": "^4.3.0", - "@fontsource/shadows-into-light-two": "^4.3.0", "@tailwindcss/forms": "^0.3.2", "@vitejs/plugin-vue": "^1.2.2", "autoprefixer": "^10.2.5", @@ -102,12 +100,6 @@ "integrity": "sha512-qtUF+Fn9vH4O7V/13kOeemEJpQfhTMxtnOJzJw3kY7SOwl1cbs4fnd9QnQOczU3AVBJEPF1ik639uvaOg7g43A==", "dev": true }, - "node_modules/@fontsource/shadows-into-light-two": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@fontsource/shadows-into-light-two/-/shadows-into-light-two-4.3.0.tgz", - "integrity": "sha512-KQRYm/NZ7EhnySuJ6l3J1jHHsiRFoynKBUJl9kuG48mqH0/EqF1ic4KQ+55PNwpCU7g77nirV8qCknnk1TZXyw==", - "dev": true - }, "node_modules/@fullhuman/postcss-purgecss": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/@fullhuman/postcss-purgecss/-/postcss-purgecss-3.1.3.tgz", @@ -742,14 +734,6 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.17.tgz", "integrity": "sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A==" }, - "node_modules/decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "engines": { - "node": ">=0.10" - } - }, "node_modules/defined": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", @@ -903,14 +887,6 @@ "node": ">=8" } }, - "node_modules/filter-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", - "integrity": "sha1-mzERErxsYSehbgFsbF1/GeCAXFs=", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/fraction.js": { "version": "4.0.13", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.0.13.tgz", @@ -1800,23 +1776,6 @@ "purgecss": "bin/purgecss.js" } }, - "node_modules/query-string": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.0.0.tgz", - "integrity": "sha512-Iy7moLybliR5ZgrK/1R3vjrXq03S13Vz4Rbm5Jg3EFq1LUmQppto0qtXz4vqZ386MSRjZgnTSZ9QC+NZOSd/XA==", - "dependencies": { - "decode-uri-component": "^0.2.0", - "filter-obj": "^1.1.0", - "split-on-first": "^1.0.0", - "strict-uri-encode": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -1989,22 +1948,6 @@ "dev": true, "peer": true }, - "node_modules/split-on-first": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", - "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/strict-uri-encode": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", - "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=", - "engines": { - "node": ">=4" - } - }, "node_modules/string-hash": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", @@ -2324,12 +2267,6 @@ "integrity": "sha512-qtUF+Fn9vH4O7V/13kOeemEJpQfhTMxtnOJzJw3kY7SOwl1cbs4fnd9QnQOczU3AVBJEPF1ik639uvaOg7g43A==", "dev": true }, - "@fontsource/shadows-into-light-two": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@fontsource/shadows-into-light-two/-/shadows-into-light-two-4.3.0.tgz", - "integrity": "sha512-KQRYm/NZ7EhnySuJ6l3J1jHHsiRFoynKBUJl9kuG48mqH0/EqF1ic4KQ+55PNwpCU7g77nirV8qCknnk1TZXyw==", - "dev": true - }, "@fullhuman/postcss-purgecss": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/@fullhuman/postcss-purgecss/-/postcss-purgecss-3.1.3.tgz", @@ -2834,11 +2771,6 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.17.tgz", "integrity": "sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A==" }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" - }, "defined": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", @@ -2961,11 +2893,6 @@ "to-regex-range": "^5.0.1" } }, - "filter-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", - "integrity": "sha1-mzERErxsYSehbgFsbF1/GeCAXFs=" - }, "fraction.js": { "version": "4.0.13", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.0.13.tgz", @@ -3656,17 +3583,6 @@ "postcss-selector-parser": "^6.0.2" } }, - "query-string": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.0.0.tgz", - "integrity": "sha512-Iy7moLybliR5ZgrK/1R3vjrXq03S13Vz4Rbm5Jg3EFq1LUmQppto0qtXz4vqZ386MSRjZgnTSZ9QC+NZOSd/XA==", - "requires": { - "decode-uri-component": "^0.2.0", - "filter-obj": "^1.1.0", - "split-on-first": "^1.0.0", - "strict-uri-encode": "^2.0.0" - } - }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -3785,16 +3701,6 @@ "dev": true, "peer": true }, - "split-on-first": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", - "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==" - }, - "strict-uri-encode": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", - "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=" - }, "string-hash": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", diff --git a/package.json b/package.json index c89509e..1b4d3bd 100644 --- a/package.json +++ b/package.json @@ -2,28 +2,25 @@ "name": "@alexvipond/css-selector-pipes", "version": "0.0.0", "description": "Pipeline functions for building CSS selectors programmatically", - "files": [ - "dist" - ], - "main": "./dist/css-selector-pipes.umd.js", - "module": "./dist/css-selector-pipes.es.js", + "main": "./lib/index.umd.js", + "module": "./lib/index.es.js", + "types": "./lib/index.d.ts", "exports": { ".": { - "import": "./dist/css-selector-pipes.es.js", - "require": "./dist/css-selector-pipes.umd.js" + "import": "./lib/index.es.js", + "require": "./lib/index.umd.js" } }, "scripts": { "dev": "vite", "build": "vite build", - "build:lib": "vite build --config vite.lib.config.ts", + "build:lib": "vite build --config vite.lib.config.ts && tsc", "test:only": "run() { uvu -r ts-node/register tests/$2 $1.test.ts$; }; run", "test": "npm run test:only ." }, "devDependencies": { "@fontsource/inconsolata": "^4.3.0", "@fontsource/inter": "^4.3.0", - "@fontsource/shadows-into-light-two": "^4.3.0", "@tailwindcss/forms": "^0.3.2", "@vitejs/plugin-vue": "^1.2.2", "autoprefixer": "^10.2.5", @@ -40,7 +37,6 @@ "@headlessui/vue": "^1.2.0", "@heroicons/vue": "^1.0.1", "nanoid": "^3.1.23", - "query-string": "^7.0.0", "vue": "^3.0.11" } } diff --git a/tsconfig.json b/tsconfig.json index 0b3602a..eb65b64 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,11 +6,11 @@ "moduleResolution": "node", "allowSyntheticDefaultImports": true, "declaration": true, - "declarationDir": "types", + "declarationDir": "lib", "emitDeclarationOnly": true }, "include": [ - "src/**/*", + "src/pipes/**/*", ], "exclude": [ "node_modules" diff --git a/vite.config.ts b/vite.config.ts index 7ba14f8..f62773f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,6 +2,6 @@ import pluginVue from '@vitejs/plugin-vue' export default { plugins: [ - pluginVue() + pluginVue(), ], } diff --git a/vite.lib.config.ts b/vite.lib.config.ts index 0f64ef7..7df37dd 100644 --- a/vite.lib.config.ts +++ b/vite.lib.config.ts @@ -2,7 +2,8 @@ export default { build: { lib: { entry: 'src/pipes/index.ts', - name: 'CssSelectorPipes', + name: 'CssSelectorPipes', + fileName: 'index', }, outDir: 'lib', }