@stonecrop/rockfoil 0.8.13 → 0.9.1
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 +10 -13
- package/dist/tests/postgraphile.test.d.ts +0 -2
- package/dist/tests/postgraphile.test.d.ts.map +0 -1
- package/dist/tests/postgraphile.test.js +0 -58
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/middleware → middleware}/postgraphile.js +0 -0
- /package/dist/{src/types → types}/index.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/rockfoil",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -16,25 +16,23 @@
|
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/agritheory/stonecrop/issues"
|
|
18
18
|
},
|
|
19
|
+
"types": "./dist/rockfoil.d.ts",
|
|
19
20
|
"exports": {
|
|
20
21
|
".": {
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
"default": "./dist/rockfoil.js"
|
|
24
|
-
},
|
|
25
|
-
"require": "./dist/rockfoil.umd.cjs"
|
|
22
|
+
"types": "./dist/rockfoil.d.ts",
|
|
23
|
+
"import": "./dist/rockfoil.js"
|
|
26
24
|
},
|
|
27
|
-
"./
|
|
28
|
-
|
|
29
|
-
"require": "./dist/src/types/index.d.ts"
|
|
30
|
-
},
|
|
31
|
-
"./styles": "./dist/assets/index.css"
|
|
25
|
+
"./styles": "./dist/assets/index.css",
|
|
26
|
+
"./types": "./dist/src/types/index.d.ts"
|
|
32
27
|
},
|
|
33
|
-
"typings": "./dist/index.d.ts",
|
|
34
28
|
"files": [
|
|
35
29
|
"dist/*",
|
|
36
30
|
"src/*"
|
|
37
31
|
],
|
|
32
|
+
"description": "PostGraphile plugin for Stonecrop schema integration",
|
|
33
|
+
"sideEffects": [
|
|
34
|
+
"**/*.css"
|
|
35
|
+
],
|
|
38
36
|
"dependencies": {
|
|
39
37
|
"graphql": "^16.12.0",
|
|
40
38
|
"postgraphile": "^5.0.0-rc.7"
|
|
@@ -57,7 +55,6 @@
|
|
|
57
55
|
},
|
|
58
56
|
"scripts": {
|
|
59
57
|
"_phase:build": "heft build && vite build && rushx docs",
|
|
60
|
-
"prepublish": "heft build && vite build && rushx docs",
|
|
61
58
|
"build": "heft build && vite build && rushx docs",
|
|
62
59
|
"dev": "vite",
|
|
63
60
|
"docs": "bash ../common/scripts/run-docs.sh rockfoil",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"postgraphile.test.d.ts","sourceRoot":"","sources":["../../tests/postgraphile.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
-
// Mock postgraphile/utils with a simple implementation
|
|
3
|
-
vi.mock('postgraphile/utils', () => ({
|
|
4
|
-
wrapPlans: (config) => ({
|
|
5
|
-
name: 'TestPlugin',
|
|
6
|
-
version: '1.0.0',
|
|
7
|
-
_config: config, // Store config for testing
|
|
8
|
-
}),
|
|
9
|
-
}));
|
|
10
|
-
import { createPglRockfoilPlugin } from '../src/middleware/postgraphile';
|
|
11
|
-
describe('Rockfoil PostGraphile Plugin', () => {
|
|
12
|
-
describe('createPglRockfoilPlugin', () => {
|
|
13
|
-
it('should create a valid plugin with empty hook map', () => {
|
|
14
|
-
const plugin = createPglRockfoilPlugin({});
|
|
15
|
-
expect(plugin).toBeDefined();
|
|
16
|
-
expect(plugin.name).toBe('TestPlugin');
|
|
17
|
-
expect(plugin.version).toBe('1.0.0');
|
|
18
|
-
});
|
|
19
|
-
it('should create a plugin with query hooks', () => {
|
|
20
|
-
const hookMap = {
|
|
21
|
-
testField: {
|
|
22
|
-
beforeQuery: vi.fn(),
|
|
23
|
-
afterQuery: vi.fn(),
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
const plugin = createPglRockfoilPlugin(hookMap);
|
|
27
|
-
expect(plugin).toBeDefined();
|
|
28
|
-
expect(plugin.name).toBe('TestPlugin');
|
|
29
|
-
});
|
|
30
|
-
it('should create a plugin with mutation hooks', () => {
|
|
31
|
-
const hookMap = {
|
|
32
|
-
createTest: {
|
|
33
|
-
beforeMutation: vi.fn(),
|
|
34
|
-
afterMutation: vi.fn(),
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
const plugin = createPglRockfoilPlugin(hookMap);
|
|
38
|
-
expect(plugin).toBeDefined();
|
|
39
|
-
expect(plugin.name).toBe('TestPlugin');
|
|
40
|
-
});
|
|
41
|
-
it('should handle complex hook map', () => {
|
|
42
|
-
const hookMap = {
|
|
43
|
-
field1: {
|
|
44
|
-
beforeQuery: vi.fn(),
|
|
45
|
-
},
|
|
46
|
-
field2: {
|
|
47
|
-
afterQuery: vi.fn(),
|
|
48
|
-
},
|
|
49
|
-
field3: {
|
|
50
|
-
beforeMutation: vi.fn(),
|
|
51
|
-
afterMutation: vi.fn(),
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
const plugin = createPglRockfoilPlugin(hookMap);
|
|
55
|
-
expect(plugin).toBeDefined();
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|