techeverri 1.0.0 → 1.3.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/README.md CHANGED
@@ -1,15 +1,39 @@
1
+ ![GitHub](https://img.shields.io/github/license/techeverri/techeverri-cli?color=blue) [![CI](https://github.com/techeverri/techeverri-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/techeverri/techeverri-cli/actions/workflows/ci.yml) [![GitHub version](https://badge.fury.io/gh/techeverri%2Ftecheverri-cli.svg)](https://badge.fury.io/gh/techeverri%2Ftecheverri-cli) [![npm version](https://badge.fury.io/js/techeverri.svg)](https://badge.fury.io/js/techeverri)
2
+
1
3
  ### It's me Tomas! 👋
2
4
 
3
5
  _Inspired by [bitandbang](https://github.com/bnb/bitandbang)'s card._
4
6
 
5
7
  ## Usage
6
8
 
9
+ ### Prerequisites
10
+
11
+ - Requires [Node.js](https://nodejs.org/) (v12 or newer)
12
+
7
13
  ### npm
8
14
 
9
- To see my `npm` bussiness card, just run:
15
+ To see my `npm` card, run the following command:
10
16
 
11
17
  ```sh
12
18
  npx techeverri
13
19
  ```
14
20
 
15
- Won't include how to use it globally because I'm not sure why you'd want this as a global command. That'd be creepy.
21
+ ## Development
22
+
23
+ ### Prerequisites
24
+
25
+ - Requires [Node.js](https://nodejs.org/) (v16 or newer)
26
+
27
+ ### Commands
28
+
29
+ | Command | Description |
30
+ | ---------------- | --------------------------------- |
31
+ | `npm run print` | Print the card |
32
+ | `npm run build` | Build and print the card |
33
+ | `npm run test` | Run smoke tests (Jest) |
34
+ | `npm run format` | Format all files (Prettier) |
35
+ | `npm run lint` | Run static code analysis (ESLint) |
36
+
37
+ ## Screenshots
38
+
39
+ ![image](./screenshot.png)
package/bin/card CHANGED
@@ -4,7 +4,7 @@
4
4
   │ Tomas Echeverri / techeverri │
5
5
   │ Made in Colombia. Living in Sweden. │
6
6
   │ │
7
-  │ Work: Software Engineer │
7
+  │ Work: Software Developer at Shopify │
8
8
   │ Twitter: https://twitter.com/TomasEcheverri │
9
9
   │ GitHub: https://github.com/techeverri │
10
10
   │ npm: https://www.npmjs.com/~techeverri │
package/bin/cli.js CHANGED
@@ -2,12 +2,15 @@
2
2
 
3
3
  import fs from "fs";
4
4
  import path from "path";
5
+ import url from "url";
5
6
 
6
7
  const options = {
7
8
  encoding: "utf8",
8
9
  flag: "r",
9
10
  };
10
11
 
11
- const card = fs.readFileSync(path.join(path.resolve(), "bin/card"), options);
12
+ const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
13
+
14
+ const card = fs.readFileSync(path.join(__dirname, "card"), options);
12
15
 
13
16
  console.log(card);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "techeverri",
3
- "version": "1.0.0",
3
+ "version": "1.3.0",
4
4
  "description": "Personal card for Tomas Echeverri (@techeverri)",
5
5
  "keywords": [
6
6
  "business card",
@@ -17,8 +17,7 @@
17
17
  "url": "https://github.com/techeverri"
18
18
  },
19
19
  "files": [
20
- "bin/card",
21
- "src/cli.js"
20
+ "bin/card"
22
21
  ],
23
22
  "type": "module",
24
23
  "main": "./bin/cli.js",
@@ -31,20 +30,21 @@
31
30
  "format": "prettier --write .",
32
31
  "format:check": "prettier --check .",
33
32
  "lint": "eslint .",
33
+ "test": "jest",
34
+ "print": "node ./bin/cli.js",
34
35
  "build": "node ./build.js",
35
- "prestart": "npm run build",
36
- "start": "node ./bin/cli.js",
37
- "prepack": "npm run build",
38
- "prepublish": "npm run build"
36
+ "postbuild": "npm run print"
39
37
  },
40
38
  "devDependencies": {
41
39
  "boxen": "^6.2.1",
42
40
  "chalk": "^5.0.0",
43
41
  "eslint": "^8.6.0",
44
42
  "eslint-config-prettier": "^8.3.0",
43
+ "eslint-plugin-jest": "^25.3.4",
44
+ "jest": "^27.4.7",
45
45
  "prettier": "^2.5.1"
46
46
  },
47
47
  "engines": {
48
- "node": ">=16"
48
+ "node": ">=12"
49
49
  }
50
50
  }