Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 0 additions & 82 deletions .github/workflows/codeql.yml

This file was deleted.

22 changes: 17 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@
"name": "fetchdoc-cli",
"version": "1.0.0",
"description": "FetchDoc is a command-line tool that assists developers in swiftly accessing the documentation or README of any npm package. With a straightforward command, FetchDoc either opens the official repository of the specified npm package in your default browser or displays the README content directly in your terminal, streamlining your journey into the docs.",
"main": "dist/index.js",
"main": "./dist/index.js",
"bin": {
"fetchdoc": "dist/index.js"
"fetchdoc": "./dist/index.js"
},
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"build": "rollup -c",
"start": "node ./dist/index.js",
"lint": "eslint 'src/**/*.{js,ts}'",
"lint:fix": "eslint 'src/**/*.{js,ts}' --fix",
"test": "mocha -r ts-node/register 'test/**/*.test.ts'"
"test": "mocha -r ts-node/register 'test/**/*.test.ts'",
"version": "auto-changelog -p && git add CHANGELOG.md",
"postbuild": "chmod +x dist/index.js"
},
"auto-changelog": {
"breakingPattern": "BREAKING CHANGE:"
},
"keywords": [
"npm",
Expand All @@ -33,6 +38,11 @@
"yargs": "^17.7.2"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.2.1",
"@rollup/plugin-replace": "^5.0.2",
"@rollup/plugin-typescript": "^11.1.3",
"@types/axios": "^0.14.0",
"@types/chai": "^4.3.6",
"@types/mocha": "^10.0.1",
Expand All @@ -49,11 +59,13 @@
"eslint-plugin-n": "^16.0.2",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.1.1",
"esm": "^3.2.25",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"mocha": "^10.2.0",
"nock": "^13.3.3",
"prettier": "^3.0.3",
"rollup": "^3.28.1",
"sinon": "^15.2.0",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
Expand Down
25 changes: 25 additions & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import typescript from '@rollup/plugin-typescript'
import pkg from './package.json' assert { type: 'json' }
import json from '@rollup/plugin-json'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import replace from '@rollup/plugin-replace'

export default {
input: 'src/index.ts',
output: {
dir: 'dist',
format: 'cjs',
banner: '#!/usr/bin/env node',
},
external: ['tslib', 'child_process', 'axios'],
plugins: [
typescript({ exclude: 'node_modules' }),
nodeResolve({ exportConditions: ['node'], preferBuiltins: false }),
commonjs({ includes: 'node_modules/**' }),
json(),
replace({
VERSION: JSON.stringify(pkg.version),
}),
],
}
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
"compilerOptions": {
"rootDir": "./src",
"target": "ESNext",
"module": "commonjs",
"module": "CommonJS",
"esModuleInterop": true,
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"noEmit": true,
"skipLibCheck": true,
"outDir": "./dist"
},
Expand Down