ts-init-template 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -1
- package/package.json +2 -2
- package/readme.md +12 -1
package/index.js
CHANGED
@@ -9,7 +9,12 @@ const __dirname = import.meta.dirname
|
|
9
9
|
const execAsync = promisify(exec);
|
10
10
|
//install dependencies
|
11
11
|
try{
|
12
|
-
const
|
12
|
+
const isYarn = await fs.access('yarn.lock').then(() => true).catch(() => false);
|
13
|
+
const installCmd = isYarn
|
14
|
+
? 'yarn add -D yarn add -D typescript ts-node @types/node fast-glob esbuild'
|
15
|
+
: 'npm install -D yarn add -D typescript ts-node @types/node fast-glob esbuild';
|
16
|
+
|
17
|
+
const { stdout, stderr } = await execAsync(installCmd);
|
13
18
|
console.log('Dependencies installed successfully:', stdout);
|
14
19
|
if(stderr){
|
15
20
|
console.error('Error during installation:', stderr);
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "ts-init-template",
|
3
|
-
"version": "1.0.
|
4
|
-
"description": "A TS project template for
|
3
|
+
"version": "1.0.5",
|
4
|
+
"description": "A TS project template for TS projects. This script will setup all the ts enviroment with 1 command. ",
|
5
5
|
"main": "index.js",
|
6
6
|
"author": "SigismundBT",
|
7
7
|
"license": "MIT",
|
package/readme.md
CHANGED
@@ -16,8 +16,19 @@
|
|
16
16
|
|
17
17
|
## 📦 Usage
|
18
18
|
|
19
|
+
### 💡 With Yarn
|
20
|
+
|
19
21
|
```bash
|
22
|
+
|
20
23
|
yarn init
|
21
24
|
npx ts-init-template
|
22
25
|
yarn build
|
23
|
-
yarn start
|
26
|
+
yarn start
|
27
|
+
|
28
|
+
### 💡 With NPM
|
29
|
+
|
30
|
+
```bash
|
31
|
+
npm init
|
32
|
+
npx ts-init-template
|
33
|
+
npm run build
|
34
|
+
npm run start
|