Skip to content

Commit

Permalink
Build with ncc
Browse files Browse the repository at this point in the history
  • Loading branch information
iansu committed Nov 13, 2019
1 parent 380eef9 commit f49b123
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "eslint-config-neo/config-backend",
"rules": {
"no-console": "off"
"no-console": "off",
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }]
}
}
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Cache node modules
uses: actions/cache@preview
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install
run: yarn --frozen-lockfile --prefer-offline --non-interactive
- name: Lint
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.0.2 (November 13, 2019)

- Build with @zeit/ncc for better performance
- Fix line endings in bin file

## 1.0.1 (November 6, 2019)

Modified `scanFiles` function to return a list of file names where credit card numbers are found.
Expand Down
2 changes: 1 addition & 1 deletion bin/ccscan.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

/* eslint-disable node/shebang */

const cli = require('../build/app');
const cli = require('../build');

cli.run();
10 changes: 8 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
module.exports = {
collectCoverageFrom: ['src/**/*.{ts,js}', '!<rootDir>/node_modules/', '!<rootDir>/build/', '!<rootDir>/*.js'],
collectCoverageFrom: [
'src/**/*.{ts,js}',
'!<rootDir>/node_modules/',
'!<rootDir>/build/',
'!<rootDir>/dist/',
'!<rootDir>/*.js'
],
globals: {
'ts-jest': {
tsConfig: '<rootDir>/test/tsconfig.json'
}
},
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: ['<rootDir>/build/', '<rootDir>/config.*.js']
testPathIgnorePatterns: ['<rootDir>/build/', '<rootDir>/dist/', '<rootDir>/config.*.js']
};
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ccscan",
"description": "Scan files for credit card numbers",
"version": "1.0.1",
"version": "1.0.2",
"author": "Neo Financial Engineering <[email protected]>",
"license": "MIT",
"main": "build/app.js",
Expand All @@ -17,13 +17,14 @@
},
"scripts": {
"start": "./bin/ccscan.js",
"watch": "tsc -w",
"build": "tsc",
"watch": "ncc build src/app.ts -o build --minify --watch",
"build": "ncc build src/app.ts -o build --minify",
"clean": "rimraf build",
"test": "NODE_ENV=test jest",
"lint": "eslint \"**/*.{ts,js}\"",
"format": "prettier --write \"**/*.{ts,js,json,yaml,yml,md}\"",
"format:check": "prettier --debug-check \"**/*.{ts,js,json,yaml,yml,md}\""
"format:check": "prettier --debug-check \"**/*.{ts,js,json,yaml,yml,md}\"",
"prepublishOnly": "rimraf build && ncc build src/app.ts -o build --minify"
},
"files": [
"bin",
Expand All @@ -39,28 +40,27 @@
"git add"
]
},
"dependencies": {
"chalk": "^2.4.2",
"fast-luhn": "^1.0.4",
"globby": "^10.0.1",
"line-reader": "^0.4.0",
"yargs": "^14.2.0"
},
"devDependencies": {
"@types/jest": "^24.0.20",
"@types/line-reader": "^0.0.28",
"@types/node": "^12.11.7",
"@types/yargs": "^13.0.3",
"@zeit/ncc": "^0.20.5",
"chalk": "^2.4.2",
"eslint": "^5.16.0",
"eslint-config-neo": "~0.3.3",
"fast-luhn": "^1.0.4",
"globby": "^10.0.1",
"husky": "^3.0.8",
"jest": "^24.9.0",
"line-reader": "^0.4.0",
"lint-staged": "^9.4.2",
"prettier": "^1.18.2",
"rimraf": "^3.0.0",
"strip-ansi": "^5.2.0",
"ts-jest": "^24.1.0",
"ts-node": "^8.4.1",
"typescript": "~3.5.3"
"typescript": "~3.5.3",
"yargs": "^14.2.0"
}
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"target": "es6",
"target": "es2015",
"moduleResolution": "node",
"outDir": "build",
"baseUrl": ".",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,11 @@
lodash.unescape "4.0.1"
semver "5.5.0"

"@zeit/ncc@^0.20.5":
version "0.20.5"
resolved "https://registry.yarnpkg.com/@zeit/ncc/-/ncc-0.20.5.tgz#a41af6e6bcab4a58f4612bae6137f70bce0192e3"
integrity sha512-XU6uzwvv95DqxciQx+aOLhbyBx/13ky+RK1y88Age9Du3BlA4mMPCy13BGjayOrrumOzlq1XV3SD/BWiZENXlw==

abab@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.2.tgz#a2fba1b122c69a85caa02d10f9270c7219709a9d"
Expand Down

0 comments on commit f49b123

Please sign in to comment.