Skip to content

Commit

Permalink
Merge branch 'main' into feat/namespace-sync-state
Browse files Browse the repository at this point in the history
* main:
  chore: remove ipc wrapper implementation (#306)
  fix: fix DataType.getByDocId implementation to match type definition (#317)
  chore: Add CI release workflow (#300)
  Feat: Icon data type (#304)
  chore: emit peer-have messages, don't persist them (#310)
  • Loading branch information
gmaclennan committed Oct 5, 2023
2 parents 5fe8791 + 1e4f03b commit c01d160
Show file tree
Hide file tree
Showing 16 changed files with 200 additions and 517 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: release

on:
workflow_dispatch:
inputs:
semver:
description: 'The semver to use'
required: true
default: 'prerelease'
type: choice
options:
# - auto
# - patch
# - minor
# - major
- prerelease
# - prepatch
# - preminor
# - premajor
pull_request:
types: [closed]

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- uses: nearform-actions/optic-release-automation-action@v4
with:
commit-message: 'Release {version}'
sync-semver-tags: true
access: 'public'
# This prefix is added before the prerelease number, e.g. `v3.0.0-alpha.0`
prerelease-prefix: 'alpha'
semver: ${{ github.event.inputs.semver }}
# Prereleases are published under the `alpha` npm dist-tag
npm-tag: ${{ startsWith(github.event.inputs.semver, 'pre') && 'alpha' || 'latest' }}
# Don't notify linked issues
notify-linked-issues: false
# optional: set this secret in your repo config for publishing to NPM
npm-token: ${{ secrets.NPM_TOKEN }}
build-command: |
npm install
npm run build
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,24 @@ CREATE TABLE `field` (
`forks` text NOT NULL
);
--> statement-breakpoint
CREATE TABLE `icon_backlink` (
`versionId` text PRIMARY KEY NOT NULL
);
--> statement-breakpoint
CREATE TABLE `icon` (
`docId` text PRIMARY KEY NOT NULL,
`versionId` text NOT NULL,
`schemaName` text NOT NULL,
`createdAt` text NOT NULL,
`createdBy` text NOT NULL,
`updatedAt` text NOT NULL,
`links` text NOT NULL,
`deleted` integer NOT NULL,
`name` text NOT NULL,
`variants` text NOT NULL,
`forks` text NOT NULL
);
--> statement-breakpoint
CREATE TABLE `observation_backlink` (
`versionId` text PRIMARY KEY NOT NULL
);
Expand Down
106 changes: 104 additions & 2 deletions drizzle/project/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "5",
"dialect": "sqlite",
"id": "ee8a89aa-fd1d-47d8-88db-86f467de1c18",
"id": "b8724f08-6f32-43e1-8fca-f8395a30f19d",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"coreOwnership_backlink": {
Expand Down Expand Up @@ -373,6 +373,108 @@
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"icon_backlink": {
"name": "icon_backlink",
"columns": {
"versionId": {
"name": "versionId",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"icon": {
"name": "icon",
"columns": {
"docId": {
"name": "docId",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"versionId": {
"name": "versionId",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"schemaName": {
"name": "schemaName",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdAt": {
"name": "createdAt",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdBy": {
"name": "createdBy",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updatedAt": {
"name": "updatedAt",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"links": {
"name": "links",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"deleted": {
"name": "deleted",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"variants": {
"name": "variants",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"forks": {
"name": "forks",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"observation_backlink": {
"name": "observation_backlink",
"columns": {
Expand Down Expand Up @@ -756,4 +858,4 @@
"tables": {},
"columns": {}
}
}
}
6 changes: 3 additions & 3 deletions drizzle/project/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
{
"idx": 0,
"version": "5",
"when": 1695927172554,
"tag": "0000_brown_living_mummy",
"when": 1696355460625,
"tag": "0000_faithful_mister_fear",
"breakpoints": true
}
]
}
}
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"@fastify/type-provider-typebox": "^3.3.0",
"@hyperswarm/secret-stream": "^6.1.2",
"@mapeo/crypto": "^1.0.0-alpha.8",
"@mapeo/schema": "^3.0.0-next.10",
"@mapeo/schema": "^3.0.0-next.11",
"@mapeo/sqlite-indexer": "^1.0.0-alpha.6",
"@sinclair/typebox": "^0.29.6",
"b4a": "^1.6.3",
Expand Down Expand Up @@ -131,7 +131,6 @@
"protobufjs": "^7.2.3",
"protomux": "^3.4.1",
"quickbit-universal": "^2.2.0",
"rpc-reflector": "^1.3.11",
"sodium-universal": "^4.0.0",
"start-stop-state-machine": "^1.2.0",
"sub-encoder": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/datastore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { discoveryKey } from 'hypercore-crypto'

const NAMESPACE_SCHEMAS = /** @type {const} */ ({
data: ['observation'],
config: ['preset', 'field', 'projectSettings', 'deviceInfo'],
config: ['preset', 'field', 'projectSettings', 'deviceInfo', 'icon'],
auth: ['coreOwnership', 'role'],
})

Expand Down
3 changes: 2 additions & 1 deletion src/datatype/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ export class DataType {
*/
async getByDocId(docId) {
const result = this.#sql.getByDocId.get({ docId })
return result ? deNullify(result) : result
if (!result) throw new Error('Not found')
return deNullify(result)
}

/** @param {string} versionId */
Expand Down
96 changes: 0 additions & 96 deletions src/ipc-wrapper/client.js

This file was deleted.

Loading

0 comments on commit c01d160

Please sign in to comment.