Skip to content

Commit 0371a62

Browse files
authored
* 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 <[email protected]> * 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
1 parent 4b82cf6 commit 0371a62

29 files changed

+2421
-1892
lines changed

.eslintrc.json

Lines changed: 11 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -1,143 +1,14 @@
11
{
2-
"extends": "eslint:recommended",
3-
"env": {
4-
"node": true,
5-
"es6": true
6-
},
7-
"parserOptions": {
8-
"ecmaVersion": 2017
9-
},
10-
"rules": {
11-
"no-extra-parens": ["warn", "all", {
12-
"nestedBinaryExpressions": false
13-
}],
14-
"valid-jsdoc": ["warn", {
15-
"requireReturn": false,
16-
"requireReturnDescription": false,
17-
"preferType": {
18-
"String": "string",
19-
"Number": "number",
20-
"Boolean": "boolean",
21-
"Symbol": "symbol",
22-
"function": "Function",
23-
"object": "Object",
24-
"date": "Date",
25-
"error": "Error",
26-
"Void": "void"
27-
}
28-
}],
29-
30-
"accessor-pairs": "warn",
31-
"array-callback-return": "error",
32-
"complexity": "warn",
33-
"consistent-return": "error",
34-
"dot-location": ["error", "property"],
35-
"dot-notation": "error",
36-
"eqeqeq": "error",
37-
"no-console": ["error", { "allow": ["log", "warn", "error"] }],
38-
"no-empty-function": "error",
39-
"no-floating-decimal": "error",
40-
"no-implied-eval": "error",
41-
"no-invalid-this": "error",
42-
"no-lone-blocks": "error",
43-
"no-multi-spaces": "error",
44-
"no-new-func": "error",
45-
"no-new-wrappers": "error",
46-
"no-new": "error",
47-
"no-octal-escape": "error",
48-
"no-return-assign": "error",
49-
"no-self-compare": "error",
50-
"no-sequences": "error",
51-
"no-unmodified-loop-condition": "error",
52-
"no-unused-expressions": "error",
53-
"no-useless-call": "error",
54-
"no-useless-concat": "error",
55-
"no-useless-escape": "error",
56-
"no-void": "error",
57-
"no-warning-comments": "warn",
58-
"wrap-iife": "error",
59-
"yoda": "error",
60-
61-
"no-label-var": "error",
62-
"no-shadow": "error",
63-
"no-undef-init": "error",
64-
65-
"callback-return": "error",
66-
"handle-callback-err": "error",
67-
"no-mixed-requires": "error",
68-
"no-new-require": "error",
69-
"no-path-concat": "error",
70-
"no-process-env": "error",
71-
72-
"array-bracket-spacing": "error",
73-
"block-spacing": "error",
74-
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
75-
"camelcase": "error",
76-
"comma-dangle": "error",
77-
"comma-spacing": "error",
78-
"comma-style": "error",
79-
"computed-property-spacing": "error",
80-
"consistent-this": "error",
81-
"func-names": "error",
82-
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
83-
"indent": ["error", 4, { "SwitchCase": 1 }],
84-
"key-spacing": "error",
85-
"keyword-spacing": ["error", {
86-
"overrides": {
87-
"if": { "after": true },
88-
"for": { "after": true },
89-
"while": { "after": true },
90-
"catch": { "after": true },
91-
"switch": { "after": true }
92-
}
93-
}],
94-
"max-depth": "error",
2+
"extends": "klasa",
3+
"parserOptions": {
4+
"ecmaVersion": 2018
5+
},
6+
"rules": {
957
"max-len": "off",
96-
"max-nested-callbacks": "off",
97-
"max-statements-per-line": ["error", { "max": 2 }],
98-
"new-cap": "error",
99-
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 6 }],
100-
"no-array-constructor": "error",
101-
"no-bitwise": "warn",
102-
"no-inline-comments": "error",
103-
"no-lonely-if": "error",
104-
"no-mixed-operators": ["error", { "allowSamePrecedence": true }],
105-
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }],
106-
"no-new-object": "error",
107-
"no-spaced-func": "error",
108-
"no-trailing-spaces": "error",
109-
"no-unneeded-ternary": "error",
110-
"no-whitespace-before-property": "error",
111-
"object-curly-newline": "error",
112-
"object-curly-spacing": ["error", "always"],
113-
"operator-assignment": "error",
114-
"operator-linebreak": ["error", "after"],
115-
"padded-blocks": ["error", { "classes": "always", "blocks": "never", "switches": "never" }],
116-
"quote-props": ["error", "as-needed"],
117-
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
118-
"semi-spacing": "error",
119-
"semi": "error",
120-
"space-before-blocks": "error",
121-
"space-before-function-paren": ["error", { "anonymous": "always", "named": "never", "asyncArrow": "always" }],
122-
"space-in-parens": "error",
123-
"space-infix-ops": "error",
124-
"space-unary-ops": "error",
125-
"spaced-comment": "error",
126-
"unicode-bom": "error",
127-
128-
"arrow-body-style": "error",
129-
"arrow-spacing": "error",
130-
"no-duplicate-imports": "error",
131-
"no-useless-computed-key": "error",
132-
"no-useless-constructor": "error",
133-
"prefer-arrow-callback": "error",
134-
"prefer-const": "error",
135-
"prefer-rest-params": "error",
136-
"prefer-spread": "error",
137-
"prefer-template": "error",
138-
"rest-spread-spacing": "error",
139-
"template-curly-spacing": "error",
140-
"yield-star-spacing": "error",
141-
"linebreak-style": ["error", "unix"]
142-
}
8+
"operator-linebreak": ["error", "before", { "overrides": { "+": "after", "=": "after" } }],
9+
"curly": ["error", "multi-or-nest", "consistent"],
10+
"id-length": "off",
11+
"no-bitwise": ["error", { "int32Hint": true }],
12+
"no-cond-assign": "off"
13+
}
14314
}

.gitattributes

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,107 @@
1-
* text=auto eol=lf
1+
# These settings are for any web project
2+
3+
# Handle line endings automatically for files detected as text
4+
# and leave all files detected as binary untouched.
5+
# * text=auto
6+
# 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.
7+
8+
#
9+
# The above will handle all files NOT found below
10+
#
11+
12+
#
13+
## These files are text and should be normalized (Convert crlf => lf)
14+
#
15+
16+
# source code
17+
*.php text
18+
*.css text
19+
*.sass text
20+
*.scss text
21+
*.less text
22+
*.styl text
23+
*.js text
24+
*.coffee text
25+
*.json text
26+
*.htm text
27+
*.html text
28+
*.xml text
29+
*.svg text
30+
*.txt text
31+
*.ini text
32+
*.inc text
33+
*.pl text
34+
*.rb text
35+
*.py text
36+
*.scm text
37+
*.sql text
38+
*.sh text
39+
*.bat text
40+
41+
# templates
42+
*.ejs text
43+
*.hbt text
44+
*.jade text
45+
*.haml text
46+
*.hbs text
47+
*.dot text
48+
*.tmpl text
49+
*.phtml text
50+
51+
# server config
52+
.htaccess text
53+
54+
# git config
55+
.gitattributes text
56+
.gitignore text
57+
.gitconfig text
58+
59+
# code analysis config
60+
.jshintrc text
61+
.jscsrc text
62+
.jshintignore text
63+
.csslintrc text
64+
65+
# misc config
66+
*.yaml text
67+
*.yml text
68+
.editorconfig text
69+
70+
# build config
71+
*.npmignore text
72+
*.bowerrc text
73+
74+
# Heroku
75+
Procfile text
76+
.slugignore text
77+
78+
# Documentation
79+
*.md text
80+
LICENSE text
81+
AUTHORS text
82+
83+
84+
#
85+
## These files are binary and should be left untouched
86+
#
87+
88+
# (binary is a macro for -text -diff)
89+
*.png binary
90+
*.jpg binary
91+
*.jpeg binary
92+
*.gif binary
93+
*.ico binary
94+
*.mov binary
95+
*.mp4 binary
96+
*.mp3 binary
97+
*.flv binary
98+
*.fla binary
99+
*.swf binary
100+
*.gz binary
101+
*.zip binary
102+
*.7z binary
103+
*.ttf binary
104+
*.eot binary
105+
*.woff binary
106+
*.pyc binary
107+
*.pdf binary

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ jspm_packages/
5454
# dotenv environment variables file
5555
.env
5656

57-
# Directories
58-
test/
59-
docs/
57+
.vscode
6058
package-lock.json
59+
docs
60+
61+
\.vscode/
62+
\.idea/
63+
desktop.ini
64+
yarn.lock

.npmignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Packages
2+
node_modules/
3+
yarn.lock
4+
5+
# Log files
6+
logs/
7+
*.log
8+
9+
# Miscellaneous
10+
.tmp/
11+
.vscode/
12+
guides/
13+
14+
# NPM ignore
15+
.eslintrc.json
16+
.gitattributes
17+
.github/
18+
.gitignore
19+
.travis.yml
20+
CHANGELOG.md
21+
test/
22+
travis-deploy.sh
23+
tsconfig.json
24+
tslint.json

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ install: npm install
55
jobs:
66
include:
77
- stage: test
8-
script: npm test
8+
script: npm run test
99
- stage: deploy
1010
script: bash ./travis-deploy.sh
1111
cache:

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## 1.1.0
8+
### Added
9+
- Added `toDataURL()` and `toDataURLAsync()`.
10+
- Added `addCircularImage()`, similar to `addCircle()`.
11+
- Added `setTextSize()`, similar to `setTextFont()` but changes the font size only (not the font itself).
12+
- Added all overloads for `addImage()`.
13+
- (Documentation) Added MDN link for `addImage()`.
14+
15+
### Changed
16+
- `createBeveledPath()` now accepts an object type `BeveledRadiusOptions`.
17+
- 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.
18+
719
## 1.0.0
820
### Added
921
- Support for canvas 1.6.x and 2.x.

0 commit comments

Comments
 (0)