@wtasnorg/node-lib 0.0.1 → 0.0.3

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.
@@ -0,0 +1,36 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: Node.js Package
5
+
6
+ on:
7
+ release:
8
+ types: [created]
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-node@v4
16
+ with:
17
+ node-version: 20
18
+ - run: npm clean-install
19
+ - run: npm run build
20
+ - run: npm run test
21
+ - run: npm run docs
22
+ - run: npm run docs:json
23
+
24
+ publish-npm:
25
+ needs: build
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: actions/setup-node@v4
30
+ with:
31
+ node-version: 20
32
+ registry-url: https://registry.npmjs.org/
33
+ - run: npm clean-install
34
+ - run: npm publish
35
+ env:
36
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
package/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # @wtasnorg/node-lib
2
2
 
3
- A library project for nodejs.
4
-
5
- #typescript #library
3
+ A library project for nodejs. #nodejs #typescript #library
6
4
 
7
5
  - [npm org](https://www.npmjs.com/org/wtasnorg)
8
6
  - [github repo](https://github.com/wtasg/node-lib)
@@ -28,7 +26,7 @@ npm install @wtasnorg/node-lib
28
26
  # check if you can run code
29
27
  import {hello} from "@wtasnorg/node-lib";
30
28
 
31
- hello();
29
+ await hello();
32
30
  // "hello from @wtasnorg/node-lib"
33
31
  ```
34
32
 
package/docs/README.md CHANGED
@@ -4,9 +4,7 @@
4
4
 
5
5
  # @wtasnorg/node-lib
6
6
 
7
- A library project for nodejs.
8
-
9
- #typescript #library
7
+ A library project for nodejs. #nodejs #typescript #library
10
8
 
11
9
  - [npm org](https://www.npmjs.com/org/wtasnorg)
12
10
  - [github repo](https://github.com/wtasg/node-lib)
@@ -32,7 +30,7 @@ npm install @wtasnorg/node-lib
32
30
  # check if you can run code
33
31
  import {hello} from "@wtasnorg/node-lib";
34
32
 
35
- hello();
33
+ await hello();
36
34
  // "hello from @wtasnorg/node-lib"
37
35
  ```
38
36
 
package/docs/docs.json CHANGED
@@ -16,7 +16,8 @@
16
16
  {
17
17
  "fileName": "hello.ts",
18
18
  "line": 6,
19
- "character": 9
19
+ "character": 15,
20
+ "url": "https://github.com/wtasg/node-lib/blob/8c33d6e85b13c11164c0ab9dca01c58d3cd86813/src/hello.ts#L6"
20
21
  }
21
22
  ],
22
23
  "signatures": [
@@ -49,12 +50,25 @@
49
50
  {
50
51
  "fileName": "hello.ts",
51
52
  "line": 6,
52
- "character": 9
53
+ "character": 15,
54
+ "url": "https://github.com/wtasg/node-lib/blob/8c33d6e85b13c11164c0ab9dca01c58d3cd86813/src/hello.ts#L6"
53
55
  }
54
56
  ],
55
57
  "type": {
56
- "type": "intrinsic",
57
- "name": "string"
58
+ "type": "reference",
59
+ "target": {
60
+ "packageName": "typescript",
61
+ "packagePath": "lib/lib.es5.d.ts",
62
+ "qualifiedName": "Promise"
63
+ },
64
+ "typeArguments": [
65
+ {
66
+ "type": "intrinsic",
67
+ "name": "string"
68
+ }
69
+ ],
70
+ "name": "Promise",
71
+ "package": "typescript"
58
72
  }
59
73
  }
60
74
  ]
@@ -72,7 +86,7 @@
72
86
  "readme": [
73
87
  {
74
88
  "kind": "text",
75
- "text": "# @wtasnorg/node-lib\n\nA library project for nodejs.\n\n#typescript #library\n\n- [npm org](https://www.npmjs.com/org/wtasnorg)\n- [github repo](https://github.com/wtasg/node-lib)\n\n## Develop\n\n"
89
+ "text": "# @wtasnorg/node-lib\n\nA library project for nodejs. #nodejs #typescript #library\n\n- [npm org](https://www.npmjs.com/org/wtasnorg)\n- [github repo](https://github.com/wtasg/node-lib)\n\n## Develop\n\n"
76
90
  },
77
91
  {
78
92
  "kind": "code",
@@ -100,7 +114,7 @@
100
114
  },
101
115
  {
102
116
  "kind": "code",
103
- "text": "```typescript\n# check if you can run code\nimport {hello} from \"@wtasnorg/node-lib\";\n\nhello(); \n// \"hello from @wtasnorg/node-lib\"\n```"
117
+ "text": "```typescript\n# check if you can run code\nimport {hello} from \"@wtasnorg/node-lib\";\n\nawait hello(); \n// \"hello from @wtasnorg/node-lib\"\n```"
104
118
  },
105
119
  {
106
120
  "kind": "text",
@@ -6,14 +6,14 @@
6
6
 
7
7
  # Function: hello()
8
8
 
9
- > **hello**(): `string`
9
+ > **hello**(): `Promise`\<`string`\>
10
10
 
11
- Defined in: hello.ts:6
11
+ Defined in: [hello.ts:6](https://github.com/wtasg/node-lib/blob/8c33d6e85b13c11164c0ab9dca01c58d3cd86813/src/hello.ts#L6)
12
12
 
13
13
  A sample function that should work to test if lib is installed correctly.
14
14
 
15
15
  ## Returns
16
16
 
17
- `string`
17
+ `Promise`\<`string`\>
18
18
 
19
19
  hello message
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@wtasnorg/node-lib",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "node library",
5
+ "main": "src/index.js",
5
6
  "scripts": {
6
7
  "build": "./node_modules/.bin/tsc --project tsconfig.json",
7
8
  "docs": "./node_modules/.bin/typedoc",
package/src/hello.d.ts CHANGED
@@ -3,6 +3,6 @@
3
3
  *
4
4
  * @returns hello message
5
5
  */
6
- declare function hello(): string;
6
+ declare function hello(): Promise<string>;
7
7
  export { hello };
8
8
  //# sourceMappingURL=hello.d.ts.map
package/src/hello.js CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @returns hello message
5
5
  */
6
- function hello() {
6
+ async function hello() {
7
7
  const message = "hello from @wtasnorg/node-lib";
8
8
  if (console?.log) {
9
9
  console.log(message);
package/src/hello.test.js CHANGED
@@ -2,14 +2,14 @@ import { describe, it } from "node:test";
2
2
  import { strictEqual } from "node:assert";
3
3
  import { hello } from "./hello.js";
4
4
  describe("hello", () => {
5
- it("returns a string that has the word 'hello' in it", () => {
5
+ it("returns a string that has the word 'hello' in it", async () => {
6
6
  const expected = true;
7
- const actual = hello();
7
+ const actual = await hello();
8
8
  strictEqual(actual.includes("hello"), expected);
9
9
  });
10
- it("returns exact string", () => {
10
+ it("returns exact string", async () => {
11
11
  const expected = "hello from @wtasnorg/node-lib";
12
- const actual = hello();
12
+ const actual = await hello();
13
13
  strictEqual(actual, expected);
14
14
  });
15
15
  });
package/src/hello.test.ts CHANGED
@@ -3,15 +3,15 @@ import { strictEqual } from "node:assert";
3
3
  import { hello } from "./hello.js";
4
4
 
5
5
  describe("hello", () => {
6
- it("returns a string that has the word 'hello' in it", () => {
6
+ it("returns a string that has the word 'hello' in it", async () => {
7
7
  const expected = true;
8
- const actual = hello();
8
+ const actual = await hello();
9
9
  strictEqual(actual.includes("hello"), expected);
10
10
  });
11
11
 
12
- it("returns exact string", () => {
12
+ it("returns exact string", async () => {
13
13
  const expected = "hello from @wtasnorg/node-lib";
14
- const actual = hello();
14
+ const actual = await hello();
15
15
  strictEqual(actual, expected);
16
16
  });
17
17
  });
package/src/hello.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @returns hello message
5
5
  */
6
- function hello() {
6
+ async function hello() {
7
7
  const message = "hello from @wtasnorg/node-lib";
8
8
  if (console?.log) {
9
9
  console.log(message);