Skip to content

Commit

Permalink
Update package (#65)
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
  • Loading branch information
GervinFung authored Jul 30, 2024
1 parent d5a1f51 commit e703104
Show file tree
Hide file tree
Showing 3 changed files with 925 additions and 893 deletions.
42 changes: 42 additions & 0 deletions a.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const packageName = 'eslint';

const output = `
Legend: production dependency, optional only, dev only
@gitignored/web /home/gervin/Documents/programming/node/web/dynamic/gitignored/apps/web
devDependencies:
@typescript-eslint/eslint-plugin 7.16.1
└── eslint 8.57.0 peer
@typescript-eslint/parser 7.16.1
└── eslint 8.57.0 peer
eslint 8.57.0
eslint-plugin-jsx-a11y 6.9.0
└── eslint 8.57.0 peer
eslint-plugin-react 7.35.0
└── eslint 8.57.0 peer
`;

const parse = (output: string, packageName: string) => {
const lines = output.split('\n');

const kind = lines.at(0) === 'devDependencies:' ? '-D' : '';

const expression = new RegExp(
`^${packageName} ${Array.from({ length: 3 }, () => '\\d+').join('\\.')}$`
);

const package = lines.find((line) => {
return line.match(expression);
});

if (!package) {
throw new Error(`Package ${packageName} not found`);
}

const packageWithVersion = package.replace(' ', '@^');

return packageWithVersion;
};

console.log(parse(output, packageName));
20 changes: 10 additions & 10 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@poolofdeath20/util": "^0.8.0",
"@supabase/supabase-js": "^2.44.4",
"@supabase/supabase-js": "^2.45.0",
"@tanstack/react-query": "^4.36.1",
"@trpc/client": "^10.45.2",
"@trpc/next": "^10.45.2",
Expand All @@ -40,7 +40,7 @@
"react-syntax-highlighter": "^15.5.0",
"react-toastify": "^10.0.5",
"superjson": "^2.2.1",
"valibot": "^0.36.0"
"valibot": "^0.37.0"
},
"devDependencies": {
"@ducanh2912/next-pwa": "^10.2.8",
Expand All @@ -52,22 +52,22 @@
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-syntax-highlighter": "^15.5.13",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"ci-info": "^4.0.0",
"eslint": "^8.57.0",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint-plugin-react": "^7.35.0",
"gen-env-type-def": "^0.0.4",
"jest-image-snapshot": "^6.4.0",
"knip": "^5.26.0",
"knip": "^5.27.0",
"next-sitemap": "^4.2.3",
"prettier": "^3.3.3",
"puppeteer": "^22.13.1",
"puppeteer": "^22.14.0",
"sql-formatter": "15.3.2",
"supabase": "^1.183.5",
"typescript": "^5.5.3",
"vite-node": "^2.0.3",
"vitest": "^2.0.3"
"supabase": "^1.187.10",
"typescript": "^5.5.4",
"vite-node": "^2.0.4",
"vitest": "^2.0.4"
}
}
Loading

0 comments on commit e703104

Please sign in to comment.