Skip to content

Commit

Permalink
Update dependencies (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
kytta authored Feb 25, 2024
2 parents 8e38dd5 + 95e1011 commit f56cf14
Show file tree
Hide file tree
Showing 6 changed files with 2,131 additions and 2,148 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/deploy-deno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -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
33 changes: 29 additions & 4 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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...");
Expand All @@ -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(),
};
Expand All @@ -48,13 +50,36 @@ 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",

output: "server",
...adapterConfig,

vite: {
plugins: [lightningcss()],
plugins: [lightningCssPlugin()],
},
});
56 changes: 30 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -73,5 +74,8 @@
},
"stylelint": {
"extends": "stylelint-config-standard-scss"
},
"engines": {
"node": "^18.17.0 || >= 20.3.0"
}
}
Loading

0 comments on commit f56cf14

Please sign in to comment.