Update dependencies (#63)

This commit is contained in:
Nikita Karamov 2024-02-25 01:19:06 +01:00 committed by GitHub
commit f56cf1412c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 2137 additions and 2154 deletions

View file

@ -22,10 +22,10 @@ jobs:
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use latest Node.js
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
node-version: "^18.17.0"
cache: "pnpm"
- run: pnpm install
- run: pnpm check

View file

@ -18,6 +18,11 @@ jobs:
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: "^18.17.0"
cache: "pnpm"
- run: pnpm install --frozen-lockfile

View file

@ -1,10 +1,7 @@
#!/usr/bin/env sh
# This file is part of Share₂Fedi
# https://github.com/kytta/share2fedi
#
# SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
# SPDX-License-Identifier: CC0-1.0
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged

View file

@ -7,14 +7,16 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { defineConfig } from "astro/config";
import lightningcss from "vite-plugin-lightningcss";
import cloudflare from "@astrojs/cloudflare";
import deno from "@astrojs/deno";
import netlify from "@astrojs/netlify/functions";
import netlify from "@astrojs/netlify";
import node from "@astrojs/node";
import vercel from "@astrojs/vercel/serverless";
import browserslist from "browserslist";
import { browserslistToTargets, transform } from "lightningcss";
let adapterConfig = {};
if (process.env.VERCEL) {
console.info("Using Vercel (serverless) adapter...");
@ -24,7 +26,7 @@ if (process.env.VERCEL) {
}),
};
} else if (process.env.CF_PAGES) {
console.info("Using Cloudflare adapter...");
console.info("Using Cloudflare (Pages) adapter...");
adapterConfig = {
adapter: cloudflare(),
};
@ -48,6 +50,29 @@ if (process.env.VERCEL) {
};
}
const lightningCssPlugin = () => {
const targets = browserslistToTargets(browserslist());
return {
name: "vite-plugin-lightningcss",
transform(source: string, id: string) {
if (!id.endsWith(".css")) return;
const { code, map } = transform({
filename: id,
code: Buffer.from(source),
minify: true,
sourceMap: true,
targets,
});
return {
code: code.toString(),
// eslint-disable-next-line unicorn/no-null
map: map ? map.toString() : null,
};
},
};
};
export default defineConfig({
site: "https://s2f.kytta.dev",
@ -55,6 +80,6 @@ export default defineConfig({
...adapterConfig,
vite: {
plugins: [lightningcss()],
plugins: [lightningCssPlugin()],
},
});

View file

@ -28,39 +28,40 @@
"fix:prettier": "prettier --write --ignore-unknown --plugin=prettier-plugin-astro",
"fix:stylelint": "stylelint --fix",
"test": "pnpm run check",
"prepare": "husky install"
"prepare": "husky"
},
"browserslist": "cover 95%, last 2 versions, Firefox ESR, not dead",
"dependencies": {
"@astrojs/cloudflare": "^7.5.1",
"@astrojs/cloudflare": "^9.0.0",
"@astrojs/deno": "^5.0.1",
"@astrojs/netlify": "^3.0.2",
"@astrojs/node": "^6.0.3",
"@astrojs/vercel": "^5.0.2",
"@astrojs/netlify": "^5.1.1",
"@astrojs/node": "^8.2.0",
"@astrojs/vercel": "^7.3.0",
"@nanostores/persistent": "^0.9.1",
"astro": "^3.2.3",
"nanostores": "^0.9.3"
"astro": "^4.3.6",
"nanostores": "^0.9.5"
},
"devDependencies": {
"@astrojs/check": "^0.2.0",
"@types/node": "^18.18.4",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-astro": "^0.29.1",
"eslint-plugin-unicorn": "^48.0.1",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"prettier": "^3.0.3",
"prettier-plugin-astro": "^0.12.0",
"sass": "^1.69.0",
"sharp": "^0.32.6",
"stylelint": "^15.10.3",
"stylelint-config-standard-scss": "^11.0.0",
"svgo": "^3.0.2",
"typescript": "^5.2.2",
"vite-plugin-lightningcss": "^0.0.5"
"@astrojs/check": "^0.5.3",
"@types/node": "^18.17.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"browserslist": "^4.22.3",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-astro": "^0.31.4",
"eslint-plugin-unicorn": "^51.0.1",
"husky": "^9.0.10",
"lightningcss": "^1.23.0",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.13.0",
"sass": "^1.70.0",
"sharp": "^0.33.2",
"stylelint": "^16.2.1",
"stylelint-config-standard-scss": "^13.0.0",
"svgo": "^3.2.0",
"typescript": "^5.3.3"
},
"lint-staged": {
"*": "pnpm run fix:prettier",
@ -73,5 +74,8 @@
},
"stylelint": {
"extends": "stylelint-config-standard-scss"
},
"engines": {
"node": "^18.17.0 || >= 20.3.0"
}
}

File diff suppressed because it is too large Load diff