-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
67 additions
and
29 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,26 +1,38 @@ | ||
# ts-app-template | ||
Base template for a typescript app. | ||
<div align="center"> | ||
<p align="center"> | ||
<img width="750" src="Banner.png"/> | ||
</p> | ||
<p> | ||
<a href="https://esbuild.github.io/"> | ||
<img height="48" src="Badges/ESBuild.png" /> | ||
</a> | ||
<a href="https://www.typescriptlang.org/"> | ||
<img height="48" src="Badges/Typescript.png" /> | ||
</a> | ||
<a href="https://prettier.io/"> | ||
<img height="48" src="Badges/Prettier.png" /> | ||
</a> | ||
<a href="https://eslint.org/"> | ||
<img height="48" src="Badges/ESLint.png" /> | ||
</a> | ||
<a href="https://typicode.github.io/husky/"> | ||
<img height="48" src="Badges/Husky.png" /> | ||
</a> | ||
</p> | ||
</div> | ||
|
||
# Setup | ||
After cloning, init your project by running | ||
```bash | ||
npm init -y | ||
``` | ||
|
||
and install the required eslint plugins by running | ||
```bash | ||
npm i | ||
``` | ||
|
||
# Files and scripts | ||
You can find the `index.ts` file in the `src` directory and the build file at `scripts/build.js`. | ||
|
||
You can build the project by running | ||
```bash | ||
npm run build | ||
``` | ||
|
||
and start it by running | ||
```bash | ||
npm run start | ||
``` | ||
|
||
1. After cloning the repository, make sure you have [pnpm](https://pnpm.io/) installed. If you don't, you can install it by running `npm install -g pnpm`. | ||
|
||
2. After that, you can proceed to set up the project by running `pnpm run setup`. This will install all the necessary dependencies and purge the README, LICENSE, and Banner files which are no longer needed. | ||
|
||
3. If you're using Visual Studio Code, you can also install the recommended extensions by clicking on the "Install Recommended Extensions" button that appears when you open the project. | ||
|
||
4. You're all set! You can now start developing your project. | ||
|
||
# Development | ||
|
||
If you want to make a production build, you can run `pnpm run prod`. This will create a `dist` folder with the production build of your project. | ||
|
||
If you want to make a development build, you can run `pnpm run dev`. This will create a `dist` folder with the development build of your project and will automatically rebuild the project whenever you make changes to the source files. |
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,23 @@ | ||
import fs from 'fs'; | ||
import { execSync } from 'child_process'; | ||
|
||
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8')); | ||
|
||
console.log('[Setup]', 'Cleaning up...'); | ||
|
||
fs.unlinkSync('./README.md'); | ||
fs.unlinkSync('./LICENSE'); | ||
|
||
fs.unlinkSync('./Banner.png'); | ||
fs.rmdirSync('./Badges', { recursive: true }); | ||
|
||
delete packageJson.scripts.setup; | ||
fs.writeFileSync('../package.json', JSON.stringify(packageJson, null, 4)); | ||
|
||
fs.unlinkSync(__filename); | ||
|
||
console.log('[Setup]', 'Install dependencies...'); | ||
|
||
execSync('pnpm install'); | ||
|
||
console.log('[Setup]', 'Setup complete.'); |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
console.log('Hello, world!'); | ||
console.log(`Typescript starter template, ready to go! - NodeJS v${process.version} TypeScript v${process.versions.typescript} on ${process.platform} platform.`); | ||
console.log(`Typescript starter template, ready to go! - NodeJS ${process.version} on ${process.platform} platform.`); |