Skip to content

Commit

Permalink
canvas-constructor@1.1.0 (#26)
Browse files Browse the repository at this point in the history
* Removed mention of METHODS.md file (#20)

* traslate => translate (#21)

Fix spelling mistake in typings

* best attempt at toDataURL (#22)

* toBuffer can take more than 1 param (#23)

* Added support for ESM

* Fixed support for ESM

* Fix addCircle

* Doc fixes

* Mixed docs, added more defaults

* addImage and helpers now accept Image, addBeveledRect...

* Fix lint in printLinearGradient's example

* Added support for process to send more arguments

* Add restore option to `addRoundImage` and `addBevelImage`

* Added `printPattern`

* Some typings fixes

* Many changes, CanvasConstructor 1.1.0

* Typings fixes

* Switch to a new website

* Fixed jsdocs

* fixup

Signed-off-by: kyranet <kyradiscord@gmail.com>

* docs: lineDash description

* Ported guides

* Fixed links

* docs: fix images

* docs: fix images

* Upload the files via github

Since it seems that pushing from Git corrupts the images

* docs: tweaked gitattributes

* docs: remove assets

* docs: readd assets

* Updated original example

* assets: fix gitattributes

* assets: remove files

* assets: add files

* assets: fix example images

* docs: fix link

* Error handling

Added a throw if you attempt to use `registerFont` in node-canvas 1.6.x

* Fixed lint

* Update canvas.js

* Fix dx dx (#24)

* chore: Update dependencies

* src: Docs and typings fixes

* typings: Don't export types nor canvas' classes

* fix: More docs fixes

* github: update changelog

* github: added .npmignore

* ci: Fix test script for travis

* ci: Fix lint and test scripts

* typings: Fixed constructor not having an accessment modifier

* ts: Change indent to tabs
  • Loading branch information
kyranet authored Sep 7, 2018
1 parent 4b82cf6 commit 0371a62
Show file tree
Hide file tree
Showing 29 changed files with 2,421 additions and 1,892 deletions.
151 changes: 11 additions & 140 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,143 +1,14 @@
{
"extends": "eslint:recommended",
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2017
},
"rules": {
"no-extra-parens": ["warn", "all", {
"nestedBinaryExpressions": false
}],
"valid-jsdoc": ["warn", {
"requireReturn": false,
"requireReturnDescription": false,
"preferType": {
"String": "string",
"Number": "number",
"Boolean": "boolean",
"Symbol": "symbol",
"function": "Function",
"object": "Object",
"date": "Date",
"error": "Error",
"Void": "void"
}
}],

"accessor-pairs": "warn",
"array-callback-return": "error",
"complexity": "warn",
"consistent-return": "error",
"dot-location": ["error", "property"],
"dot-notation": "error",
"eqeqeq": "error",
"no-console": ["error", { "allow": ["log", "warn", "error"] }],
"no-empty-function": "error",
"no-floating-decimal": "error",
"no-implied-eval": "error",
"no-invalid-this": "error",
"no-lone-blocks": "error",
"no-multi-spaces": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-new": "error",
"no-octal-escape": "error",
"no-return-assign": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-unmodified-loop-condition": "error",
"no-unused-expressions": "error",
"no-useless-call": "error",
"no-useless-concat": "error",
"no-useless-escape": "error",
"no-void": "error",
"no-warning-comments": "warn",
"wrap-iife": "error",
"yoda": "error",

"no-label-var": "error",
"no-shadow": "error",
"no-undef-init": "error",

"callback-return": "error",
"handle-callback-err": "error",
"no-mixed-requires": "error",
"no-new-require": "error",
"no-path-concat": "error",
"no-process-env": "error",

"array-bracket-spacing": "error",
"block-spacing": "error",
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": "error",
"comma-dangle": "error",
"comma-spacing": "error",
"comma-style": "error",
"computed-property-spacing": "error",
"consistent-this": "error",
"func-names": "error",
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
"indent": ["error", 4, { "SwitchCase": 1 }],
"key-spacing": "error",
"keyword-spacing": ["error", {
"overrides": {
"if": { "after": true },
"for": { "after": true },
"while": { "after": true },
"catch": { "after": true },
"switch": { "after": true }
}
}],
"max-depth": "error",
"extends": "klasa",
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"max-len": "off",
"max-nested-callbacks": "off",
"max-statements-per-line": ["error", { "max": 2 }],
"new-cap": "error",
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 6 }],
"no-array-constructor": "error",
"no-bitwise": "warn",
"no-inline-comments": "error",
"no-lonely-if": "error",
"no-mixed-operators": ["error", { "allowSamePrecedence": true }],
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }],
"no-new-object": "error",
"no-spaced-func": "error",
"no-trailing-spaces": "error",
"no-unneeded-ternary": "error",
"no-whitespace-before-property": "error",
"object-curly-newline": "error",
"object-curly-spacing": ["error", "always"],
"operator-assignment": "error",
"operator-linebreak": ["error", "after"],
"padded-blocks": ["error", { "classes": "always", "blocks": "never", "switches": "never" }],
"quote-props": ["error", "as-needed"],
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"semi-spacing": "error",
"semi": "error",
"space-before-blocks": "error",
"space-before-function-paren": ["error", { "anonymous": "always", "named": "never", "asyncArrow": "always" }],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": "error",
"unicode-bom": "error",

"arrow-body-style": "error",
"arrow-spacing": "error",
"no-duplicate-imports": "error",
"no-useless-computed-key": "error",
"no-useless-constructor": "error",
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"rest-spread-spacing": "error",
"template-curly-spacing": "error",
"yield-star-spacing": "error",
"linebreak-style": ["error", "unix"]
}
"operator-linebreak": ["error", "before", { "overrides": { "+": "after", "=": "after" } }],
"curly": ["error", "multi-or-nest", "consistent"],
"id-length": "off",
"no-bitwise": ["error", { "int32Hint": true }],
"no-cond-assign": "off"
}
}
108 changes: 107 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,107 @@
* text=auto eol=lf
# These settings are for any web project

# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
# * text=auto
# NOTE - originally I had the above line un-commented. it caused me a lot of grief related to line endings because I was dealing with WordPress plugins and the website changing line endings out if a user modified a plugin through the web interface. commenting this line out seems to have alleviated the git chaos where simply switching to a branch caused it to believe 500 files were modified.

#
# The above will handle all files NOT found below
#

#
## These files are text and should be normalized (Convert crlf => lf)
#

# source code
*.php text
*.css text
*.sass text
*.scss text
*.less text
*.styl text
*.js text
*.coffee text
*.json text
*.htm text
*.html text
*.xml text
*.svg text
*.txt text
*.ini text
*.inc text
*.pl text
*.rb text
*.py text
*.scm text
*.sql text
*.sh text
*.bat text

# templates
*.ejs text
*.hbt text
*.jade text
*.haml text
*.hbs text
*.dot text
*.tmpl text
*.phtml text

# server config
.htaccess text

# git config
.gitattributes text
.gitignore text
.gitconfig text

# code analysis config
.jshintrc text
.jscsrc text
.jshintignore text
.csslintrc text

# misc config
*.yaml text
*.yml text
.editorconfig text

# build config
*.npmignore text
*.bowerrc text

# Heroku
Procfile text
.slugignore text

# Documentation
*.md text
LICENSE text
AUTHORS text


#
## These files are binary and should be left untouched
#

# (binary is a macro for -text -diff)
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.mov binary
*.mp4 binary
*.mp3 binary
*.flv binary
*.fla binary
*.swf binary
*.gz binary
*.zip binary
*.7z binary
*.ttf binary
*.eot binary
*.woff binary
*.pyc binary
*.pdf binary
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ jspm_packages/
# dotenv environment variables file
.env

# Directories
test/
docs/
.vscode
package-lock.json
docs

\.vscode/
\.idea/
desktop.ini
yarn.lock
24 changes: 24 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Packages
node_modules/
yarn.lock

# Log files
logs/
*.log

# Miscellaneous
.tmp/
.vscode/
guides/

# NPM ignore
.eslintrc.json
.gitattributes
.github/
.gitignore
.travis.yml
CHANGELOG.md
test/
travis-deploy.sh
tsconfig.json
tslint.json
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ install: npm install
jobs:
include:
- stage: test
script: npm test
script: npm run test
- stage: deploy
script: bash ./travis-deploy.sh
cache:
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.1.0
### Added
- Added `toDataURL()` and `toDataURLAsync()`.
- Added `addCircularImage()`, similar to `addCircle()`.
- Added `setTextSize()`, similar to `setTextFont()` but changes the font size only (not the font itself).
- Added all overloads for `addImage()`.
- (Documentation) Added MDN link for `addImage()`.

### Changed
- `createBeveledPath()` now accepts an object type `BeveledRadiusOptions`.
- Renamed `addBevelImage()` to `addBeveledImage()` to prevent confusions (naming inconsistency). The old method is still available but it's deprecated and will be removed in the next major update.

## 1.0.0
### Added
- Support for canvas 1.6.x and 2.x.
Expand Down
Loading

0 comments on commit 0371a62

Please sign in to comment.