Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: protocol buffers, json schema, & types for each #22

Merged
merged 82 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
d7f1708
cleanup: remove traces of flow type generation
Nov 1, 2022
3ab644a
chore: add buf config file, observation.proto, Schema class and example
Nov 1, 2022
4db415c
feat: use hypercore in example
Nov 2, 2022
07ab19a
feat: replaced protobuf-es with ts-proto
Nov 2, 2022
35cc3a6
chore: remove protobuf-es dependency
Nov 2, 2022
5f71dd3
chore: use js, not ts
Nov 2, 2022
05a3d10
feat: add google well-known types for List,Null and Timestamp
Nov 2, 2022
77d8557
feat: first implementation of encoder + decoder of protobufs
Nov 8, 2022
63de936
feat: added types and timestamp to protobuf to indicate last modified
Nov 8, 2022
a32827c
feat: pass type as a field so we can choose appropiate schema
Nov 9, 2022
2139379
feat: decode fn now infers schema from magic byte
Nov 9, 2022
f698fe1
chore: add eslint config and standard config and plugin
Nov 9, 2022
da8e8f4
feat: pass schema version to encode through obj
Nov 9, 2022
0757f8d
feat: pass opts to decode fn to add core key and index
Nov 14, 2022
6186ad6
feat: work on decode function
Nov 15, 2022
79c4370
feat: work on encode and decode
Nov 15, 2022
a559a97
chore: add types/schema/index.js to export schemas from one file
Nov 16, 2022
53b4f04
chore: some refactor on encode fn and observation type is a literal for
Nov 16, 2022
329235c
feat: use json schemas directly
Nov 17, 2022
4111126
chore: nested messages need to additionaly have the field declare with
Nov 17, 2022
2497617
set up typedoc, revise npm scripts
sethvincent Nov 22, 2022
ee5d1d4
Merge pull request #21 from digidem/protobufsTypescript-typedoc
tomasciccola Nov 23, 2022
01a6615
added github action to build lib
Nov 23, 2022
ddc772d
chore: fix node.yml for ghaction
Nov 23, 2022
83bf283
chore: add npi ci
Nov 23, 2022
db6caeb
add buf cli
Nov 23, 2022
d8f5802
fix: node version on ghaction, maybe?
Nov 23, 2022
086ddc4
chore: test only on ubuntu linux
Nov 23, 2022
7654d22
fix: rollback testing only on ubuntu
Nov 23, 2022
05ec8ae
fix: every step must define a 'uses' or 'run' key
Nov 23, 2022
168abb4
chore: add windows and macos to please gh
Nov 23, 2022
8ba624f
feat: replace standard with prettier, lint all the files
Nov 23, 2022
4865a91
feat: add test
Nov 23, 2022
7406906
chore: allowJS on tsconfig set to false
Nov 23, 2022
f1b0e81
chore: run ghaction only on master
Nov 23, 2022
43022d7
fix: turn record id to a Buffer before encoding
Nov 28, 2022
e268f21
test: add test for correct encoding and decoding of record
Nov 28, 2022
5bddfec
chore: move index.js to top level dir
Nov 28, 2022
433a621
chore: docs and types are ignored and generated through build script
Nov 28, 2022
df53598
chore: added ts-index npm script
Nov 28, 2022
62cf7c4
feat: magicByte is represented as a number
Nov 29, 2022
32c4053
test: add more comparisons
Nov 30, 2022
ba2b0c2
chore: use google's implementation of Value and Struct types in
Dec 1, 2022
b3d249d
chore: magicByte -> blockPrefix
Dec 1, 2022
be7c780
feat: add b4a for consistency and use 4-byte string for record
Dec 6, 2022
049fd23
feat: validate as a separate exported fn
Dec 14, 2022
09f9377
feat: remove jsonSchema and replace with validate fn directly
Dec 14, 2022
9fe7dfe
feat: index record schemas using blockPrefix (${dataTypeId}/${version})
Dec 21, 2022
0263246
feat: added jsons for testing
Jan 2, 2023
bd43eb3
chore: fix tsc-index script
Jan 2, 2023
6e0f4f2
feat: add scripts/genSchema.js to generate standalone validation fns for
Jan 16, 2023
cfd38a7
feat: add schemasPrefix export to code generation and update schemas $id
Jan 16, 2023
5d6fb12
chore: add dist/ to .gitignore
Jan 16, 2023
bbf82e8
feat: add generation of index.js for protobuf schemas
Jan 17, 2023
5835a4f
feat: generate file with the schemasPrefix as an object {schemaVersion,
Jan 17, 2023
55c86dd
feat:
Jan 17, 2023
22d864a
feat: generate union type for jsonschemas and npm script for code
Jan 17, 2023
c00816a
feat: trying stuff
Jan 19, 2023
b79cbb6
chore: move json schema to versioned directories
Jan 19, 2023
ff5b047
feat:
Jan 23, 2023
1cf4469
chore: better json2ts script to handle nested files
Jan 23, 2023
45f085c
feat:
Jan 23, 2023
f4f9ec5
feat: generate types/proto/index.d.ts and work on decode fn
Jan 24, 2023
b91f05f
feat: handle schemaVersion as uint16 and add schemasPrefix.js file
Jan 25, 2023
b528980
chore: delete common/v2.json
Jan 25, 2023
af4a705
feat: fixed most of the tests
Jan 25, 2023
0d60505
feat: add schema/preset/ and base intersection on MapeoRecord
Jan 26, 2023
8f7401e
chore: type errors no more??
Jan 26, 2023
5e81c48
chore: solved runtime error (bad destructuring). Still some type errors
Jan 26, 2023
b0cf73d
feat: turned the ProtobufSchemas types to an intersection
Jan 26, 2023
ab27d3b
fix: delete additional field common on protoToJsonSchema
Jan 26, 2023
7dc4bd9
feat: added schema/filter/v1.json
Jan 26, 2023
9f04de6
feat: fix some errors on scripts/generate.js
Feb 7, 2023
903cad6
feat: check if common is undefined on protoToJsonSchema
Feb 8, 2023
80235ef
feat: turn hex string to buffer explicitly on jsonSchemaToProto
Feb 8, 2023
c195183
test: replace deepEqual comparison with field existence comparison
Feb 8, 2023
44572a9
chore: fix test which was failing on first pass after build
Feb 8, 2023
7be2395
test: check not only existense of field, but equality of value if not an
Feb 8, 2023
ba808ab
feat: add prepare script
Feb 9, 2023
ebe5306
allow lowercase type name in documents
sethvincent Feb 9, 2023
45d6be1
Merge pull request #29 from digidem/lowercase-type
sethvincent Feb 9, 2023
319f1ed
fix tests
sethvincent Feb 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"env": {
"commonjs": true,
"es2021": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"prettier/prettier": "error"
},
"plugins": ["prettier"]
}
13 changes: 0 additions & 13 deletions .flowconfig

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Node.js CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
node-version:
- '16.x'
- '18.x'
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install buf cli
uses: bufbuild/buf-setup-action@v1.9.0
- run: buf --version
- run: npm ci
- run: npm run build --if-present
- run: npm run test
13 changes: 5 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/
types/*
*.d.ts

# typedoc documentation
docs/*

# Optional npm cache directory
.npm
Expand All @@ -56,10 +60,3 @@ typings/

# dotenv environment variables file
.env

# next.js build output
.next

/*.js
/index.js.flow
/test/valid_flow/generated.js.flow
11 changes: 11 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: v1
plugins:
- name: ts
out: types/proto
strategy: all
path: node_modules/ts-proto/protoc-gen-ts_proto
opt:
- esModuleInterop=true
- snakeToCamel=false
- importSuffix=.js
- initializeFieldsAsUndefined=false
7 changes: 0 additions & 7 deletions docs/README.md

This file was deleted.

90 changes: 0 additions & 90 deletions docs/common.md

This file was deleted.

Loading