From c3a773f23d2f3b6ad8d8c64a66952e2573ccb7ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lef=C3=A8vre?= Date: Wed, 8 Mar 2023 14:37:19 +0000 Subject: [PATCH] [FIX] package: correctly name package entry files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Files are named o-spreadsheet[...] in package.json but rollup generates o_spreadsheet[...] files as a result any import fails because it's looking for a file that doesn't exist `import { Model } from @odoo/o-spreadsheet` => Error: Cannot find module '/home/odoo/odoo/upgrade-spreadsheet-data/node_modules/@odoo/o-spreadsheet/dist/o-spreadsheet.cjs.js'. Please verify that the package.json has a valid "main" entry closes odoo/o-spreadsheet#2194 X-original-commit: ebc1eedcfd086261d67fb40536db405b2d00db05 Signed-off-by: Rémi Rahir (rar) Signed-off-by: Lucas Lefèvre (lul) --- package.json | 2 +- rollup.config.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 3fcf400833..f7a6119bc5 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "dist/o-spreadsheet.cjs.js", "browser": "dist/o-spreadsheet.iife.js", "module": "dist/o-spreadsheet.es.js", - "types": "dist/o_spreadsheet.d.ts", + "types": "dist/o-spreadsheet.d.ts", "files": [ "dist/*.js", "dist/*.d.ts" diff --git a/rollup.config.js b/rollup.config.js index 82d7e137e3..c31019f583 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -25,7 +25,7 @@ __info__.hash = '${commitHash}'; */ function getConfigForFormat(format, minified = false) { return { - file: minified ? `dist/o_spreadsheet.${format}.min.js` : `dist/o_spreadsheet.${format}.js`, + file: minified ? `dist/o-spreadsheet.${format}.min.js` : `dist/o-spreadsheet.${format}.js`, format, name: "o_spreadsheet", extend: true, @@ -78,7 +78,7 @@ export default (commandLineArgs) => { }, { input: "dist/types/index.d.ts", - output: [{ file: "dist/o_spreadsheet.d.ts", format: "es" }], + output: [{ file: "dist/o-spreadsheet.d.ts", format: "es" }], plugins: [dts(), nodeResolve()], }, ];