create-sandi-ts-app 0.1.0
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/dist/cli/index.js +36 -0
- package/package.json +44 -0
- package/pnpm-lock.yaml +2362 -0
- package/templates/standard/.env.sample +2 -0
- package/templates/standard/.eslintrc.cjs +13 -0
- package/templates/standard/.gitignore +3 -0
- package/templates/standard/package.json +20 -0
- package/templates/standard/pnpm-lock.yaml +2865 -0
- package/templates/standard/tsconfig.json +104 -0
- package/templates/standard/types/global.d.ts +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
import { dirname } from 'sxy-lib/nodejs/esm.js';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import { existsSync, readdirSync } from 'fs';
|
|
6
|
+
import { copy } from 'fs-extra';
|
|
7
|
+
import chalk from 'chalk-extensions';
|
|
8
|
+
//import prompts from 'prompts'
|
|
9
|
+
const args = process.argv.slice(2);
|
|
10
|
+
const dest = args[0];
|
|
11
|
+
const createName = 'sandi-ts-app';
|
|
12
|
+
const packageName = 'create-' + createName;
|
|
13
|
+
if (dest === undefined) {
|
|
14
|
+
console.error(chalk.orange(`${packageName}: specify the location where you would like to create your app.`
|
|
15
|
+
+ `\nE.g. \`pnpm create ${createName} my-app\``
|
|
16
|
+
+ `\nUse \`.\` for current folder.`));
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
const fullDest = join(process.cwd(), dest);
|
|
20
|
+
// check that target location does not exist or is empty
|
|
21
|
+
if (existsSync(fullDest)) {
|
|
22
|
+
if (readdirSync(fullDest).length > 0) {
|
|
23
|
+
console.error(chalk.red(`${packageName}: target location ${fullDest} is not empty.`
|
|
24
|
+
+ `\nPlease delete all files in this location before running this command.`));
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const template = 'standard';
|
|
29
|
+
const templateLocation = join(dirname(import.meta.url), '..', '..', 'templates', template);
|
|
30
|
+
await copy(templateLocation, fullDest);
|
|
31
|
+
console.log(chalk.mediumgreen(`Hooray! New TS project created at ${fullDest}`
|
|
32
|
+
+ `\n`
|
|
33
|
+
+ `\nNext steps:`
|
|
34
|
+
+ ((dest !== '.') ? `\ncd ${dest}` : '')
|
|
35
|
+
+ `\n(pnpm package manager recommended: npm i -g pnpm)`
|
|
36
|
+
+ `\nInstall dependencies: pnpm i / npm i / yarn`));
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-sandi-ts-app",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"bin": "./dist/cli/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"templates",
|
|
9
|
+
"templates/**/.gitignore",
|
|
10
|
+
"pnpm-lock.yaml"
|
|
11
|
+
],
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"chalk-extensions": "^2.0.24",
|
|
14
|
+
"fs-extra": "^10.1.0",
|
|
15
|
+
"prompts": "^2.4.2",
|
|
16
|
+
"sxy-lib": "^2.0.37"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@babel/core": "^7.23.7",
|
|
20
|
+
"@babel/eslint-parser": "^7.23.3",
|
|
21
|
+
"@babel/preset-react": "^7.23.3",
|
|
22
|
+
"@types/fs-extra": "^11.0.4",
|
|
23
|
+
"@types/node": "^20.11.5",
|
|
24
|
+
"babel-plugin-module-resolver": "^4.1.0",
|
|
25
|
+
"eslint": "^8.56.0",
|
|
26
|
+
"eslint-config-sandi-react": "^1.2.0",
|
|
27
|
+
"eslint-config-tungsten-js": "^0.1.2",
|
|
28
|
+
"eslint-import-resolver-babel-module": "^5.3.2",
|
|
29
|
+
"eslint-plugin-import": "^2.29.1",
|
|
30
|
+
"eslint-plugin-react": "^7.33.2",
|
|
31
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
32
|
+
"tungsten": "link:..\\tungsten",
|
|
33
|
+
"typescript": "^5.3.3"
|
|
34
|
+
},
|
|
35
|
+
"author": "",
|
|
36
|
+
"license": "UNLICENSED",
|
|
37
|
+
"description": "",
|
|
38
|
+
"keywords": [],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc --watch",
|
|
41
|
+
"test": "",
|
|
42
|
+
"prepublish": "tsc"
|
|
43
|
+
}
|
|
44
|
+
}
|