mirror of
https://github.com/keanuplayz/TravBot-v3.git
synced 2024-08-15 02:33:12 +00:00
Compare commits
No commits in common. "728f115de95d605e1c1135445d5d20164f65bb90" and "6ea052ae6fba97e2876ba1aa75efa303f72f0b51" have entirely different histories.
728f115de9
...
6ea052ae6f
5 changed files with 8 additions and 82 deletions
10
.github/workflows/image.yml
vendored
10
.github/workflows/image.yml
vendored
|
@ -3,6 +3,7 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- typescript
|
||||
- docker
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
|
@ -15,13 +16,10 @@ jobs:
|
|||
fetch-depth: 2
|
||||
|
||||
- name: Setup Node.JS
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v2-beta
|
||||
with:
|
||||
node-version: "14"
|
||||
# https://github.com/npm/cli/issues/558#issuecomment-580018468
|
||||
# Error: "npm ERR! fsevents not accessible from jest-haste-map"
|
||||
# (supposed to just be a warning b/c optional dependency, but CI environment causes it to fail)
|
||||
- run: npm i
|
||||
node-version: "12"
|
||||
- run: npm ci
|
||||
|
||||
- name: Build codebase
|
||||
run: npm run build
|
||||
|
|
67
Dockerfile
67
Dockerfile
|
@ -1,69 +1,4 @@
|
|||
###############
|
||||
# Solution #1 #
|
||||
###############
|
||||
# https://github.com/geekduck/docker-node-canvas
|
||||
# Took 20m 55s
|
||||
|
||||
#FROM node:12
|
||||
#
|
||||
#RUN apt-get update \
|
||||
# && apt-get install -qq build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
|
||||
#
|
||||
#RUN mkdir -p /opt/node/js \
|
||||
# && cd /opt/node \
|
||||
# && npm i canvas
|
||||
#
|
||||
#WORKDIR /opt/node/js
|
||||
#
|
||||
#ENTRYPOINT ["node"]
|
||||
|
||||
###############
|
||||
# Solution #2 #
|
||||
###############
|
||||
# https://github.com/Automattic/node-canvas/issues/729#issuecomment-352991456
|
||||
# Took 22m 50s
|
||||
|
||||
#FROM ubuntu:xenial
|
||||
#
|
||||
#RUN apt-get update && apt-get install -y \
|
||||
# curl \
|
||||
# git
|
||||
#
|
||||
#RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \
|
||||
# && curl -sL https://deb.nodesource.com/setup_8.x | bash - \
|
||||
# && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
|
||||
# && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
||||
#
|
||||
#RUN apt-get update && apt-get install -y \
|
||||
# nodejs \
|
||||
# yarn \
|
||||
# libcairo2-dev \
|
||||
# libjpeg-dev \
|
||||
# libpango1.0-dev \
|
||||
# libgif-dev \
|
||||
# libpng-dev \
|
||||
# build-essential \
|
||||
# g++
|
||||
|
||||
###############
|
||||
# Solution #3 #
|
||||
###############
|
||||
# https://github.com/Automattic/node-canvas/issues/866#issuecomment-330001221
|
||||
# Took 7m 29s
|
||||
|
||||
FROM node:10.16.0-alpine
|
||||
FROM mhart/alpine-node:8.5.0
|
||||
|
||||
RUN apk add --no-cache \
|
||||
build-base \
|
||||
g++ \
|
||||
cairo-dev \
|
||||
jpeg-dev \
|
||||
pango-dev \
|
||||
bash \
|
||||
imagemagick
|
||||
|
||||
# The rest of the commands to execute
|
||||
FROM node:current-alpine
|
||||
|
||||
COPY . .
|
||||
|
||||
|
|
|
@ -43,9 +43,6 @@
|
|||
"tsc-watch": "^4.2.9",
|
||||
"typescript": "^3.9.7"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "^2.1.2"
|
||||
},
|
||||
"author": "Keanu Timmermans",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
|
|
@ -27,7 +27,7 @@ export default new NamedCommand({
|
|||
let output = LEGEND;
|
||||
|
||||
for (const command of commandList) {
|
||||
const field = `\n❯ \`${command.name}\`: ${command.description}`;
|
||||
const field = `\n❯ \`${command.name}\`: ${command.description}`.repeat(2);
|
||||
const newOutput = output + field;
|
||||
|
||||
// Push then reset the output if it overflows, otherwise, continue as normal.
|
||||
|
|
|
@ -139,16 +139,12 @@ export interface GenericJSON {
|
|||
[key: string]: any;
|
||||
}
|
||||
|
||||
// In order to define a file to write to while also not:
|
||||
// - Using the delete operator (which doesn't work on properties which cannot be undefined)
|
||||
// - Assigning it first then using Object.defineProperty (which raises a flag on CodeQL)
|
||||
// A non-null assertion is used on the class property to say that it'll definitely be assigned.
|
||||
export abstract class GenericStructure {
|
||||
private __meta__!: string;
|
||||
private __meta__ = "generic";
|
||||
|
||||
constructor(tag?: string) {
|
||||
this.__meta__ = tag || this.__meta__;
|
||||
Object.defineProperty(this, "__meta__", {
|
||||
value: tag || "generic",
|
||||
enumerable: false
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue