@jonloucks/badges-ts 1.0.0 → 1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"Resolver.d.ts","sourceRoot":"","sources":["../../src/data/Resolver.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAE7D"}
1
+ {"version":3,"file":"Resolver.d.ts","sourceRoot":"","sources":["../../src/data/Resolver.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAK7D"}
package/data/Resolver.js CHANGED
@@ -1,4 +1,5 @@
1
- import { join } from "path";
1
+ import { dirname, join } from "path";
2
+ import { fileURLToPath } from "url";
2
3
  /**
3
4
  * Resolves a path relative to the src/data directory.
4
5
  * This is used to access data files that are part of the package, such as badge templates.
@@ -8,6 +9,9 @@ import { join } from "path";
8
9
  * @returns The resolved path.
9
10
  */
10
11
  export function resolveDataPath(...segments) {
11
- return join(import.meta.dirname, ...segments);
12
+ // Use import.meta.dirname if available (Node 20.11.0+); for older supported Node versions (e.g. 16/18), fall back to dirname(fileURLToPath(import.meta.url))
13
+ // This approach remains compatible with the project's supported Node range (Node 16+ with CI on Node 18) while taking advantage of newer features when available
14
+ const __dirname = import.meta.dirname ?? dirname(fileURLToPath(import.meta.url));
15
+ return join(__dirname, ...segments);
12
16
  }
13
17
  //# sourceMappingURL=Resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Resolver.js","sourceRoot":"","sources":["../../src/data/Resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,GAAG,QAAkB;IACnD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,CAAC;AAChD,CAAC"}
1
+ {"version":3,"file":"Resolver.js","sourceRoot":"","sources":["../../src/data/Resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,GAAG,QAAkB;IACnD,6JAA6J;IAC7J,iKAAiK;IACjK,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACjF,OAAO,IAAI,CAAC,SAAS,EAAE,GAAG,QAAQ,CAAC,CAAC;AACtC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jonloucks/badges-ts",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Node.js badge creator",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -22,6 +22,12 @@
22
22
  "import": "./cli.js",
23
23
  "default": "./cli.js"
24
24
  },
25
+ "./version": {
26
+ "types": "./version.d.ts",
27
+ "require": "./version.js",
28
+ "import": "./version.js",
29
+ "default": "./version.js"
30
+ },
25
31
  "./api/*": {
26
32
  "types": "./api/*.d.ts",
27
33
  "require": "./api/*.js",
@@ -59,7 +65,8 @@
59
65
  "compile": "tsc",
60
66
  "postversion": "npm run applyversion",
61
67
  "applyversion": "npx tsx ./src/cli.ts apply-version",
62
- "pack-package": "npm run before:publish && mkdir -p packs && cd dist && npm pack && mv *.tgz ../packs/ && npm run after:publish"
68
+ "pack-package": "npm run before:publish && mkdir -p packs && cd dist && npm pack && mv *.tgz ../packs/ && npm run after:publish",
69
+ "smoke-test": "npm run pack-package && rm -rf smoke && cp -r src/test/smoke smoke && cd smoke && npm install ../packs/*.tgz && npm test && npm run badges"
63
70
  },
64
71
  "keywords": [
65
72
  "typescript",
@@ -73,12 +80,14 @@
73
80
  "type": "git",
74
81
  "url": "git+https://github.com/jonloucks/badges-ts.git"
75
82
  },
83
+ "engines": {
84
+ "node": ">=16.0.0"
85
+ },
76
86
  "publishConfig": {
77
87
  "registry": "https://registry.npmjs.org/"
78
88
  },
79
89
  "devDependencies": {
80
90
  "@types/node": "^25.2.3",
81
- "@types/sinon": "^17.0.3",
82
91
  "@typescript-eslint/eslint-plugin": "^8.55.0",
83
92
  "@typescript-eslint/parser": "^8.53.1",
84
93
  "c8": "^10.1.3",
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // generated file - do not edit
2
2
  export const NAME = "@jonloucks/badges-ts";
3
- export const VERSION = "1.0.0";
3
+ export const VERSION = "1.0.2";
4
4
  //# sourceMappingURL=version.js.map