🚀 use ts node
This commit is contained in:
@@ -6,8 +6,8 @@ RUN apt-get update \
|
||||
|
||||
WORKDIR /github/snk
|
||||
|
||||
RUN npm install canvas@2.6.1
|
||||
RUN npm install canvas@2.6.1 --no-save --no-package-lock
|
||||
|
||||
COPY dist /github/snk/
|
||||
COPY dist /github/snk/
|
||||
|
||||
CMD ["node", "/github/snk/index.js"]
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as path from "path";
|
||||
import { generateContributionSnake } from "../generateContributionSnake";
|
||||
|
||||
(async () => {
|
||||
const output = path.join(process.cwd(), "/__tests__/__snapshots__/out.gif");
|
||||
const output = path.join(__dirname, "__snapshots__/out.gif");
|
||||
|
||||
const buffer = await generateContributionSnake("platane");
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@ export const generateContributionSnake = async (userName: string) => {
|
||||
{ x: 0, y: -1 },
|
||||
]);
|
||||
|
||||
const upscale = 1.6;
|
||||
// const upscale = 815 / (grid0.width + 2) / 16;
|
||||
const upscale = 2;
|
||||
const drawOptions = {
|
||||
sizeBorderRadius: 2 * upscale,
|
||||
sizeCell: 16 * upscale,
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
"@snk/github-user-contribution": "1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ts-node": "9.0.0",
|
||||
"@zeit/ncc": "0.22.3"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "ncc build --external canvas --out dist ./index.ts ",
|
||||
"dev": "rm -f __tests__/__snapshots__/out.gif ; ncc run __tests__/dev.ts --quiet"
|
||||
"dev": "ts-node __tests__/dev.ts"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user