Skip to content

Commit

Permalink
Update package (#59)
Browse files Browse the repository at this point in the history
* chore(packages): update to latest non-breaking versions

* chore(packages): update to latest breaking versions

* packages(web): downgrade `@tanstack/query` and `valibot`

* test(server): kill next server by finding its process id directly instead of relying on port
  • Loading branch information
GervinFung authored Jun 16, 2024
1 parent 211a097 commit cc52fe4
Show file tree
Hide file tree
Showing 10 changed files with 1,927 additions and 2,495 deletions.
7 changes: 1 addition & 6 deletions apps/cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ MAKEFLAGS += --silent

outdir=temp-dev/temp-two

generate-type-for-ci:
make install-node-packages &&\
make pre-development
generate-type-for-ci: pre-development

code-gen:
node script/code-gen.js && make format-write
Expand Down Expand Up @@ -103,9 +101,6 @@ clean:
install-rust:
curl https://sh.rustup.rs -sSf | sh -s -- -y

install-node-packages:
cd script && pnpm install --frozen-lockfile

pre-publish:
node script/publish.js pre-publish

Expand Down
2 changes: 1 addition & 1 deletion apps/cli/config/.env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
API=https://gitignored.vercel.app/api/v0
API=http://localhost:8081/api/v0
FILE_NAME=.gitignore-temp
CACHE=gitignored-dev
5 changes: 5 additions & 0 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
"name": "@gitignored/cli",
"author": "PoolOfDeath20",
"private": true,
"type": "module",
"scripts": {
"postinstall": "make install-rust",
"typecheck": "make typecheck",
"format-check": "make format-check",
"format-write": "make format-write",
"lint": "make lint",
"generate-type-for-ci": "make generate-type-for-ci"
},
"devDependencies": {
"toml": "^3.0.0",
"tree-kill": "^1.2.2"
}
}
6 changes: 0 additions & 6 deletions apps/cli/script/package.json

This file was deleted.

8 changes: 5 additions & 3 deletions apps/cli/script/test-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ const main = async () => {

child.execSync('make mid-test-dev', { stdio: 'inherit' });

child.execSync(`kill $(lsof -t -i:${port})`);
} catch (_) {
child.execSync(`kill $(lsof -t -i:${port})`);
child.execSync('cd ../../apps/web && make kill-server', {
stdio: 'inherit',
});
} catch (error) {
console.error(error);
}
};

Expand Down
3 changes: 3 additions & 0 deletions apps/web/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,7 @@ test-snapshot:
pretest-ci:
node node_modules/puppeteer/install.mjs

kill-server:
pnpm vite-node script/test/kill-server.ts

test: build-testing test-unit test-integration test-snapshot
40 changes: 20 additions & 20 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@poolofdeath20/util": "^0.8.0",
"@supabase/supabase-js": "^2.41.1",
"@supabase/supabase-js": "^2.43.4",
"@tanstack/react-query": "^4.36.1",
"@trpc/client": "^10.45.2",
"@trpc/next": "^10.45.2",
"@trpc/react-query": "^10.45.2",
"@trpc/server": "^10.45.2",
"axios": "^1.6.8",
"axios": "^1.7.2",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"file-saver": "^2.0.5",
Expand All @@ -32,43 +32,43 @@
"iwanthue": "^2.0.0",
"jszip": "^3.10.1",
"localforage": "^1.10.0",
"next": "^14.1.4",
"next": "^14.2.3",
"next-seo": "^6.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.2.1",
"react-select": "^5.8.0",
"react-syntax-highlighter": "^15.5.0",
"react-toastify": "^10.0.5",
"superjson": "^2.2.1",
"valibot": "^0.30.0"
},
"devDependencies": {
"@ducanh2912/next-pwa": "^10.2.5",
"@ducanh2912/next-pwa": "^10.2.7",
"@poolofdeath20/eslint-config": "^0.3.2",
"@poolofdeath20/tsconfig": "^0.0.0",
"@types/cors": "^2.8.17",
"@types/file-saver": "^2.0.7",
"@types/jest-image-snapshot": "^6.4.0",
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.23",
"@types/react-syntax-highlighter": "^15.5.11",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-syntax-highlighter": "^15.5.13",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.11.0",
"ci-info": "^4.0.0",
"eslint": "^8.57.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react": "^7.34.2",
"gen-env-type-def": "^0.0.4",
"jest-image-snapshot": "^6.4.0",
"knip": "^5.7.0",
"knip": "^5.17.3",
"next-sitemap": "^4.2.3",
"prettier": "^3.2.5",
"puppeteer": "^22.6.1",
"sql-formatter": "15.3.0",
"supabase": "^1.151.1",
"typescript": "^5.4.3",
"vite-node": "^1.4.0",
"vitest": "^1.4.0"
"puppeteer": "^22.10.0",
"sql-formatter": "15.3.1",
"supabase": "^1.169.8",
"typescript": "^5.4.5",
"vite-node": "^1.6.0",
"vitest": "^1.6.0"
}
}
24 changes: 24 additions & 0 deletions apps/web/script/test/kill-server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import child from 'child_process';

import { Defined } from '@poolofdeath20/util';

const main = () => {
child
.execSync('ps -ef | grep next', {
encoding: 'utf-8',
})
.split('\n')
.filter((process) => {
return process.includes('node ');
})
.map((process) => {
return Defined.parse(process.split(' ').filter(Boolean).at(1))
.map(parseInt)
.orThrow('Could not parse process id');
})
.forEach((pid) => {
child.execSync(`kill ${pid}`);
});
};

main();
8 changes: 4 additions & 4 deletions apps/web/test/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export default class Server {
};

readonly kill = () => {
child.execSync(`kill $(lsof -t -i:${this.port})`);
child.execSync('make kill-server', {
encoding: 'utf-8',
});
};

readonly start = async () => {
Expand All @@ -23,9 +25,7 @@ export default class Server {
})
.on('message', console.log)
.on('error', console.error)
.on('kill', () => {
this.kill();
});
.on('kill', this.kill);

server.stdout?.setEncoding('utf-8');
server.stderr?.setEncoding('utf-8');
Expand Down
Loading

0 comments on commit cc52fe4

Please sign in to comment.