diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a32c3ff --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 hustcc + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package.json b/package.json index aa7f672..d38ee00 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,26 @@ "hustcc ", "yuzhanglong " ], - "homepage": "https://github.com/lint-md", + "homepage": "https://github.com/lint-md/parser#readme", "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/lint-md/parser.git" + }, + "bugs": { + "url": "https://github.com/lint-md/parser/issues" + }, + "keywords": [ + "markdown", + "parser", + "remark", + "mdast", + "mdx", + "lint-md" + ], + "publishConfig": { + "access": "public" + }, "type": "commonjs", "sideEffects": false, "packageManager": "pnpm@11.27.1", @@ -41,6 +59,7 @@ } }, "files": [ + "LICENSE", "dist/lint-md-parser.cjs", "dist/lint-md-parser.mjs", "dist/lint-md-parser.d.ts", diff --git a/scripts/test-package.mjs b/scripts/test-package.mjs index a7c0497..de3eb32 100644 --- a/scripts/test-package.mjs +++ b/scripts/test-package.mjs @@ -41,6 +41,23 @@ try { ), ); assert.deepEqual(Object.keys(installedManifest.dependencies), ['@types/mdast', 'mdast-util-mdx']); + assert.equal(installedManifest.license, 'MIT'); + assert.equal(installedManifest.homepage, 'https://github.com/lint-md/parser#readme'); + assert.deepEqual(installedManifest.repository, { + type: 'git', + url: 'git+https://github.com/lint-md/parser.git', + }); + assert.deepEqual(installedManifest.bugs, { + url: 'https://github.com/lint-md/parser/issues', + }); + assert.deepEqual(installedManifest.keywords, [ + 'markdown', 'parser', 'remark', 'mdast', 'mdx', 'lint-md', + ]); + assert.deepEqual(installedManifest.publishConfig, { access: 'public' }); + assert.match( + readFileSync(join(consumerRoot, 'node_modules/@lint-md/parser/LICENSE'), 'utf8'), + /^MIT License\r?\n\r?\nCopyright \(c\) 2021 hustcc/, + ); const cjsResult = run('node', [ '-e',