From ed83a81a86bf7703efdc7983d1568e7e397b5e00 Mon Sep 17 00:00:00 2001 From: Gentilhomme Date: Mon, 6 Jun 2022 14:54:14 +0200 Subject: [PATCH] feat(package): add types to add TS to Node.js exports configuration (#12) * feat(package): add types to add TS to Node.js exports configuration * refactor(workaround): move web to the root --- package.json | 111 +++++++++++++++++++++------------------ src/web.d.ts => web.d.ts | 0 2 files changed, 59 insertions(+), 52 deletions(-) rename src/web.d.ts => web.d.ts (100%) diff --git a/package.json b/package.json index a823257..c2364e0 100644 --- a/package.json +++ b/package.json @@ -1,52 +1,59 @@ -{ - "name": "@nodesecure/flags", - "version": "2.2.0", - "description": "NodeSecure security flags", - "scripts": { - "test": "cross-env esm-tape-runner 'test/**/*.js' | tap-monkey", - "coverage": "c8 -r html npm test", - "lint": "cross-env eslint index.js", - "generateFlags": "node scripts/generateFlags.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/NodeSecure/flags.git" - }, - "keywords": [ - "nodesecure", - "flags", - "documentation" - ], - "exports": { - ".": "./index.js", - "./web": "./src/web.js", - "./package.json": "./package.json" - }, - "modes": { - "web": "src/web.js" - }, - "author": "GENTILHOMME Thomas ", - "files": [ - "index.d.ts", - "index.js", - "src", - "FLAGS.md" - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/NodeSecure/flags/issues" - }, - "homepage": "https://github.com/NodeSecure/flags#readme", - "devDependencies": { - "@nodesecure/eslint-config": "^1.4.0", - "@slimio/is": "^1.5.1", - "@small-tech/esm-tape-runner": "^2.0.0", - "@small-tech/tap-monkey": "^1.4.0", - "c8": "^7.11.3", - "cross-env": "^7.0.3", - "eslint": "^8.16.0", - "tape": "^5.5.3", - "turndown": "^7.1.1" - }, - "type": "module" -} +{ + "name": "@nodesecure/flags", + "version": "2.2.0", + "description": "NodeSecure security flags", + "scripts": { + "test": "cross-env esm-tape-runner 'test/**/*.js' | tap-monkey", + "coverage": "c8 -r html npm test", + "lint": "cross-env eslint index.js", + "generateFlags": "node scripts/generateFlags.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/NodeSecure/flags.git" + }, + "keywords": [ + "nodesecure", + "flags", + "documentation" + ], + "exports": { + ".": { + "import": "./index.js" + }, + "./web": { + "types": "./web.d.ts", + "import": "./src/web.js" + }, + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "modes": { + "web": "src/web.js" + }, + "author": "GENTILHOMME Thomas ", + "files": [ + "index.d.ts", + "index.js", + "web.d.ts", + "src", + "FLAGS.md" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/NodeSecure/flags/issues" + }, + "homepage": "https://github.com/NodeSecure/flags#readme", + "devDependencies": { + "@nodesecure/eslint-config": "^1.4.0", + "@slimio/is": "^1.5.1", + "@small-tech/esm-tape-runner": "^2.0.0", + "@small-tech/tap-monkey": "^1.4.0", + "c8": "^7.11.3", + "cross-env": "^7.0.3", + "eslint": "^8.16.0", + "tape": "^5.5.3", + "turndown": "^7.1.1" + }, + "type": "module" +} diff --git a/src/web.d.ts b/web.d.ts similarity index 100% rename from src/web.d.ts rename to web.d.ts