dwkim 0.0.0 → 0.0.2
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/index.js +29 -0
- package/package.json +9 -5
- package/script/build.js +25 -0
- package/src/index.ts +0 -2
- package/tsconfig.json +1 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
import boxen from "boxen";
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
var profile = JSON.parse(
|
|
9
|
+
fs.readFileSync(path.join(process.cwd(), "./profile.json"), "utf8")
|
|
10
|
+
);
|
|
11
|
+
var boxenOptions = {
|
|
12
|
+
padding: 1,
|
|
13
|
+
margin: 0,
|
|
14
|
+
borderStyle: "round",
|
|
15
|
+
borderColor: "green",
|
|
16
|
+
fullscreen: (width, height) => [width, height - 10]
|
|
17
|
+
};
|
|
18
|
+
var cardContent = [
|
|
19
|
+
chalk.white.bold(profile.name),
|
|
20
|
+
chalk.white(profile.title),
|
|
21
|
+
chalk.white(profile.bio),
|
|
22
|
+
"",
|
|
23
|
+
chalk.gray.bgWhite("Email: ") + chalk.white(profile.email),
|
|
24
|
+
chalk.gray.bgWhite("GitHub: ") + chalk.white(profile.github),
|
|
25
|
+
chalk.gray.bgWhite("Website: ") + chalk.white(profile.website),
|
|
26
|
+
"",
|
|
27
|
+
chalk.white("Out of box, pay it forward \u{1F44B}")
|
|
28
|
+
].join("\n");
|
|
29
|
+
console.log(boxen(cardContent, boxenOptions));
|
package/package.json
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dwkim",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"bin": "./dist/index.js",
|
|
5
6
|
"devDependencies": {
|
|
6
7
|
"@types/node": "^20.11.24",
|
|
8
|
+
"esbuild": "^0.24.2",
|
|
9
|
+
"ts-node": "^10.9.2",
|
|
7
10
|
"typescript": "~5.6.2",
|
|
8
|
-
"@repo/
|
|
9
|
-
"@repo/
|
|
11
|
+
"@repo/database": "1.0.0",
|
|
12
|
+
"@repo/typescript-config": "0.0.0"
|
|
10
13
|
},
|
|
11
14
|
"dependencies": {
|
|
12
15
|
"boxen": "^8.0.1",
|
|
13
16
|
"chalk": "^5.4.1"
|
|
14
17
|
},
|
|
15
18
|
"scripts": {
|
|
16
|
-
"
|
|
17
|
-
"build": "
|
|
19
|
+
"start": "npm run build && node dist/index.js",
|
|
20
|
+
"build": "node script/build.js",
|
|
21
|
+
"build:watch": "node script/build.js --watch"
|
|
18
22
|
}
|
|
19
23
|
}
|
package/script/build.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as esbuild from 'esbuild';
|
|
2
|
+
|
|
3
|
+
const config = {
|
|
4
|
+
entryPoints: ['src/index.ts'],
|
|
5
|
+
bundle: true,
|
|
6
|
+
platform: 'node',
|
|
7
|
+
format: 'esm',
|
|
8
|
+
outfile: 'dist/index.js',
|
|
9
|
+
banner: {
|
|
10
|
+
js: '#!/usr/bin/env node',
|
|
11
|
+
},
|
|
12
|
+
external: ['chalk', 'boxen'],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const args = process.argv.slice(2);
|
|
16
|
+
const watch = args.includes('--watch');
|
|
17
|
+
|
|
18
|
+
if (watch) {
|
|
19
|
+
const ctx = await esbuild.context(config);
|
|
20
|
+
await ctx.watch();
|
|
21
|
+
console.log('Watching...');
|
|
22
|
+
} else {
|
|
23
|
+
await esbuild.build(config);
|
|
24
|
+
console.log('Built!');
|
|
25
|
+
}
|
package/src/index.ts
CHANGED