-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ exit code 1 on error + choose mode/quality + cli help + allow to overwrite files
- Loading branch information
Showing
22 changed files
with
6,524 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[{package.json,*.yml}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"extends": [ | ||
"@dzek69/eslint-config-base", | ||
"@dzek69/eslint-config-typescript" | ||
], | ||
"env": { | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"project": "./tsconfig.lint.json" | ||
}, | ||
"ignorePatterns": [], | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"src/*.spec.*", "src/**/*.spec.*" | ||
], | ||
"env": { | ||
"jest": true | ||
}, | ||
"rules": { | ||
"func-names": "off", | ||
"global-require": "off", | ||
"max-lines": "off", | ||
"max-lines-per-function": "off", | ||
"max-statements": "off", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-magic-numbers": "off", | ||
"@typescript-eslint/no-unsafe-call": "off", | ||
"@typescript-eslint/no-unsafe-member-access": "off", | ||
"no-unused-labels": "off" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
/.idea/ | ||
/node_modules/ | ||
/docs/ | ||
/dist/ | ||
/esm/ | ||
/node_modules/ | ||
|
||
/*.tgz | ||
*.log | ||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/.idea/ | ||
/build-scripts/ | ||
/test/ | ||
|
||
/babel.config.cjs | ||
/jest.config.cjs | ||
/yarn.lock | ||
/*.tgz | ||
/*.log | ||
/.yarnclean | ||
/nodemon.json | ||
/.editorconfig | ||
/tsconfig.* | ||
|
||
*.d.ts | ||
*.map | ||
/.eslintrc.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
||
## [UNRELEASED] | ||
(nothing yet) | ||
|
||
## [1.0.0] - 2021-04-29 | ||
### Added | ||
- glob pattern matching | ||
- exit code 1 on error | ||
- choose mode/quality | ||
- cli help | ||
- allow to overwrite files | ||
|
||
## [0.0.1] - 2018-01-30 | ||
### Added | ||
- first version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', { targets: { node: 'current' } }], | ||
'@babel/preset-typescript', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import fs from "fs-extra"; | ||
|
||
(async () => { | ||
console.info("[CJS compile post-processing started]"); | ||
await fs.writeFile("./dist/package.json", JSON.stringify({ type: "commonjs" })) | ||
console.info("[CJS compile post-processing ended]"); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
// testMatch: [], | ||
collectCoverageFrom: [ | ||
'src/**/*.{mjs,js,jsx,ts,tsx}', | ||
'!**/*.d.ts' | ||
], | ||
setupFiles: [ | ||
'<rootDir>/test/bootstrap.cjs' | ||
], | ||
testURL: 'http://localhost:8080', | ||
moduleNameMapper: { | ||
'^(.*)\.js$': '$1', | ||
}, | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"watch": ["src"], | ||
"ext": "ts,json", | ||
"ignore": ["src/**/*.spec.ts"], | ||
"exec": "node --loader ts-node/esm ./src/index.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,57 @@ | ||
{ | ||
"name": "brotli-cli", | ||
"version": "0.0.1", | ||
"main": "index.js", | ||
"repository": "https://github.com/dzek69/brotli-cli.git", | ||
"author": "Jacek Nowacki <[email protected]>", | ||
"version": "1.0.0", | ||
"repository": "[email protected]:dzek69/brotli-cli.git", | ||
"author": "Jacek Nowacki", | ||
"license": "MIT", | ||
"bin": "index.js", | ||
"scripts": { | ||
"test": "NODE_ENV=test jest", | ||
"docs": "typedoc src/index.ts --out docs --listInvalidSymbolLinks --includes tutorials", | ||
"compile": "yarn compile:cjs", | ||
"compile:cjs": "rm -rf dist && tsc --project tsconfig.cjs.json && node ./build-scripts/compile.cjs.after.mjs", | ||
"typecheck": "tsc --noEmit", | ||
"lint": "eslint src --ext .ts,.tsx,.js,.jsx,.mjs", | ||
"lint:fix": "yarn lint --fix", | ||
"prepack": "yarn compile", | ||
"prepublishOnly": "yarn lint && yarn test && yarn docs", | ||
"start:dev": "nodemon", | ||
"start:dev:compatibility": "TS_NODE_FILES=true yarn start:dev" | ||
}, | ||
"bin": "./dist/index.js", | ||
"type": "module", | ||
"dependencies": { | ||
"better-custom-error": "^4.0.1", | ||
"brotli": "^1.3.2", | ||
"fs-extra": "^5.0.0" | ||
"fast-glob": "^3.2.5", | ||
"yargs": "^16.2.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.12.10", | ||
"@babel/preset-env": "^7.12.11", | ||
"@babel/preset-typescript": "^7.12.7", | ||
"@dzek69/eslint-config-base": "^2.0.0", | ||
"@dzek69/eslint-config-typescript": "^0.2.4", | ||
"@types/brotli": "^1.3.0", | ||
"@typescript-eslint/eslint-plugin": "^4.11.1", | ||
"@typescript-eslint/parser": "^4.11.1", | ||
"eslint": "^7.14.0", | ||
"fs-extra": "^9.0.1", | ||
"husky": "^4.3.0", | ||
"jest": "^26.6.3", | ||
"must": "^0.13.4", | ||
"nodemon": "^2.0.6", | ||
"ts-node": "^9.0.0", | ||
"typedoc": "^0.20.35", | ||
"typescript": "^4.2.4" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-push": "yarn prepublishOnly && yarn compile" | ||
} | ||
}, | ||
"engines": { | ||
"node": ">=6.4.0" | ||
"libraryTemplate": { | ||
"version": "3.0.2", | ||
"language": "typescript", | ||
"fixDefaultForCommonJS": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createError } from "better-custom-error"; | ||
|
||
const NoFilesError = createError("NoFilesError"); | ||
const CompressionProcessError = createError("CompressionProcessError"); | ||
|
||
export { | ||
NoFilesError, | ||
CompressionProcessError, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
describe("tests", () => { | ||
it("are working", () => { | ||
true.must.be.true(); | ||
}); | ||
}); |
Oops, something went wrong.