Skip to content

Commit ecfb85f

Browse files
committed
yamlize
1 parent 38be1c4 commit ecfb85f

File tree

7 files changed

+81
-9
lines changed

7 files changed

+81
-9
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build Wasm 🛠
2+
'on':
3+
workflow_dispatch: null
4+
jobs:
5+
build-wasm:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout Repository 📥
9+
uses: actions/checkout@v4
10+
- name: Setup Node.js 🌐
11+
uses: actions/setup-node@v4
12+
with:
13+
node-version: 20.x
14+
cache: yarn
15+
- name: Install and Build 🚀
16+
run: |
17+
yarn
18+
- name: Install Emscripten ✍🏻
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install cmake python3 python3-pip
22+
git clone --branch 3.1.59 --depth 1 https://github.com/emscripten-core/emsdk.git
23+
cd emsdk
24+
./emsdk install 3.1.59
25+
./emsdk activate 3.1.59
26+
source ./emsdk_env.sh
27+
- name: Build with Emscripten 🏗
28+
run: |
29+
source ./emsdk/emsdk_env.sh
30+
emmake make
31+
emmake make build
32+
- name: Archive production artifacts 🏛
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: wasm-artifacts
36+
path: wasm

.yamlize/config/config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
git:
2-
USER_NAME: Cosmology
3-
USER_EMAIL: developers@cosmology.zone
2+
USER_NAME: Hyperweb
3+
USER_EMAIL: developers@hyperweb.io
44
EMSCRIPTEN_VERSION: '3.1.59'
55
NODE_VERSION: '20.x'

.yamlize/workflows/build.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: Build Wasm 🛠
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-wasm:
8+
import-yaml: yaml/build-wasm.yaml

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# 17.2.1
2-
* Remove proto.js dependency (5.4MB bundle size reduction)
32
* Add normalize() and normalizeSync() functions for SQL normalization
43
* Add parseQueryDetailed() and parseQueryDetailedSync() with enhanced error reporting
54
* Add fingerprint() and fingerprintSync() functions for query fingerprinting

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"files": [
1212
"wasm/*",
1313
"libpg_query/*",
14-
"script/*"
14+
"script/*",
15+
"proto.js"
1516
],
1617
"exports": {
1718
".": {
@@ -28,7 +29,9 @@
2829
"wasm:rebuild": "yarn wasm:make rebuild",
2930
"wasm:clean": "yarn wasm:make clean",
3031
"wasm:clean-cache": "yarn wasm:make clean-cache",
31-
"test": "mocha test/*.test.js --timeout 5000"
32+
"test": "mocha test/*.test.js --timeout 5000",
33+
"yamlize": "node ./scripts/yamlize.js",
34+
"protogen": "node ./scripts/protogen.js"
3235
},
3336
"author": "Dan Lynch <[email protected]> (http://github.com/pyramation)",
3437
"license": "LICENSE IN LICENSE",
@@ -44,7 +47,8 @@
4447
"rimraf": "5.0.0"
4548
},
4649
"dependencies": {
47-
"@pgsql/types": "^17.0.0"
50+
"@pgsql/types": "^17.0.0",
51+
"@launchql/protobufjs": "7.2.6"
4852
},
4953
"keywords": [
5054
"sql",

proto.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10852,7 +10852,7 @@
1085210852
return object;
1085310853
var message = new $root.pg_query.String();
1085410854
if (object.sval != null)
10855-
message.sval = String(object.sval);
10855+
message.sval = object.sval;
1085610856
return message;
1085710857
};
1085810858

@@ -11055,7 +11055,7 @@
1105511055
return object;
1105611056
var message = new $root.pg_query.BitString();
1105711057
if (object.bsval != null)
11058-
message.bsval = String(object.bsval);
11058+
message.bsval = object.bsval;
1105911059
return message;
1106011060
};
1106111061

@@ -113069,4 +113069,4 @@
113069113069
})();
113070113070

113071113071
return $root;
113072-
});
113072+
});

scripts/yamlize.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const { exec } = require('child_process');
2+
const { join } = require('path');
3+
4+
const yamldir = (s) => join(__dirname, '/../.yamlize/', s);
5+
const workflowDir = (s) => join(__dirname, '/../.github/workflows/', s);
6+
7+
const cmd = () => ([
8+
'yamlize',
9+
'--config',
10+
yamldir(`config/config.yaml`),
11+
12+
'--inFile',
13+
yamldir(`workflows/build.yaml`),
14+
15+
'--outFile',
16+
workflowDir(`build-wasm-no-docker.yaml`),
17+
].join(' '));
18+
19+
20+
exec(cmd(), (error, _stdout, _stderr) => {
21+
if (error) {
22+
console.error(`Error: ${error.message}`);
23+
return;
24+
}
25+
});

0 commit comments

Comments
 (0)