Skip to content

Commit

Permalink
Upgrade everything (#44)
Browse files Browse the repository at this point in the history
* Bump flakes

* bump gh actions

* update everything

* update yarn sdks

* lint fix
  • Loading branch information
macalinao committed Nov 30, 2023
1 parent 4a5c0ec commit 2619b39
Show file tree
Hide file tree
Showing 29 changed files with 2,865 additions and 2,250 deletions.
3 changes: 1 addition & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
watch_file flake.nix
watch_file flake.lock
mkdir -p .direnv
eval "$(nix print-dev-env --profile "$(direnv_layout_dir)/flake-profile")"
use flake
6 changes: 3 additions & 3 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
name: Sync

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Yarn Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
runs-on: ubuntu-latest
name: Check
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Yarn Cache
uses: actions/cache@v3.0.11
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand Down
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"eslint.nodePath": ".yarn/sdks",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"prettier.prettierPath": ".yarn/sdks/prettier/index.js"
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs"
}
811 changes: 0 additions & 811 deletions .yarn/releases/yarn-4.0.0-rc.26.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions .yarn/sdks/eslint/lib/unsupported-api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/use-at-your-own-risk
require(absPnpApiPath).setup();
}
}

// Defer to the real eslint/use-at-your-own-risk your application uses
module.exports = absRequire(`eslint/use-at-your-own-risk`);
12 changes: 10 additions & 2 deletions .yarn/sdks/eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"name": "eslint",
"version": "8.26.0-sdk",
"version": "8.54.0-sdk",
"main": "./lib/api.js",
"type": "commonjs"
"type": "commonjs",
"bin": {
"eslint": "./bin/eslint.js"
},
"exports": {
"./package.json": "./package.json",
".": "./lib/api.js",
"./use-at-your-own-risk": "./lib/unsupported-api.js"
}
}
20 changes: 20 additions & 0 deletions .yarn/sdks/prettier/bin/prettier.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require prettier/bin/prettier.cjs
require(absPnpApiPath).setup();
}
}

// Defer to the real prettier/bin/prettier.cjs your application uses
module.exports = absRequire(`prettier/bin/prettier.cjs`);
6 changes: 3 additions & 3 deletions .yarn/sdks/prettier/index.js → .yarn/sdks/prettier/index.cjs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require prettier/index.js
// Setup the environment to be able to require prettier
require(absPnpApiPath).setup();
}
}

// Defer to the real prettier/index.js your application uses
module.exports = absRequire(`prettier/index.js`);
// Defer to the real prettier your application uses
module.exports = absRequire(`prettier`);
7 changes: 4 additions & 3 deletions .yarn/sdks/prettier/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "prettier",
"version": "2.7.1-sdk",
"main": "./index.js",
"type": "commonjs"
"version": "3.1.0-sdk",
"main": "./index.cjs",
"type": "commonjs",
"bin": "./bin/prettier.cjs"
}
2 changes: 2 additions & 0 deletions .yarn/sdks/typescript/lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ const moduleWrapper = tsserver => {
str = `zip:${str}`;
} break;
}
} else {
str = str.replace(/^\/?/, process.platform === `win32` ? `` : `/`);
}
}

Expand Down
2 changes: 2 additions & 0 deletions .yarn/sdks/typescript/lib/tsserverlibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ const moduleWrapper = tsserver => {
str = `zip:${str}`;
} break;
}
} else {
str = str.replace(/^\/?/, process.platform === `win32` ? `` : `/`);
}
}

Expand Down
6 changes: 3 additions & 3 deletions .yarn/sdks/typescript/lib/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/typescript.js
// Setup the environment to be able to require typescript
require(absPnpApiPath).setup();
}
}

// Defer to the real typescript/lib/typescript.js your application uses
module.exports = absRequire(`typescript/lib/typescript.js`);
// Defer to the real typescript your application uses
module.exports = absRequire(`typescript`);
8 changes: 6 additions & 2 deletions .yarn/sdks/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "typescript",
"version": "4.8.4-sdk",
"version": "5.3.2-sdk",
"main": "./lib/typescript.js",
"type": "commonjs"
"type": "commonjs",
"bin": {
"tsc": "./bin/tsc",
"tsserver": "./bin/tsserver"
}
}
6 changes: 5 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: pnp

yarnPath: .yarn/releases/yarn-4.0.0-rc.26.cjs
yarnPath: .yarn/releases/yarn-4.0.2.cjs
30 changes: 24 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,22 @@
xorg.libX11
xorg.libXi
xorg.libXext
libGLU
zlib
libpng
nasm
cairo
pango
libuuid
librsvg
] ++ (pkgs.lib.optionals (!pkgs.stdenv.isAarch64) [
] ++ lib.optionals (!stdenv.isAarch64) [
glibc.out
glibc.static
]);
] ++ lib.optionals (!stdenv.isDarwin) [
libGLU
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk_11_0.frameworks.CoreText
];

LD_LIBRARY_PATH = lib.makeLibraryPath [ libuuid ];
};
});
Expand Down
40 changes: 22 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,35 @@
"repository": "git@github.com:saber-hq/saber-lp-token-list-generator.git",
"author": "Ian Macalinao <ian@saber.so>",
"license": "AGPL-3.0",
"packageManager": "yarn@4.0.0-rc.26",
"packageManager": "yarn@4.0.2",
"devDependencies": {
"@rushstack/eslint-patch": "^1.2.0",
"@saberhq/eslint-config": "^2.1.0",
"@types/bn.js": "^5.1.1",
"@types/eslint": "^8.4.8",
"@types/lodash": "^4.14.186",
"@types/node": "^18.11.7",
"@types/prettier": "^2.7.1",
"@rushstack/eslint-patch": "^1.6.0",
"@saberhq/eslint-config": "^3.2.0",
"@types/bn.js": "^5.1.5",
"@types/eslint": "^8.44.8",
"@types/lodash": "^4.14.202",
"@types/node": "^18.18.14",
"@types/prettier": "^3.0.0",
"@types/sharp": "^0.31.0",
"eslint": "^8.26.0",
"eslint-import-resolver-node": "^0.3.6",
"eslint-plugin-import": "^2.26.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"eslint": "^8.54.0",
"eslint-import-resolver-node": "^0.3.9",
"eslint-plugin-import": "^2.29.0",
"husky": "^8.0.3",
"lint-staged": "^15.1.0",
"prettier": "^3.1.0",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
"typescript": "^5.3.2"
},
"dependencies": {
"@saberhq/solana-contrib": "^1.14.9",
"@saberhq/token-utils": "^1.14.9",
"@solana/web3.js": "^1.66.2",
"axios": "^0.26.1",
"bn.js": "^5.2.1",
"canvas": "^2.10.1",
"canvas": "^2.11.2",
"jsbi": "^4.3.0",
"lodash": "^4.17.21",
"node-vibrant": "^3.2.1-alpha.1",
"sharp": "^0.31.1",
"sharp": "^0.31",
"tiny-invariant": "^1.3.1"
},
"scripts": {
Expand All @@ -53,5 +52,10 @@
"lint-staged": {
"*.ts": "eslint --cache --fix",
"*.{md,json,js,yml,yaml,html}": "prettier --write"
},
"dependenciesMeta": {
"sharp@0.33.0": {
"unplugged": true
}
}
}
8 changes: 4 additions & 4 deletions src/createAssetLaunchBanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const drawImage = async ({
};

export const createAssetLaunchBanner = async (
token: TokenInfo
token: TokenInfo,
): Promise<{ png: Buffer; jpg: Buffer }> => {
const launchBannerBG = await fs.readFile(`${__dirname}/launch-banner.svg`);

Expand Down Expand Up @@ -97,7 +97,7 @@ export const createAssetLaunchBanner = async (
0,
0,
WIDTH,
HEIGHT
HEIGHT,
);

ctx.font = `bold 48px Inter`;
Expand All @@ -120,15 +120,15 @@ export const createAssetLaunchBanner = async (
startX,
startY,
iconDim,
iconDim
iconDim,
);
}

ctx.fillStyle = "white";
ctx.fillText(
token.symbol,
startX + iconDim + 16,
startY + iconDim - textHeight / 2
startY + iconDim - textHeight / 2,
);

ctx.font = `medium 28px Inter`;
Expand Down
6 changes: 3 additions & 3 deletions src/createDecimalWrapperTokenIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const drawImage = async ({
0,
0,
DIMENSION,
DIMENSION
DIMENSION,
);
} catch (e) {
console.warn(`Unsupported image: ${url ?? ""}`, e);
Expand All @@ -47,7 +47,7 @@ const drawImage = async ({

export const createDecimalWrapperTokenIcon = async (
token: TokenInfo,
decimals: number
decimals: number,
): Promise<{ png: Buffer; jpg: Buffer }> => {
const canvas = createCanvas(DIMENSION, DIMENSION);
const ctx = canvas.getContext("2d");
Expand All @@ -73,7 +73,7 @@ export const createDecimalWrapperTokenIcon = async (
ctx.fillText(
decimals.toString(),
DIMENSION / 2,
(DIMENSION * 7) / 8 + fontSize * 0.1
(DIMENSION * 7) / 8 + fontSize * 0.1,
);

const mask = await loadImage(`${__dirname}/mask.svg`);
Expand Down
Loading

0 comments on commit 2619b39

Please sign in to comment.