|
16 | 16 | |
17 | 17 | ], |
18 | 18 | "license": "MIT", |
19 | | - "main": "./dist/bundles/meilisearch.cjs", |
20 | | - "module": "./dist/bundles/meilisearch.mjs", |
21 | | - "typings": "./dist/types/index.d.ts", |
22 | | - "types": "./dist/types/index.d.ts", |
23 | | - "jsdelivr": "./dist/bundles/meilisearch.umd.js", |
24 | | - "unpkg": "./dist/bundles/meilisearch.umd.js", |
| 19 | + "type": "module", |
| 20 | + "main": "./dist/umd/index.min.js", |
25 | 21 | "exports": { |
26 | 22 | ".": { |
27 | 23 | "types": "./dist/types/index.d.ts", |
28 | | - "browser": "./dist/bundles/meilisearch.umd.js", |
29 | | - "import": "./dist/bundles/meilisearch.mjs", |
30 | | - "require": "./dist/bundles/meilisearch.cjs", |
31 | | - "default": "./dist/bundles/meilisearch.umd.js" |
| 24 | + "import": "./dist/esm/index.js", |
| 25 | + "require": "./dist/cjs/index.cjs", |
| 26 | + "default": "./dist/umd/index.min.js" |
32 | 27 | }, |
33 | 28 | "./token": { |
34 | 29 | "types": "./dist/types/token.d.ts", |
35 | | - "import": "./dist/bundles/token.mjs", |
36 | | - "require": "./dist/bundles/token.cjs", |
37 | | - "default": "./dist/bundles/token.cjs" |
| 30 | + "import": "./dist/esm/token.js", |
| 31 | + "require": "./dist/cjs/token.cjs", |
| 32 | + "default": "./dist/cjs/token.cjs" |
38 | 33 | } |
39 | 34 | }, |
40 | 35 | "sideEffects": false, |
|
43 | 38 | "url": "https://github.com/meilisearch/meilisearch-js" |
44 | 39 | }, |
45 | 40 | "scripts": { |
46 | | - "playground:javascript": "yarn --cwd ./playgrounds/javascript && yarn --cwd ./playgrounds/javascript start", |
47 | | - "cleanup": "shx rm -rf dist/", |
48 | | - "build": "yarn cleanup && rollup -c && rollup -c --environment NODE_ENV:production", |
| 41 | + "playground:javascript": "yarn --cwd ./playgrounds/javascript && yarn --cwd ./playgrounds/javascript dev", |
49 | 42 | "build:docs": "typedoc", |
50 | | - "watch": "yarn cleanup && rollup -c --watch", |
51 | | - "postbuild": "yarn size && yarn typingsheader", |
| 43 | + "build": "vite build && tsc -p tsconfig.build.json && vite --mode production-umd build", |
| 44 | + "postbuild": "node scripts/build.js", |
52 | 45 | "test": "vitest run --coverage", |
53 | | - "types:watch": "nodemon --config nodemon.json", |
54 | | - "types": "yarn tsc", |
55 | | - "test:env:browser": "yarn build && yarn --cwd tests/env/express && yarn --cwd tests/env/express test", |
| 46 | + "types": "tsc -p tsconfig.json --noEmit", |
| 47 | + "types:watch": "yarn types --watch", |
| 48 | + "test:env:browser": "yarn build && node scripts/copy-umd-file.js --to ./tests/env/express/public && yarn --cwd tests/env/express && yarn --cwd tests/env/express test", |
56 | 49 | "test:watch": "vitest watch", |
57 | 50 | "test:coverage": "yarn test", |
58 | 51 | "test:ci": "yarn test", |
59 | 52 | "test:env": "yarn build && yarn test:env:nodejs && yarn test:env:esm && yarn test:env:node-ts", |
60 | 53 | "test:env:node-ts": "yarn --cwd tests/env/typescript-node start", |
61 | | - "test:env:nodejs": "yarn build && node tests/env/node/index.js && node tests/env/node/getting_started.js", |
| 54 | + "test:env:nodejs": "yarn build && node tests/env/node/index.cjs && node tests/env/node/getting_started.cjs", |
62 | 55 | "test:env:esm": "yarn --cwd tests/env/esm && yarn --cwd tests/env/esm start", |
63 | 56 | "test:env:nitro-app": "yarn build && yarn --cwd tests/env/nitro-app test", |
64 | | - "size": "node scripts/file-size ./dist/bundles/meilisearch.mjs ./dist/bundles/meilisearch.umd.min.js", |
65 | | - "style": "yarn fmt && yarn lint", |
66 | | - "style:fix": "yarn fmt:fix && yarn lint:fix", |
67 | 57 | "fmt": "prettier -c ./**/*.{js,ts}", |
68 | 58 | "fmt:fix": "prettier -w ./**/*.{js,ts}", |
69 | 59 | "lint": "eslint", |
70 | 60 | "lint:fix": "eslint --fix", |
71 | | - "typingsheader": "node scripts/build.js" |
| 61 | + "style": "yarn fmt && yarn lint", |
| 62 | + "style:fix": "yarn fmt:fix && yarn lint:fix" |
72 | 63 | }, |
73 | 64 | "files": [ |
74 | 65 | "src", |
|
86 | 77 | ] |
87 | 78 | }, |
88 | 79 | "devDependencies": { |
89 | | - "@rollup/plugin-terser": "^0.4.4", |
90 | | - "@babel/core": "^7.25.2", |
91 | | - "@babel/preset-env": "^7.25.4", |
92 | 80 | "@eslint/js": "^9.16.0", |
93 | | - "@rollup/plugin-babel": "^6.0.4", |
94 | | - "@rollup/plugin-commonjs": "28.0.0", |
95 | | - "@rollup/plugin-json": "^6.1.0", |
96 | | - "@rollup/plugin-node-resolve": "15.3.0", |
97 | 81 | "@types/eslint__js": "^8.42.3", |
98 | 82 | "@vitest/coverage-v8": "2.0.5", |
99 | | - "@vitest/eslint-plugin": "^1.1.4", |
100 | 83 | "@types/node": "^22.10.1", |
101 | | - "brotli-size": "^4.0.0", |
102 | 84 | "eslint": "^9.16.0", |
| 85 | + "eslint-plugin-tsdoc": "^0.4.0", |
| 86 | + "@vitest/eslint-plugin": "^1.1.23", |
103 | 87 | "eslint-config-prettier": "^9.1.0", |
104 | | - "eslint-plugin-tsdoc": "^0.3.0", |
| 88 | + "typescript": "^5.7.2", |
| 89 | + "vite": "^6.0.7", |
| 90 | + "@typescript-eslint/utils": "^8.19.0", |
105 | 91 | "globals": "^15.14.0", |
106 | | - "gzip-size": "^6.0.0", |
107 | | - "kleur": "^4.1.5", |
108 | 92 | "lint-staged": "15.3.0", |
109 | 93 | "nodemon": "^3.1.9", |
110 | 94 | "prettier": "^3.4.2", |
111 | 95 | "prettier-plugin-jsdoc": "^1.3.0", |
112 | | - "pretty-bytes": "^5.6.0", |
113 | | - "rollup": "^4.22.5", |
114 | | - "rollup-plugin-typescript2": "^0.36.0", |
115 | | - "shx": "^0.3.2", |
116 | 96 | "typedoc": "^0.27.6", |
117 | | - "typescript": "^5.4.5", |
118 | 97 | "typescript-eslint": "^8.19.0", |
119 | 98 | "vitest": "2.0.5" |
120 | 99 | }, |
|
0 commit comments