From ea999da9d1b93fa83a22a72e026414940ea707f3 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Wed, 8 May 2019 12:43:16 +0900 Subject: [PATCH 1/4] Update package.json - Add keywords - Update repository link - Specify main entry point --- package.json | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index d4ebc700..ccd31587 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,7 @@ "name": "@marp-team/marp-cli", "version": "0.9.0", "description": "A CLI interface for Marp and Marpit based converters", - "repository": "https://github.com/marp-team/marp-cli", - "engines": { - "node": ">=8.9.0" - }, + "license": "MIT", "author": { "name": "Marp team", "url": "https://github.com/marp-team" @@ -16,17 +13,29 @@ "url": "https://github.com/yhatt" } ], - "license": "MIT", - "publishConfig": { - "access": "public" + "keywords": [ + "marp", + "markdown", + "cli", + "slide", + "deck", + "presentation" + ], + "repository": { + "type": "git", + "url": "https://github.com/marp-team/marp-cli" }, - "bin": { - "marp": "./marp-cli.js" + "engines": { + "node": ">=8.9.0" }, + "main": "lib/marp-cli.js", "files": [ "marp-cli.js", "lib/" ], + "bin": { + "marp": "./marp-cli.js" + }, "pkg": { "scripts": "lib/**/*.js" }, @@ -129,5 +138,8 @@ "tmp": "^0.1.0", "ws": "^7.0.0", "yargs": "^13.2.2" + }, + "publishConfig": { + "access": "public" } } From 87a483c3a3e526ecc3143855ee4c600821c90472 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Wed, 8 May 2019 12:52:06 +0900 Subject: [PATCH 2/4] Include type definitions to published package --- .gitignore | 1 + .prettierignore | 1 + package.json | 7 +++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 63f9d5df..29d37f26 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ bin/ lib/ tmp/ +types/ node_modules/** !/test/_files/node_modules/ignore.* diff --git a/.prettierignore b/.prettierignore index 2ec10466..d6145a8c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,6 @@ .git/ coverage/ lib/ +types/ node_modules package.json diff --git a/package.json b/package.json index ccd31587..0fb08cac 100644 --- a/package.json +++ b/package.json @@ -29,9 +29,11 @@ "node": ">=8.9.0" }, "main": "lib/marp-cli.js", + "types": "types/marp-cli.d.ts", "files": [ "marp-cli.js", - "lib/" + "lib/", + "types/" ], "bin": { "marp": "./marp-cli.js" @@ -50,13 +52,14 @@ "format:write": "yarn -s format --write", "lint:ts": "tslint \"{src,test}/**/*.ts\"", "lint:css": "stylelint \"src/**/*.{css,scss}\"", - "prepack": "npm-run-all --parallel check:* lint:* test:coverage --sequential build", + "prepack": "npm-run-all --parallel check:* lint:* test:coverage --parallel build types", "preversion": "run-p check:* format:check lint:* test:coverage", "standalone": "rimraf bin && pkg --out-path ./bin .", "standalone:pack": "node ./scripts/pack.js", "standalone:pack:upload": "node ./scripts/upload.js", "test": "jest", "test:coverage": "jest --coverage", + "types": "rimraf types && tsc --declaration --emitDeclarationOnly --outDir types", "version": "curl https://raw.githubusercontent.com/marp-team/marp/master/version.js | node && git add -A CHANGELOG.md", "watch": "rollup -w -c" }, From f36996c803d5fbdc28647683f05967b1e3145f8b Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Wed, 8 May 2019 13:07:31 +0900 Subject: [PATCH 3/4] [ci skip] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92385392..33929127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added - Test with Node 12 (Erbium) ([#91](https://github.com/marp-team/marp-cli/pull/91)) +- Add main entry point and type definitions ([#92](https://github.com/marp-team/marp-cli/pull/92)) ### Changed From 29d20550f973640364d24ce7e27098c23d082d20 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Wed, 8 May 2019 13:29:44 +0900 Subject: [PATCH 4/4] Fix incorrect path to type definition version.ts has resolved package.json from project root by. Thus, type definitions will create based on root directory, not `src` dir. So `types` field requires adding extra `src` directory. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0fb08cac..53b3a8eb 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "node": ">=8.9.0" }, "main": "lib/marp-cli.js", - "types": "types/marp-cli.d.ts", + "types": "types/src/marp-cli.d.ts", "files": [ "marp-cli.js", "lib/",