From c5ee602488b308ba7a05568da2ca13798a1cede6 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Wed, 21 Oct 2020 04:40:48 -0700 Subject: [PATCH] add package-check lint pass (#1376) --- esinstall/package.json | 17 ++++++++++++++++- snowpack/index.esm.mjs | 5 +++++ snowpack/package.json | 21 +++++++++++++++++++-- snowpack/src/index.ts | 2 +- yarn.lock | 9 ++++++++- 5 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 snowpack/index.esm.mjs diff --git a/esinstall/package.json b/esinstall/package.json index f81448d964..2c502a9c4f 100644 --- a/esinstall/package.json +++ b/esinstall/package.json @@ -3,6 +3,17 @@ "version": "0.3.4", "description": "Convert packages to ESM.", "license": "MIT", + "keywords": [ + "install", + "web", + "dependencies", + "npm", + "esm", + "common.js", + "rollup", + "esbuild", + "cjs" + ], "homepage": "https://github.com/snowpackjs/snowpack/tree/master/esinstall#readme", "repository": { "type": "git", @@ -15,7 +26,7 @@ "scripts": { "build": "tsc", "build:watch": "tsc --watch", - "lint": "tsc --noEmit --noUnusedLocals true --noUnusedParameters true" + "lint": "tsc --noEmit --noUnusedLocals true --noUnusedParameters true && package-check" }, "types": "lib/index.d.ts", "main": "lib/index.js", @@ -23,6 +34,7 @@ "import": "./index.esm.mjs", "require": "./lib/index.js" }, + "files": ["lib"], "dependencies": { "@rollup/plugin-alias": "^3.0.1", "@rollup/plugin-commonjs": "^15.0.0", @@ -39,5 +51,8 @@ "rollup": "^2.23.0", "rollup-plugin-node-polyfills": "^0.2.1", "validate-npm-package-name": "^3.0.0" + }, + "devDependencies": { + "@skypack/package-check": "^0.1.0" } } diff --git a/snowpack/index.esm.mjs b/snowpack/index.esm.mjs new file mode 100644 index 0000000000..c76e81241c --- /dev/null +++ b/snowpack/index.esm.mjs @@ -0,0 +1,5 @@ +import Pkg from './lib/index.js'; + +export const startDevServer = Pkg.startDevServer; +export const loadAndValidateConfig = Pkg.loadAndValidateConfig; +export const getUrlForFile = Pkg.getUrlForFile; diff --git a/snowpack/package.json b/snowpack/package.json index 8456a3024e..277e2337e1 100644 --- a/snowpack/package.json +++ b/snowpack/package.json @@ -4,6 +4,15 @@ "description": "The ESM-powered frontend build tool. Fast, lightweight, unbundled.", "author": "Fred K. Schott ", "license": "MIT", + "keywords": [ + "bundle", + "build", + "build tool", + "web", + "esm", + "esbuild", + "wasm" + ], "repository": { "type": "git", "url": "https://github.com/snowpackjs/snowpack.git" @@ -14,17 +23,22 @@ "scripts": { "build": "tsc", "build:watch": "tsc --watch", - "lint": "tsc --noEmit --noUnusedLocals true --noUnusedParameters true" + "lint": "tsc --noEmit --noUnusedLocals true --noUnusedParameters true && package-check" }, "engines": { "node": ">=10.19.0" }, - "main": "lib/index.js", "types": "lib/index.d.ts", + "main": "lib/index.js", + "exports": { + "import": "./index.esm.mjs", + "require": "./lib/index.js" + }, "bin": { "sp": "index.bin.js", "snowpack": "index.bin.js" }, + "files": ["assets", "lib"], "dependencies": { "@snowpack/plugin-build-script": "^2.0.11", "@snowpack/plugin-run-script": "^2.1.7", @@ -63,5 +77,8 @@ "validate-npm-package-name": "^3.0.0", "ws": "^7.3.0", "yargs-parser": "^18.1.3" + }, + "devDependencies": { + "@skypack/package-check": "^0.1.0" } } diff --git a/snowpack/src/index.ts b/snowpack/src/index.ts index e0a1ab9f38..15339fd4d3 100644 --- a/snowpack/src/index.ts +++ b/snowpack/src/index.ts @@ -12,7 +12,7 @@ import {CLIFlags} from './types/snowpack'; import {clearCache, readLockfile} from './util.js'; export * from './types/snowpack'; -// Stable API: +// Stable API (remember to include all in "./index.esm.js" wrapper) export {startDevServer} from './commands/dev'; export {loadAndValidateConfig}; export {getUrlForFile} from './build/file-urls'; diff --git a/yarn.lock b/yarn.lock index e5dffb40aa..9a53dd3005 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2514,6 +2514,13 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@skypack/package-check@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@skypack/package-check/-/package-check-0.1.0.tgz#aa7aa70e3415ac8da3fbd8f69d6d38073679af41" + integrity sha512-MouyPN2ewOADpBw01HWi6+bo0PmrTPCttyCUBFkT5UAHgQFjJ0AFIVYa4O3cVZCmGkrtA7YksJ7dOG9U9Hz3xA== + dependencies: + kleur "^4.1.3" + "@szmarczak/http-timer@^4.0.5": version "4.0.5" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.5.tgz#bfbd50211e9dfa51ba07da58a14cdfd333205152" @@ -9368,7 +9375,7 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== -kleur@^4.1.1: +kleur@^4.1.1, kleur@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.3.tgz#8d262a56d79a137ee1b706e967c0b08a7fef4f4c" integrity sha512-H1tr8QP2PxFTNwAFM74Mui2b6ovcY9FoxJefgrwxY+OCJcq01k5nvhf4M/KnizzrJvLRap5STUy7dgDV35iUBw==