@nera-static/plugin-utils 1.0.1 → 1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nera-static/plugin-utils",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Shared utility functions for Nera plugins (like config loading)",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -24,10 +24,22 @@
24
24
  "publishConfig": {
25
25
  "access": "public"
26
26
  },
27
+ "dependencies": {
28
+ "js-yaml": "^4.1.0"
29
+ },
27
30
  "devDependencies": {
28
- "vitest": "^1.0.0"
31
+ "vitest": "^3.2.4"
29
32
  },
30
33
  "scripts": {
31
34
  "test": "vitest"
35
+ },
36
+ "exports": {
37
+ ".": "./index.js"
38
+ },
39
+ "files": [
40
+ "index.js"
41
+ ],
42
+ "engines": {
43
+ "node": ">=18"
32
44
  }
33
45
  }
@@ -1,30 +0,0 @@
1
- name: 🧪 Run Tests
2
-
3
- on:
4
- push:
5
- branches: [ main ]
6
- pull_request:
7
- branches: [ main ]
8
-
9
- jobs:
10
- build-and-test:
11
- runs-on: ubuntu-latest
12
- strategy:
13
- matrix:
14
- node-version: [18, 20]
15
-
16
- steps:
17
- - name: Checkout repository
18
- uses: actions/checkout@v4
19
-
20
- - name: Setup Node.js ${{ matrix.node-version }}
21
- uses: actions/setup-node@v4
22
- with:
23
- node-version: ${{ matrix.node-version }}
24
- cache: 'npm'
25
-
26
- - name: Install dependencies
27
- run: npm install
28
-
29
- - name: Run tests
30
- run: npm test
@@ -1,22 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { writeFileSync, unlinkSync } from 'fs';
3
- import { getConfig } from '../index.js';
4
-
5
- const tmpFile = './.tmp-config.yaml';
6
-
7
- describe('getConfig', () => {
8
- it('returns parsed object when file exists', () => {
9
- writeFileSync(tmpFile, 'title: Hello\nitems:\n - one\n - two');
10
- const config = getConfig(tmpFile);
11
-
12
- expect(config.title).toBe('Hello');
13
- expect(config.items).toEqual(['one', 'two']);
14
-
15
- unlinkSync(tmpFile);
16
- });
17
-
18
- it('returns empty object when file does not exist', () => {
19
- const config = getConfig('./nonexistent.yaml');
20
- expect(config).toEqual({});
21
- });
22
- });