Refactor routing in App component to enhance navigation and improve error handling by integrating dynamic routes and updating the NotFound route.
This commit is contained in:
21
node_modules/preferred-pm/LICENSE
generated
vendored
Normal file
21
node_modules/preferred-pm/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018-2025 Zoltan Kochan <z@kochan.io>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
39
node_modules/preferred-pm/README.md
generated
vendored
Normal file
39
node_modules/preferred-pm/README.md
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
# preferred-pm
|
||||
|
||||
> Returns the preferred package manager of a project
|
||||
|
||||
[](https://www.npmjs.com/package/preferred-pm)
|
||||
|
||||
* Inside a Yarn workspace, Yarn is preferred.
|
||||
* Inside a pnpm workspace, pnpm is preferred.
|
||||
* If a `package-lock.json` is present, npm is preferred.
|
||||
* If a `yarn.lock` is present, Yarn is preferred.
|
||||
* If a `pnpm-lock.yaml` is present, pnpm is preferred.
|
||||
* If a `bun.lockb` is present, Bun is preferred.
|
||||
* If a `node_modules` is present, tries to detect which package manager installed it.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
<pnpm|yarn|npm|bun> add preferred-pm
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
'use strict'
|
||||
const preferredPM = require('preferred-pm')
|
||||
|
||||
preferredPM(process.cwd())
|
||||
.then(pm => console.log(pm))
|
||||
//> {name: "npm", version: ">=5"}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
* [which-pm](https://github.com/zkochan/packages/tree/main/which-pm) - Detects what package manager was used for installation
|
||||
* [which-pm-runs](https://github.com/zkochan/packages/tree/main/which-pm-runs) - Detects what package manager executes the process
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE) © [Zoltan Kochan](https://kochan.io)
|
3
node_modules/preferred-pm/index.d.ts
generated
vendored
Normal file
3
node_modules/preferred-pm/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export = preferredPM
|
||||
|
||||
declare function preferredPM (pkgPath: string): Promise<{ name: 'npm' | 'pnpm' | 'yarn' | 'bun', version: string } | null>
|
65
node_modules/preferred-pm/index.js
generated
vendored
Normal file
65
node_modules/preferred-pm/index.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
'use strict'
|
||||
const findYarnWorkspaceRoot = require('find-yarn-workspace-root2')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const whichPM = require('which-pm')
|
||||
|
||||
module.exports = async function preferredPM (pkgPath) {
|
||||
if (typeof pkgPath !== 'string') {
|
||||
throw new TypeError(`pkgPath should be a string, got ${typeof pkgPath}`)
|
||||
}
|
||||
if (fs.existsSync(path.join(pkgPath, 'package-lock.json'))) {
|
||||
return {
|
||||
name: 'npm',
|
||||
version: '>=5'
|
||||
}
|
||||
}
|
||||
if (fs.existsSync(path.join(pkgPath, 'yarn.lock'))) {
|
||||
return {
|
||||
name: 'yarn',
|
||||
version: '*'
|
||||
}
|
||||
}
|
||||
if (fs.existsSync(path.join(pkgPath, 'pnpm-lock.yaml'))) {
|
||||
return {
|
||||
name: 'pnpm',
|
||||
version: '>=3'
|
||||
}
|
||||
}
|
||||
if (fs.existsSync(path.join(pkgPath, 'shrinkwrap.yaml'))) {
|
||||
return {
|
||||
name: 'pnpm',
|
||||
version: '1 || 2'
|
||||
}
|
||||
}
|
||||
if (fs.existsSync(path.join(pkgPath, 'bun.lockb')) || fs.existsSync(path.join(pkgPath, 'bun.lock'))) {
|
||||
return {
|
||||
name: 'bun',
|
||||
version: '*'
|
||||
}
|
||||
}
|
||||
const { findUp } = await import('find-up-simple')
|
||||
if (await findUp('pnpm-lock.yaml', { cwd: pkgPath })) {
|
||||
return {
|
||||
name: 'pnpm',
|
||||
version: '>=3'
|
||||
}
|
||||
}
|
||||
try {
|
||||
const workspaceRoot = findYarnWorkspaceRoot(pkgPath)
|
||||
if (typeof workspaceRoot === 'string') {
|
||||
if (fs.existsSync(path.join(workspaceRoot, 'package-lock.json'))) {
|
||||
return {
|
||||
name: 'npm',
|
||||
version: '>=7'
|
||||
}
|
||||
}
|
||||
return {
|
||||
name: 'yarn',
|
||||
version: '*'
|
||||
}
|
||||
}
|
||||
} catch (err) {}
|
||||
const pm = await whichPM(pkgPath)
|
||||
return pm && { name: pm.name, version: pm.version || '*' }
|
||||
}
|
48
node_modules/preferred-pm/package.json
generated
vendored
Normal file
48
node_modules/preferred-pm/package.json
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "preferred-pm",
|
||||
"version": "4.1.1",
|
||||
"description": "Detects what package manager was used for installation",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18.12"
|
||||
},
|
||||
"repository": "https://github.com/zkochan/packages/tree/main/preferred-pm",
|
||||
"bugs": {
|
||||
"url": "https://github.com/zkochan/packages/labels/package%3A%20preferred-pm"
|
||||
},
|
||||
"keywords": [
|
||||
"npm",
|
||||
"pnpm",
|
||||
"yarn"
|
||||
],
|
||||
"author": {
|
||||
"name": "Zoltan Kochan",
|
||||
"email": "z@kochan.io",
|
||||
"url": "https://www.kochan.io/"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependenciesMeta": {
|
||||
"preferred-pm": {
|
||||
"injected": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"find-up-simple": "^1.0.0",
|
||||
"find-yarn-workspace-root2": "1.2.16",
|
||||
"which-pm": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ncp": "^2.0.0",
|
||||
"preferred-pm": "file:",
|
||||
"standard": "^16.0.4",
|
||||
"tape": "^5.3.2",
|
||||
"tempy": "^1.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "standard && node test"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user