From e115ceb556ac38b0e0cadc11a81dc9e452bfbb99 Mon Sep 17 00:00:00 2001 From: 0xZensh Date: Sun, 23 Jul 2023 20:41:28 +0800 Subject: [PATCH] Use cborg instead of cbor-x. --- package.json | 4 +-- pnpm-lock.yaml | 83 ++++--------------------------------------------- src/app.ts | 2 +- src/db/model.ts | 2 +- 4 files changed, 10 insertions(+), 81 deletions(-) diff --git a/package.json b/package.json index e64eff2..f81353c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webscraper", - "version": "0.4.1", + "version": "0.4.2", "description": "", "private": true, "main": "dist/main.js", @@ -70,7 +70,7 @@ "@tiptap/pm": "2.1.0-rc.12", "@yiwen-ai/zeed-dom": "^0.10.6", "cassandra-driver": "^4.6.4", - "cbor-x": "^1.5.3", + "cborg": "^2.0.3", "cheerio": "1.0.0-rc.12", "config": "^3.3.9", "crawlee": "^3.4.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ee4323..f0b95ea 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -137,9 +137,9 @@ dependencies: cassandra-driver: specifier: ^4.6.4 version: 4.6.4 - cbor-x: - specifier: ^1.5.3 - version: 1.5.3 + cborg: + specifier: ^2.0.3 + version: 2.0.3 cheerio: specifier: 1.0.0-rc.12 version: 1.0.0-rc.12 @@ -514,54 +514,6 @@ packages: to-fast-properties: 2.0.0 dev: false - /@cbor-extract/cbor-extract-darwin-arm64@2.1.1: - resolution: {integrity: sha512-blVBy5MXz6m36Vx0DfLd7PChOQKEs8lK2bD1WJn/vVgG4FXZiZmZb2GECHFvVPA5T7OnODd9xZiL3nMCv6QUhA==} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - /@cbor-extract/cbor-extract-darwin-x64@2.1.1: - resolution: {integrity: sha512-h6KFOzqk8jXTvkOftyRIWGrd7sKQzQv2jVdTL9nKSf3D2drCvQB/LHUxAOpPXo3pv2clDtKs3xnHalpEh3rDsw==} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - /@cbor-extract/cbor-extract-linux-arm64@2.1.1: - resolution: {integrity: sha512-SxAaRcYf8S0QHaMc7gvRSiTSr7nUYMqbUdErBEu+HYA4Q6UNydx1VwFE68hGcp1qvxcy9yT5U7gA+a5XikfwSQ==} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@cbor-extract/cbor-extract-linux-arm@2.1.1: - resolution: {integrity: sha512-ds0uikdcIGUjPyraV4oJqyVE5gl/qYBpa/Wnh6l6xLE2lj/hwnjT2XcZCChdXwW/YFZ1LUHs6waoYN8PmK0nKQ==} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@cbor-extract/cbor-extract-linux-x64@2.1.1: - resolution: {integrity: sha512-GVK+8fNIE9lJQHAlhOROYiI0Yd4bAZ4u++C2ZjlkS3YmO6hi+FUxe6Dqm+OKWTcMpL/l71N6CQAmaRcb4zyJuA==} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@cbor-extract/cbor-extract-win32-x64@2.1.1: - resolution: {integrity: sha512-2Niq1C41dCRIDeD8LddiH+mxGlO7HJ612Ll3D/E73ZWBmycued+8ghTr/Ho3CMOWPUEr08XtyBMVXAjqF+TcKw==} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: false - optional: true - /@crawlee/basic@3.4.1: resolution: {integrity: sha512-dVDFe+SpWgWrFPHdDB5IjXjG4XlgnXqb63cZvNxGDV+C7ROXe1QBN3s1OxB+hE3FETAAvQ2QR0NrnVbMwnuNHw==} engines: {node: '>=16.0.0'} @@ -2210,26 +2162,9 @@ packages: long: 2.4.0 dev: false - /cbor-extract@2.1.1: - resolution: {integrity: sha512-1UX977+L+zOJHsp0mWFG13GLwO6ucKgSmSW6JTl8B9GUvACvHeIVpFqhU92299Z6PfD09aTXDell5p+lp1rUFA==} + /cborg@2.0.3: + resolution: {integrity: sha512-f1IbyqgRLQK4ruNM+V3WikfYfXQg/f/zC1oneOw1P7F/Dn2OJX6MaXIdei3JMpz361IjY7OENBKcE53nkJFVCQ==} hasBin: true - requiresBuild: true - dependencies: - node-gyp-build-optional-packages: 5.0.3 - optionalDependencies: - '@cbor-extract/cbor-extract-darwin-arm64': 2.1.1 - '@cbor-extract/cbor-extract-darwin-x64': 2.1.1 - '@cbor-extract/cbor-extract-linux-arm': 2.1.1 - '@cbor-extract/cbor-extract-linux-arm64': 2.1.1 - '@cbor-extract/cbor-extract-linux-x64': 2.1.1 - '@cbor-extract/cbor-extract-win32-x64': 2.1.1 - dev: false - optional: true - - /cbor-x@1.5.3: - resolution: {integrity: sha512-adrN0S67C7jY2hgqeGcw+Uj6iEGLQa5D/p6/9YNl5AaVIYJaJz/bARfWsP8UikBZWbhS27LN0DJK4531vo9ODw==} - optionalDependencies: - cbor-extract: 2.1.1 dev: false /chalk@1.1.3: @@ -3890,12 +3825,6 @@ packages: engines: {node: '>= 0.6'} dev: false - /node-gyp-build-optional-packages@5.0.3: - resolution: {integrity: sha512-k75jcVzk5wnnc/FMxsf4udAoTEUv2jY3ycfdSd3yWu6Cnd1oee6/CfZJApyscA4FJOmdoixWwiwOyf16RzD5JA==} - hasBin: true - dev: false - optional: true - /node-releases@2.0.13: resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} dev: false diff --git a/src/app.ts b/src/app.ts index bf10f28..bda043b 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,7 +1,7 @@ import { gzipSync } from 'node:zlib' import type Koa from 'koa' import Router from '@koa/router' -import { encode } from 'cbor-x' +import { encode } from 'cborg' import { LogLevel, createLog, writeLog } from './log.js' import { connect } from './db/scylladb.js' diff --git a/src/db/model.ts b/src/db/model.ts index 62bbb26..385bc0f 100644 --- a/src/db/model.ts +++ b/src/db/model.ts @@ -1,7 +1,7 @@ import { Buffer } from 'node:buffer' import createError from 'http-errors' import { type Client } from 'cassandra-driver' -import { encode } from 'cbor-x' +import { encode } from 'cborg' import { Xid } from 'xid-ts' const MAX_CELL_SIZE = 1024 * 1024 - 1 // 1MB