Dexie.js icon indicating copy to clipboard operation
Dexie.js copied to clipboard

dexie-export-import problem with MAX_BUFFER_LENGTH on clarinet

Open minyoung90 opened this issue 2 years ago • 5 comments

Hello, I just saw this link(https://github.com/dexie/Dexie.js/issues/902)

and there is a 10 MB limit for dexie-export-import.

What I want to do is to increase this limit up to 100MB.

So, here are my steps

  1. I just forked (https://github.com/minyoung90/clarinet) and I updated "MAX_BUFFER_LENGTH" value.
  2. Edit package.json and publish it with npm (e.g. @myc90/clarinet)
  3. And also, I forked (https://github.com/minyoung90/Dexie.js) and I updated package.json in "dexie.js/addons/dexie-export-import/"
  4. For test, I run "npm install" current working directory, but I got error message blow
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:^2.0.4 || ^3.0.0 || ^4.0.0-alpha.1
  1. So, I updated "workspace:^2.0.4" to "^2.0.4"
  2. "npm install" is fine and publish it with npm (e.g. @myc90/dexie-export-import)
  3. Finally, I chaged "dexie-export-import" to "@myc90/dexie-export-import" in my project, but I got error below
[ERROR] [plugin vite:dep-scan] Failed to resolve entry for package "@myc90/dexie-export-import". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@myc90/dexie-export-import". The package may have incorrect main/module/exports specified in its package.json.

I need help!!!

updated #1: I found In my project, In node_modules, in "@myc90/dexie-export-import" only two files exists, package.json and README.md. I think publishing @myc90/dexie-export-import is wrong. but I don't know where I start from

updated #2: I put a step below between 5 and 6, "npm install" and then "npm run build" but "npm run build" was failed. and error was...

src/json-stream.ts(1,22): error TS2307: Cannot find module 'clarinet' or its corresponding type declarations.
src/tson.ts(58,17): error TS2354: This syntax requires an imported helper but module 'tslib' cannot be found.
just-build default failed. tsc -p src returned 2
Error: just-build default failed. tsc -p src returned 2

So I checked "node_modules", There was no "@myc90/clarinet", what happened here? wrong "package.json"?

// package.json in Dexie.js/addons/dexie-export-import
{
  "name": "@myc90/dexie-export-import", // edited
  "version": "4.0.4",
  "packageManager": "^[email protected]",
  "description": "Dexie addon that adds export and import capabilities",
  "main": "dist/dexie-export-import.js",
  "module": "dist/dexie-export-import.mjs",
  "typings": "dist/dexie-export-import.d.ts",
  "repository": {
    "type": "git",
    "url": "https://github.com/dexie/Dexie.js.git"
  },
  "scripts": {
    "test": "just-build test && npx karma start test/karma.conf.js --single-run",
    "build": "just-build",
    "watch": "just-build --watch",
    "clean": "rm -rf tools/tmp dist/*.js dist/*.mjs dist/*.map dist/*.d.ts test/bundle.*"
  },
  "just-build": {
    "default": [
      "just-build src",
      "just-build test"
    ],
    "src": [
      "tsc -p src",
      "rollup -c tools/build-configs/rollup.config.js"
    ],
    "test": [
      "tsc -p test [--watch 'Watching for file changes.']",
      "rollup -c tools/build-configs/rollup.config.js",
      "rollup -c tools/build-configs/rollup.tests.config.js"
    ]
  },
  "author": "[email protected]",
  "license": "Apache-2.0",
  "devDependencies": {
    "@rollup/plugin-alias": "^3.1.2",
    "@types/node": "^13.5.1",
    "base64-arraybuffer-es6": "*",
    "clarinet": "@myc90/clarinet", // edited
    "just-build": "^0.9.24",
    "rollup-plugin-alias": "^2.2.0",
    "typeson": "^5.8.2",
    "typeson-registry": "^1.0.0-alpha.21"
  },
  "peerDependencies": {
    "dexie": "^2.0.4 || ^3.0.0 || ^4.0.0-alpha.1" // edited
  }
}

minyoung90 avatar Dec 14 '22 09:12 minyoung90

I found, in package.json "@myc90/clarinet" is wrong, it should be git repository not published name by npm. but still don't know why step 4 is wrong.

minyoung90 avatar Dec 14 '22 11:12 minyoung90

We've switched to pnpm. It supports the workspace prefix and makes it easier to work with multiple packages in the same repo. To get started with editing dexie and addons, see https://github.com/dexie/Dexie.js/blob/master/CONTRIBUTING.md

dfahlander avatar Dec 16 '22 10:12 dfahlander

@dfahlander Thanks!

minyoung90 avatar Dec 24 '22 11:12 minyoung90

Hi @dfahlander , do you have in pipe to add to dexie-export-import the clarinet max buffer lenght as parameter?

Didi3333 avatar Apr 13 '23 08:04 Didi3333

Hi @dfahlander , do you have in pipe to add to dexie-export-import the clarinet max buffer lenght as parameter?

Clarinet package does not allow passing this as an argument so it would require rewriting that package if so. Any PR for this into the clarinet fork would be welcome, along with another PR to Dexie repo for utilizing the option.

dfahlander avatar Apr 13 '23 12:04 dfahlander