Skip to content

ci: merge staging to master #64

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

Merged
merged 14 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 16 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@
"no-constant-condition": 0,
"no-useless-escape": 0,
"no-console": "error",
"no-restricted-globals": [
"error",
{
"name": "global",
"message": "Use `globalThis` instead"
},
{
"name": "window",
"message": "Use `globalThis` instead"
}
],
"require-yield": 0,
"eqeqeq": ["error", "smart"],
"spaced-comment": [
Expand All @@ -39,7 +50,8 @@
},
"block": {
"exceptions": ["*"]
}
},
"markers": ["/"]
}
],
"capitalized-comments": [
Expand Down Expand Up @@ -80,7 +92,8 @@
],
"pathGroupsExcludedImportTypes": [
"type"
]
],
"newlines-between": "never"
}
],
"@typescript-eslint/no-namespace": 0,
Expand All @@ -102,7 +115,7 @@
"@typescript-eslint/consistent-type-imports": ["error"],
"@typescript-eslint/consistent-type-exports": ["error"],
"no-throw-literal": "off",
"@typescript-eslint/no-throw-literal": ["error"],
"@typescript-eslint/no-throw-literal": "off",
"@typescript-eslint/no-floating-promises": ["error", {
"ignoreVoid": true,
"ignoreIIFE": true
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/codesee-arch-diagram.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# This workflow was added by CodeSee. Learn more at https://codesee.io/
# This is v2.0 of this workflow file
on:
push:
branches:
- master
- staging
pull_request_target:
types: [opened, synchronize, reopened]

Expand All @@ -18,3 +20,4 @@ jobs:
- uses: Codesee-io/codesee-action@v2
with:
codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
codesee-url: https://app.codesee.io
11 changes: 7 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ build:windows:
- ./scripts/choco-install.ps1
- refreshenv
- npm install --ignore-scripts
- $env:Path = "$(npm bin);" + $env:Path
- $env:Path = "$(npm root)\.bin;" + $env:Path
- npm run prebuild --verbose
- npm test -- --ci --coverage
- npm run bench
Expand All @@ -209,8 +209,8 @@ build:macos:
stage: build
needs: []
tags:
- shared-macos-amd64
image: macos-11-xcode-12
- saas-macos-medium-m1
image: macos-12-xcode-14
variables:
# Location node-gyp installed headers and static libraries
npm_config_devdir: "${CI_PROJECT_DIR}/tmp/node-gyp"
Expand All @@ -221,9 +221,12 @@ build:macos:
- ./scripts/brew-install.sh
- hash -r
- npm install --ignore-scripts
- export PATH="$(npm bin):$PATH"
- export PATH="$(npm root)/.bin:$PATH"
- npm run prebuild --verbose
- npm test -- --ci --coverage
# Temporary fix for m1 mac runners: https://github.com/MatrixAI/js-db/pull/64#issuecomment-1607109864
# Remove when upstream has fixed and you have updated `systeminformation` package
- patch ./benches/index.ts < ./scripts/systeminformation-cpu.patch
- npm run bench
artifacts:
when: always
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ async function main () {
const encrypt = async (
key: ArrayBuffer,
plainText: ArrayBuffer
): Promise<ArrayBuffer> {
): Promise<ArrayBuffer> => {
return plainText;
};

const decrypt = async (
key: ArrayBuffer,
cipherText: ArrayBuffer
): Promise<ArrayBuffer | undefined> {
): Promise<ArrayBuffer | undefined> => {
return cipherText;
}

Expand All @@ -63,9 +63,11 @@ async function main () {

await db.del(['level', Buffer.from([0x30, 0x32]), 'c']);

for await (const [kP, v] of db.iterator({
lt: [Buffer.from([0x30, 0x32]), ''],
}, ['level'])) {
for await (const [kP, v] of db.iterator(
['level'],
{
lt: [Buffer.from([0x30, 0x32]), ''],
})) {
console.log(kP, v);
}

Expand All @@ -79,6 +81,8 @@ If you created the `DB` with a `crypto` object, then upon restarting the `DB`, y

## Development

This project uses Git submodules to bring in rocksdb. **Make sure to clone recursively.**

Run `nix-shell`, and once you're inside, you can use:

```sh
Expand Down
14 changes: 7 additions & 7 deletions benches/results/db_1KiB.chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</head>
<body>
<div class="container">
<canvas id="chart1658405673774" width="16" height="9"></canvas>
<canvas id="chart1687684087088" width="16" height="9"></canvas>
</div>
<script>
const format = (num) => {
Expand All @@ -51,18 +51,18 @@
chunked.map((chunk) => chunk.join('')).join(' ') + fractionStr
)
}
const ctx1658405673774 = document
.getElementById('chart1658405673774')
const ctx1687684087088 = document
.getElementById('chart1687684087088')
.getContext('2d')
const chart1658405673774 = new Chart(ctx1658405673774, {
const chart1687684087088 = new Chart(ctx1687684087088, {
type: 'bar',
data: {
labels: ["get 1 KiB of data","put 1 KiB of data","put zero data","put zero data then del"],
datasets: [
{
data: [48563,39043,40984,21108],
backgroundColor: ["hsl(120, 85%, 55%)","hsl(96.48, 85%, 55%)","hsl(101.268, 85%, 55%)","hsl(52.163999999999994, 85%, 55%)"],
borderColor: ["hsl(120, 85%, 55%)","hsl(96.48, 85%, 55%)","hsl(101.268, 85%, 55%)","hsl(52.163999999999994, 85%, 55%)"],
data: [47519,32985,35687,17917],
backgroundColor: ["hsl(120, 85%, 55%)","hsl(83.29199999999999, 85%, 55%)","hsl(90.11999999999999, 85%, 55%)","hsl(45.24, 85%, 55%)"],
borderColor: ["hsl(120, 85%, 55%)","hsl(83.29199999999999, 85%, 55%)","hsl(90.11999999999999, 85%, 55%)","hsl(45.24, 85%, 55%)"],
borderWidth: 2,
},
],
Expand Down
Loading