-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #314 from vikejs/small-improvements
Small improvements
- Loading branch information
Showing
15 changed files
with
195 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
export function packageManager() { | ||
if (!process.env.npm_config_user_agent) { | ||
return undefined; | ||
} | ||
return pmFromUserAgent(process.env.npm_config_user_agent); | ||
} | ||
|
||
function pmFromUserAgent(userAgent: string) { | ||
const pmSpec = userAgent.split(" ")[0]; | ||
const separatorPos = pmSpec.lastIndexOf("/"); | ||
const name = pmSpec.substring(0, separatorPos); | ||
return { | ||
name: name === "npminstall" ? "cnpm" : name, | ||
version: pmSpec.substring(separatorPos + 1), | ||
}; | ||
} | ||
|
||
export function getArgs() { | ||
const pm = packageManager()?.name; | ||
|
||
switch (pm) { | ||
case "pnpm": | ||
return "pnpm create bati"; | ||
case "yarn": | ||
return "yarn dlx @batijs/cli"; | ||
case "bun": | ||
return "bun create bati"; | ||
default: | ||
return "npm create bati --"; | ||
} | ||
} | ||
|
||
export function getVersion() { | ||
const v = process.env.npm_package_version; | ||
|
||
if (v) { | ||
return { | ||
version: v, | ||
semver: v.split(".") as [string, string, string], | ||
}; | ||
} | ||
|
||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<p align="center"> | ||
<img src="https://raw.githubusercontent.com/vikejs/bati/main/website/assets/logo.svg" height="150"> | ||
</p> | ||
|
||
<h1 align="center"> | ||
Bâti | ||
</h1> | ||
<p align="center"> | ||
Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want. | ||
<p> | ||
|
||
<h3 align="center"><a href="https://batijs.dev">Try the CLI generator</a></h3> | ||
|
||
![Demo](doc/demo.gif) | ||
|
||
## Features | ||
- <img src="https://api.iconify.design/fluent-emoji-flat:shopping-cart.svg?color=%23888888" width=16 height=16></img> Choose the features you need, with the libraries you want | ||
- <img src="https://api.iconify.design/fluent-emoji-flat:card-file-box.svg?color=%23888888" width=16 height=16></img> Configuration files are tailored for the stack you choose | ||
- <img src="https://api.iconify.design/fluent-emoji-flat:house.svg?color=%23888888" width=16 height=16></img> Ready to start | ||
- <img src="https://api.iconify.design/logos:vitejs.svg?color=%23888888" width=16 height=16></img> [Vite](https://vitejs.dev) ecosystem | ||
- <img src="https://api.iconify.design/logos:typescript-icon.svg?color=%23888888" width=16 height=16></img> Typescript with strict types | ||
- <img src="https://api.iconify.design/logos:eslint.svg?color=%23888888" width=16 height=16></img> Follows ESLint recommendations | ||
- <img src="https://vike.dev/icons/vike-square-gradient.svg" width=16 height=16></img> Based on [Vike](https://vike.dev) for portability and customazibility | ||
- <img src="https://wintercg.org/static/logo.svg" width=16 height=16></img> Sane and future-proof recommendations based on [WinterCG](https://wintercg.org) | ||
- <img src="https://api.iconify.design/fluent-emoji-flat:green-circle.svg?color=%23888888" width=16 height=16></img> Always up-to-date, with automated testing | ||
|
||
<hr> | ||
|
||
**Not seeing your favorite tool? [Manually integrate it](https://vike.dev/integration) and/or upvote it [here](https://github.com/vikejs/bati/discussions/categories/integration-request).** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env node | ||
import "@batijs/cli"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "create-bati", | ||
"version": "0.0.226", | ||
"type": "module", | ||
"scripts": {}, | ||
"keywords": [], | ||
"description": "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want", | ||
"author": "Joël Charles <joel.charles91@gmail.com>", | ||
"repository": "https://github.com/vikejs/bati", | ||
"license": "MIT", | ||
"bin": "./index.js", | ||
"devDependencies": {}, | ||
"dependencies": { | ||
"@batijs/cli": "workspace:*" | ||
}, | ||
"files": [ | ||
"index.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.