switch to yarn

This commit is contained in:
Luna 2023-07-24 13:27:15 +05:30
parent b462e9d1fc
commit 283e632772
24 changed files with 65044 additions and 19069 deletions

13
.gitignore vendored
View file

@ -61,9 +61,16 @@ packages/megalodon/.idea
*.blend4 *.blend4
*.blend5 *.blend5
# old yarn #old pnpm
.yarn pnpm*
yarn*
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# Nix Development shell items # Nix Development shell items
.devenv .devenv

39178
.pnp.cjs generated Executable file

File diff suppressed because one or more lines are too long

2042
.pnp.loader.mjs generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -6,9 +6,9 @@ pipeline:
- cp .config/ci.yml .config/default.yml - cp .config/ci.yml .config/default.yml
- corepack enable - corepack enable
- corepack prepare pnpm@latest --activate - corepack prepare pnpm@latest --activate
- pnpm i --frozen-lockfile - yarn
- pnpm run build - yarn build
- pnpm run migrate - yarn migrate
services: services:
database: database:

File diff suppressed because one or more lines are too long

3
.yarnrc.yml Normal file
View file

@ -0,0 +1,3 @@
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

View file

@ -31,7 +31,7 @@
name = "iceshrimp-dev-shell"; name = "iceshrimp-dev-shell";
# Add additional packages to our environment # Add additional packages to our environment
packages = [ packages = [
pkgs.nodePackages.pnpm pkgs.nodePackages.yarn
pkgs.python3 pkgs.python3
]; ];
@ -49,12 +49,12 @@
dev-server.exec = "pnpm run dev"; dev-server.exec = "pnpm run dev";
}; };
scripts = { scripts = {
build.exec = "pnpm run build"; build.exec = "yarn run build";
clean.exec = "pnpm run clean"; clean.exec = "yarn run clean";
clear-state.exec = "rm -rf .devenv/state/redis .devenv/state/postgres"; clear-state.exec = "rm -rf .devenv/state/redis .devenv/state/postgres";
format.exec = "pnpm run format"; format.exec = "yarn run format";
install-deps.exec = "pnpm install"; install-deps.exec = "yarn install";
migrate.exec = "pnpm run migrate"; migrate.exec = "yarn run migrate";
prepare-config.exec = "cp .config/devenv.yml .config/default.yml"; prepare-config.exec = "cp .config/devenv.yml .config/default.yml";
}; };
services = { services = {

View file

@ -6,32 +6,39 @@
"type": "git", "type": "git",
"url": "https://iceshrimp.dev/iceshrimp/iceshrimp.git" "url": "https://iceshrimp.dev/iceshrimp/iceshrimp.git"
}, },
"packageManager": "pnpm@8.6.9",
"private": true, "private": true,
"scripts": { "scripts": {
"rebuild": "pnpm run clean && pnpm node ./scripts/build-greet.js && pnpm -r --parallel run build && pnpm run gulp", "rebuild": "clean && node ./scripts/build-greet.js && yarn workspace iceshrimp-js build && yarn workspaces foreach -pi run build && gulp",
"build": "pnpm node ./scripts/build-greet.js && pnpm -r --parallel run build && pnpm run gulp", "build": "node ./scripts/build-greet.js && yarn workspace iceshrimp-js build && yarn workspaces foreach run build && gulp",
"start": "pnpm --filter backend run start", "start": "yarn workspace backend run start",
"start:test": "pnpm --filter backend run start:test", "start:test": "yarn workspace backend run start:test",
"init": "pnpm run migrate", "init": "yarn migrate",
"migrate": "pnpm --filter backend run migrate", "migrate": "yarn workspace backend run migrate",
"revertmigration": "pnpm --filter backend run revertmigration", "revertmigration": "yarn workspace backend run revertmigration",
"migrateandstart": "pnpm run migrate && pnpm run start", "migrateandstart": "yarn migrate && yarn start",
"gulp": "gulp build", "gulp": "gulp build",
"watch": "pnpm run dev", "watch": "yarn dev",
"dev": "pnpm node ./scripts/dev.js", "dev": "node ./scripts/dev.js",
"dev:staging": "NODE_OPTIONS=--max_old_space_size=3072 NODE_ENV=development pnpm run build && pnpm run start", "dev:staging": "NODE_OPTIONS=--max_old_space_size=3072 NODE_ENV=development yarn build && yarn start",
"lint": "pnpm -r --parallel run lint", "lint": "yarn workspaces foreach -p lint",
"cy:open": "cypress open --browser --e2e --config-file=cypress.config.ts", "cy:open": "cypress open --browser --e2e --config-file=cypress.config.ts",
"cy:run": "cypress run", "cy:run": "cypress run",
"e2e": "start-server-and-test start:test http://localhost:61812 cy:run", "e2e": "start-server-and-test start:test http://localhost:61812 cy:run",
"mocha": "pnpm --filter backend run mocha", "mocha": "yarn workspace backend run mocha",
"test": "pnpm run mocha", "test": "yarn mocha",
"format": "pnpm -r --parallel run format", "format": "yarn workspaces foreach -p run format",
"clean": "pnpm node ./scripts/clean.js", "clean": "node ./scripts/clean.js",
"clean-all": "pnpm node ./scripts/clean-all.js", "clean-all": "node ./scripts/clean-all.js",
"cleanall": "pnpm run clean-all" "cleanall": "yarn clean-all"
}, },
"workspaces": [
"packages/backend",
"packages/backend/native-utils",
"packages/client",
"packages/sw",
"packages/iceshrimp-js",
"packages/megalodon"
],
"resolutions": { "resolutions": {
"chokidar": "^3.3.1" "chokidar": "^3.3.1"
}, },
@ -48,6 +55,7 @@
"@types/gulp-rename": "2.0.2", "@types/gulp-rename": "2.0.2",
"@types/node": "20.4.1", "@types/node": "20.4.1",
"chalk": "4.1.2", "chalk": "4.1.2",
"chokidar": "^3.5.3",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"cypress": "10.11.0", "cypress": "10.11.0",
"execa": "5.1.1", "execa": "5.1.1",

View file

@ -1,4 +1,4 @@
Copyright 2023 Calckey Copyright 2023 Firefish
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

BIN
packages/backend/assets/badges/error.png (Stored with Git LFS)

Binary file not shown.

BIN
packages/backend/assets/badges/info.png (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

View file

@ -34,17 +34,17 @@
}, },
"scripts": { "scripts": {
"artifacts": "napi artifacts", "artifacts": "napi artifacts",
"build": "pnpm run build:napi && pnpm run build:migration", "build": "yarn build:napi && yarn build:migration",
"build:napi": "napi build --features napi --platform --release ./built/", "build:napi": "napi build --features napi --platform --release ./built/",
"build:migration": "cargo build --locked --release --manifest-path ./migration/Cargo.toml && cp ./target/release/migration ./built/migration", "build:migration": "cargo build --locked --release --manifest-path ./migration/Cargo.toml && cp ./target/release/migration ./built/migration",
"build:debug": "napi build --platform ./built/ && cargo build --manifest-path ./migration/Cargo.toml", "build:debug": "napi build --platform ./built/ && cargo build --manifest-path ./migration/Cargo.toml",
"prepublishOnly": "napi prepublish -t npm", "prepublishOnly": "napi prepublish -t npm",
"test": "pnpm run cargo:test && pnpm run build:napi && ava", "test": "yarn cargo:test && yarn build:napi && ava",
"universal": "napi universal", "universal": "napi universal",
"version": "napi version", "version": "napi version",
"format": "cargo fmt --all", "format": "cargo fmt --all",
"lint": "cargo clippy --fix", "lint": "cargo clippy --fix",
"cargo:test": "pnpm run cargo:unit && pnpm run cargo:integration", "cargo:test": "yarn cargo:unit && yarn cargo:integration",
"cargo:unit": "cargo test unit_test && cargo test -F napi unit_test", "cargo:unit": "cargo test unit_test && cargo test -F napi unit_test",
"cargo:integration": "cargo test -F noarray int_test -- --test-threads=1" "cargo:integration": "cargo test -F noarray int_test -- --test-threads=1"
} }

View file

@ -4,21 +4,21 @@
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "pnpm node ./built/index.js", "start": "node ./built/index.js",
"start:test": "NODE_ENV=test pnpm node ./built/index.js", "start:test": "NODE_ENV=test node ./built/index.js",
"migrate": "pnpm run migrate:typeorm && pnpm run migrate:cargo", "migrate": "yarn migrate:typeorm && yarn migrate:cargo",
"migrate:typeorm": "typeorm migration:run -d ormconfig.js", "migrate:typeorm": "typeorm migration:run -d ormconfig.js",
"migrate:cargo": "./native-utils/built/migration up", "migrate:cargo": "./native-utils/built/migration up",
"revertmigration": "pnpm run revertmigration:cargo && pnpm run revertmigration:typeorm", "revertmigration": "yarn revertmigration:cargo && yarn revertmigration:typeorm",
"revertmigration:typeorm": "typeorm migration:revert -d ormconfig.js", "revertmigration:typeorm": "typeorm migration:revert -d ormconfig.js",
"revertmigration:cargo": "./native-utils/built/migration down", "revertmigration:cargo": "./native-utils/built/migration down",
"check:connect": "node ./check_connect.js", "check:connect": "node ./check_connect.js",
"build": "pnpm swc src -d built -D", "build": "swc src -d built -D",
"watch": "pnpm swc src -d built -D -w", "watch": "swc src -d built -D -w",
"lint": "pnpm rome check --apply *", "lint": "rome check --apply *",
"mocha": "cross-env NODE_ENV=test TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha", "mocha": "cross-env NODE_ENV=test TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha",
"test": "pnpm run mocha", "test": "mocha",
"format": "pnpm rome format * --write" "format": "rome format * --write"
}, },
"optionalDependencies": { "optionalDependencies": {
"@swc/core-android-arm64": "1.3.11", "@swc/core-android-arm64": "1.3.11",
@ -50,7 +50,6 @@
"blurhash": "2.0.5", "blurhash": "2.0.5",
"bull": "4.10.4", "bull": "4.10.4",
"cacheable-lookup": "7.0.0", "cacheable-lookup": "7.0.0",
"iceshrimp-js": "workspace:*",
"cbor": "8.1.0", "cbor": "8.1.0",
"chalk": "5.3.0", "chalk": "5.3.0",
"chalk-template": "0.4.0", "chalk-template": "0.4.0",
@ -68,6 +67,7 @@
"got": "12.5.3", "got": "12.5.3",
"gunzip-maybe": "^1.4.2", "gunzip-maybe": "^1.4.2",
"hpagent": "0.1.2", "hpagent": "0.1.2",
"iceshrimp-js": "workspace:*",
"ioredis": "5.3.2", "ioredis": "5.3.2",
"ip-cidr": "3.1.0", "ip-cidr": "3.1.0",
"is-svg": "4.3.2", "is-svg": "4.3.2",

View file

@ -2,11 +2,11 @@
"name": "client", "name": "client",
"private": true, "private": true,
"scripts": { "scripts": {
"watch": "pnpm vite build --watch --mode development", "watch": "vite build --watch --mode development",
"build": "pnpm vite build", "build": "vite build",
"lint": "pnpm rome check **/*.ts --apply && pnpm run lint:vue", "lint": "rome check **/*.ts --apply && yarn lint:vue",
"lint:vue": "pnpm paralint --ext .vue --fix '**/*.vue' --cache", "lint:vue": "paralint --ext .vue --fix '**/*.vue' --cache",
"format": "pnpm rome format * --write && pnpm prettier --write '**/*.{scss,vue}' --cache --cache-strategy metadata" "format": "rome format * --write && prettier --write '**/*.{scss,vue}' --cache --cache-strategy metadata"
}, },
"devDependencies": { "devDependencies": {
"@discordapp/twemoji": "14.1.2", "@discordapp/twemoji": "14.1.2",
@ -34,7 +34,7 @@
"autosize": "5.0.2", "autosize": "5.0.2",
"blurhash": "2.0.5", "blurhash": "2.0.5",
"broadcast-channel": "5.1.0", "broadcast-channel": "5.1.0",
"browser-image-resizer": "github:misskey-dev/browser-image-resizer", "browser-image-resizer": "https://iceshrimp.dev/nullrequest/browser-image-resizer.git",
"chart.js": "4.3.0", "chart.js": "4.3.0",
"chartjs-adapter-date-fns": "3.0.0", "chartjs-adapter-date-fns": "3.0.0",
"chartjs-chart-matrix": "^2.0.1", "chartjs-chart-matrix": "^2.0.1",

View file

@ -32,5 +32,5 @@ export default defineComponent({
</script> </script>
<style> <style>
@import "../../node_modules/katex/dist/katex.min.css"; @import "katex/dist/katex.min.css";
</style> </style>

View file

@ -5,24 +5,24 @@
"main": "./built/index.js", "main": "./built/index.js",
"types": "./built/index.d.ts", "types": "./built/index.d.ts",
"scripts": { "scripts": {
"build": "pnpm swc src -d built -D", "build": "swc src -d built -D",
"render": "pnpm run build && pnpm run api && pnpm run api-prod && cp temp/iceshrimp-js.api.json etc/ && pnpm run api-doc", "render": "yarn build && yarn api && yarn api-prod && cp temp/iceshrimp-js.api.json etc/ && yarn api-doc",
"tsd": "tsc && tsd", "tsd": "tsc && tsd",
"api": "pnpm api-extractor run --local --verbose", "api": "api-extractor run --local --verbose",
"api-prod": "pnpm api-extractor run --verbose", "api-prod": "api-extractor run --verbose",
"api-doc": "pnpm api-documenter markdown -i ./etc/", "api-doc": "api-documenter markdown -i ./etc/",
"lint": "pnpm rome check --apply *.ts", "lint": "rome check --apply *.ts",
"format": "pnpm rome format --write *.ts", "format": "rome format --write *.ts",
"jest": "jest --coverage --detectOpenHandles", "jest": "jest --coverage --detectOpenHandles",
"test": "pnpm jest && pnpm tsd" "test": "jest && tsd"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://codeberg.org/firefish/firefish.git" "url": "https://codeberg.org/firefish/firefish.git"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/api-extractor": "^7.36.0",
"@microsoft/api-documenter": "^7.22.21", "@microsoft/api-documenter": "^7.22.21",
"@microsoft/api-extractor": "^7.36.0",
"@swc/cli": "^0.1.62", "@swc/cli": "^0.1.62",
"@swc/core": "^1.3.62", "@swc/core": "^1.3.62",
"@types/jest": "^27.4.0", "@types/jest": "^27.4.0",

View file

@ -5,8 +5,8 @@
"typings": "./lib/src/index.d.ts", "typings": "./lib/src/index.d.ts",
"scripts": { "scripts": {
"build": "tsc -p ./", "build": "tsc -p ./",
"lint": "pnpm rome check **/*.ts --apply", "lint": "rome check **/*.ts --apply",
"format": "pnpm rome format --write src/**/*.ts", "format": "rome format --write src/**/*.ts",
"doc": "typedoc --out ../docs ./src", "doc": "typedoc --out ../docs ./src",
"test": "NODE_ENV=test jest -u --maxWorkers=3" "test": "NODE_ENV=test jest -u --maxWorkers=3"
}, },
@ -36,6 +36,7 @@
"dependencies": { "dependencies": {
"@types/oauth": "^0.9.0", "@types/oauth": "^0.9.0",
"@types/ws": "^8.5.4", "@types/ws": "^8.5.4",
"async-lock": "1.4.0",
"axios": "1.2.2", "axios": "1.2.2",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"form-data": "^4.0.0", "form-data": "^4.0.0",
@ -46,20 +47,19 @@
"socks-proxy-agent": "^7.0.0", "socks-proxy-agent": "^7.0.0",
"typescript": "4.9.4", "typescript": "4.9.4",
"uuid": "^9.0.0", "uuid": "^9.0.0",
"ws": "8.12.0", "ws": "8.12.0"
"async-lock": "1.4.0"
}, },
"devDependencies": { "devDependencies": {
"@types/async-lock": "1.4.0",
"@types/core-js": "^2.5.0", "@types/core-js": "^2.5.0",
"@types/form-data": "^2.5.0", "@types/form-data": "^2.5.0",
"@types/jest": "^29.4.0", "@types/jest": "^29.4.0",
"@types/node": "18.11.18",
"@types/object-assign-deep": "^0.4.0", "@types/object-assign-deep": "^0.4.0",
"@types/parse-link-header": "^2.0.0", "@types/parse-link-header": "^2.0.0",
"@types/uuid": "^9.0.0", "@types/uuid": "^9.0.0",
"@types/node": "18.11.18",
"@typescript-eslint/eslint-plugin": "^5.49.0", "@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0", "@typescript-eslint/parser": "^5.49.0",
"@types/async-lock": "1.4.0",
"eslint": "^8.32.0", "eslint": "^8.32.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-config-standard": "^16.0.3", "eslint-config-standard": "^16.0.3",

View file

@ -3,9 +3,9 @@
"private": true, "private": true,
"scripts": { "scripts": {
"build": "webpack", "build": "webpack",
"watch": "pnpm swc src -d built -D -w", "watch": "swc src -d built -D -w",
"lint": "pnpm rome check **/*.ts --apply", "lint": "rome check **/*.ts --apply",
"format": "pnpm rome format * --write" "format": "rome format * --write"
}, },
"devDependencies": { "devDependencies": {
"@swc/cli": "^0.1.62", "@swc/cli": "^0.1.62",

File diff suppressed because it is too large Load diff

View file

@ -1,7 +0,0 @@
packages:
- 'packages/backend'
- 'packages/backend/native-utils'
- 'packages/client'
- 'packages/sw'
- 'packages/iceshrimp-js'
- 'packages/megalodon'

View file

@ -61,7 +61,7 @@ const { join } = require("node:path");
force: true, force: true,
}); });
execa("pnpm", ["store", "prune"], { execa("yarn", ["clean"], {
cwd: join(__dirname, "/../"), cwd: join(__dirname, "/../"),
stdio: "inherit", stdio: "inherit",
}); });

View file

@ -1,31 +1,41 @@
const execa = require("execa"); const execa = require("execa");
(async () => { (async () => {
await execa("pnpm", ["clean"], { await execa("yarn", ["clean"], {
cwd: __dirname + "/../", cwd: __dirname + "/../",
stdout: process.stdout, stdout: process.stdout,
stderr: process.stderr, stderr: process.stderr,
}); });
execa("pnpm", ["dlx", "gulp", "watch"], { await execa("yarn", ["workspace", "iceshrimp-js", "build"], {
stdout: process.stdout,
stderr: process.stderr,
})
await execa("yarn", ["workspaces", "foreach", "run", "build"], {
stdout: process.stdout,
stderr: process.stderr,
});
execa("yarn", ["gulp", "watch"], {
cwd: __dirname + "/../", cwd: __dirname + "/../",
stdout: process.stdout, stdout: process.stdout,
stderr: process.stderr, stderr: process.stderr,
}); });
execa("pnpm", ["--filter", "backend", "watch"], { execa("yarn", ["workspace", "backend", "watch"], {
cwd: __dirname + "/../", cwd: __dirname + "/../",
stdout: process.stdout, stdout: process.stdout,
stderr: process.stderr, stderr: process.stderr,
}); });
execa("pnpm", ["--filter", "client", "watch"], { execa("yarn", ["workspace", "client", "watch"], {
cwd: __dirname + "/../", cwd: __dirname + "/../",
stdout: process.stdout, stdout: process.stdout,
stderr: process.stderr, stderr: process.stderr,
}); });
execa("pnpm", ["--filter", "sw", "watch"], { execa("yarn", ["workspace", "sw", "watch"], {
cwd: __dirname + "/../", cwd: __dirname + "/../",
stdout: process.stdout, stdout: process.stdout,
stderr: process.stderr, stderr: process.stderr,
@ -33,7 +43,7 @@ const execa = require("execa");
const start = async () => { const start = async () => {
try { try {
await execa("pnpm", ["start"], { await execa("yarn", ["start"], {
cwd: __dirname + "/../", cwd: __dirname + "/../",
stdout: process.stdout, stdout: process.stdout,
stderr: process.stderr, stderr: process.stderr,

23685
yarn.lock Normal file

File diff suppressed because it is too large Load diff