Skip to content

Commit 7cd00c1

Browse files
copy wasm file during build
Signed-off-by: Thomas Poignant <[email protected]>
1 parent 31b9a72 commit 7cd00c1

File tree

6 files changed

+41
-10
lines changed

6 files changed

+41
-10
lines changed

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
[submodule "libs/shared/flagd-core/spec"]
1818
path = libs/shared/flagd-core/spec
1919
url = https://github.com/open-feature/spec
20-
[submodule "libs/providers/go-feature-flag-server/wasm-releases"]
21-
path = libs/providers/go-feature-flag-server/wasm-releases
20+
[submodule "libs/providers/go-feature-flag/wasm-releases"]
21+
path = libs/providers/go-feature-flag/wasm-releases
2222
url = https://github.com/go-feature-flag/wasm-releases.git

libs/providers/go-feature-flag/project.json

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,47 @@
1616
}
1717
]
1818
},
19+
"copy-wasm": {
20+
"executor": "nx:run-commands",
21+
"options": {
22+
"commands": [
23+
"git submodule update --init schemas",
24+
"cp wasm-releases/evaluation/gofeatureflag-evaluation_v1.45.6.wasm src/lib/wasm/wasm-module/gofeatureflag-evaluation.wasm"
25+
],
26+
"cwd": "libs/providers/go-feature-flag",
27+
"parallel": false
28+
}
29+
},
1930
"lint": {
2031
"executor": "@nx/eslint:lint",
21-
"outputs": ["{options.outputFile}"]
32+
"outputs": [
33+
"{options.outputFile}"
34+
]
2235
},
2336
"test": {
2437
"executor": "@nx/jest:jest",
25-
"outputs": ["{workspaceRoot}/coverage/libs/providers/go-feature-flag"],
38+
"outputs": [
39+
"{workspaceRoot}/coverage/libs/providers/go-feature-flag"
40+
],
2641
"options": {
2742
"jestConfig": "libs/providers/go-feature-flag/jest.config.ts"
28-
}
43+
},
44+
"dependsOn": [
45+
{
46+
"target": "copy-wasm"
47+
}
48+
]
2949
},
3050
"package": {
3151
"executor": "@nx/rollup:rollup",
32-
"outputs": ["{options.outputPath}"],
52+
"outputs": [
53+
"{options.outputPath}"
54+
],
55+
"dependsOn": [
56+
{
57+
"target": "copy-wasm"
58+
}
59+
],
3360
"options": {
3461
"project": "libs/providers/go-feature-flag/package.json",
3562
"outputPath": "dist/libs/providers/go-feature-flag",
@@ -39,7 +66,10 @@
3966
"generateExportsField": true,
4067
"umdName": "go-feature-flag",
4168
"external": "all",
42-
"format": ["cjs", "esm"],
69+
"format": [
70+
"cjs",
71+
"esm"
72+
],
4373
"assets": [
4474
{
4575
"glob": "package.json",
@@ -61,4 +91,4 @@
6191
}
6292
},
6393
"tags": []
64-
}
94+
}

libs/providers/go-feature-flag/src/lib/model/exporter-metadata.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ describe('ExporterMetadata', () => {
190190

191191
it('should handle complex metadata scenarios', () => {
192192
// Simulate a real-world scenario
193-
exporterMetadata.add('sdk', 'go-feature-flag-server');
193+
exporterMetadata.add('sdk', 'go-feature-flag');
194194
exporterMetadata.add('sdkVersion', '1.0.0');
195195
exporterMetadata.add('endpoint', 'http://localhost:1031');
196196
exporterMetadata.add('timeout', 5000);
@@ -200,7 +200,7 @@ describe('ExporterMetadata', () => {
200200
const result = exporterMetadata.asObject();
201201

202202
expect(result).toEqual({
203-
sdk: 'go-feature-flag-server',
203+
sdk: 'go-feature-flag',
204204
sdkVersion: '1.0.0',
205205
endpoint: 'http://localhost:1031',
206206
timeout: 5000,

libs/providers/go-feature-flag/src/lib/wasm/wasm-module/.gitkeep

Whitespace-only changes.
-858 KB
Binary file not shown.
Submodule wasm-releases added at e2e22c2

0 commit comments

Comments
 (0)