diff --git a/.config/babel/add-import-extension.js b/.config/babel/add-import-extension.js new file mode 100644 index 000000000..81231b760 --- /dev/null +++ b/.config/babel/add-import-extension.js @@ -0,0 +1,90 @@ +// Based on https://github.com/handsontable/handsontable/blob/bd7628544ff83d6e74a9cc949e2c3c38fef74d76/handsontable/.config/plugin/babel/add-import-extension.js + +const { existsSync, lstatSync } = require('fs'); +const { dirname, resolve } = require('path'); +const { types } = require('@babel/core'); +const { declare } = require('@babel/helper-plugin-utils'); + +const VALID_EXTENSIONS = ['js', 'mjs']; + +const hasExtension = moduleName => VALID_EXTENSIONS.some(ext => moduleName.endsWith(`.${ext}`)); +const isCoreJSPolyfill = moduleName => moduleName.startsWith('core-js'); +const isLocalModule = moduleName => moduleName.startsWith('.'); +const isProcessableModule = (moduleName) => { + return !hasExtension(moduleName) && (isCoreJSPolyfill(moduleName) || isLocalModule(moduleName)); +}; + +const createVisitor = ({ declaration, origArgs, extension = 'js' }) => { + return (path, { file }) => { + const { node: { source, exportKind, importKind } } = path; + const { opts: { filename } } = file; + const isTypeOnly = exportKind === 'type' || importKind === 'type'; + + if (!source || isTypeOnly || !isProcessableModule(source.value)) { + return; + } + + const { value: moduleName } = source; + const absoluteFilePath = resolve(dirname(filename), moduleName); + const finalExtension = isCoreJSPolyfill(moduleName) ? 'js' : extension; + + let newModulePath; + + // Resolves a case where "import" points to a module name which exists as a file and + // as a directory. For example in this case: + // ``` + // import { registerPlugin } from 'plugins'; + // ``` + // and with this directory structure: + // |- editors + // |- plugins + // |- filters/ + // |- ... + // +- index.js + // |- plugins.js + // |- ... + // +- index.js + // + // the plugin will rename import declaration to point to the `plugins.js` file. + if (existsSync(`${absoluteFilePath}.js`)) { + newModulePath = `${moduleName}.${finalExtension}`; + + // In a case when the file doesn't exist and the module is a directory it will + // rename to `plugins/index.js`. + } else if (existsSync(absoluteFilePath) && lstatSync(absoluteFilePath).isDirectory()) { + newModulePath = `${moduleName}/index.${finalExtension}`; + + // And for other cases it simply put the extension on the end of the module path + } else { + newModulePath = `${moduleName}.${finalExtension}`; + } + + path.replaceWith(declaration(...origArgs(path), types.stringLiteral(newModulePath))); + }; +}; + +module.exports = declare((api, options) => { + api.assertVersion(7); + + return { + name: 'add-import-extension', + visitor: { + // It covers default and named imports + ImportDeclaration: createVisitor({ + extension: options.extension, + declaration: types.importDeclaration, + origArgs: ({ node: { specifiers } }) => [specifiers], + }), + ExportNamedDeclaration: createVisitor({ + extension: options.extension, + declaration: types.exportNamedDeclaration, + origArgs: ({ node: { declaration, specifiers } }) => [declaration, specifiers], + }), + ExportAllDeclaration: createVisitor({ + extension: options.extension, + declaration: types.exportAllDeclaration, + origArgs: () => [], + }), + } + }; +}); diff --git a/CHANGELOG.md b/CHANGELOG.md index bcdb28542..e7ebe4b48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Changed +- **Breaking change**: Change ES module build to use `mjs` files and `exports` property in `package.json` to make importing language files possible in Node environment. [#1344](https://github.com/handsontable/hyperformula/issues/1344) - **Breaking change**: Removed the `binarySearchThreshold` configuration option. [#1439](https://github.com/handsontable/hyperformula/issues/1439) ## [2.7.1] - 2024-07-18 diff --git a/babel.config.js b/babel.config.js index e7a33d37d..a0e3a5667 100644 --- a/babel.config.js +++ b/babel.config.js @@ -31,7 +31,9 @@ module.exports = { }, // Environment for transpiling files to be compatible with ES Modules. es: { - plugins: [], + plugins: [ + ['./.config/babel/add-import-extension.js', { extension: 'mjs' }], + ], }, }, }; diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 599773844..c88f9b5ac 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -265,7 +265,8 @@ module.exports = { children: [ ['/guide/release-notes', 'Release notes'], ['/guide/migration-from-0.6-to-1.0', 'Migrating from 0.6 to 1.0'], - ['/guide/migration-from-1.0-to-2.0', 'Migrating from 1.x to 2.0'], + ['/guide/migration-from-1.x-to-2.0', 'Migrating from 1.x to 2.0'], + ['/guide/migration-from-2.x-to-3.0', 'Migrating from 2.x to 3.0'], ] }, { diff --git a/docs/guide/localizing-functions.md b/docs/guide/localizing-functions.md index 4622b6c9c..b51f41d8e 100644 --- a/docs/guide/localizing-functions.md +++ b/docs/guide/localizing-functions.md @@ -9,7 +9,7 @@ register the language like so: ```javascript // import the French language pack -import frFR from 'hyperformula/es/i18n/languages/frFR'; +import frFR from 'hyperformula/i18n/languages/frFR'; // register the language HyperFormula.registerLanguage('frFR', frFR); @@ -17,8 +17,8 @@ HyperFormula.registerLanguage('frFR', frFR); ::: tip To import the language packs, use the module-system-specific dedicated bundles at: -* **ES**: `hyperformula/es/i18n/languages/` -* **CommonJS**: `hyperformula/commonjs/i18n/languages/` +* **ES**: `hyperformula/i18n/languages/` +* **CommonJS**: `hyperformula/i18n/languages/` * **UMD**: `hyperformula/dist/languages/` For the UMD build, the languages are accessible through `HyperFormula.languages`, e.g., `HyperFormula.languages.frFR`. diff --git a/docs/guide/migration-from-1.0-to-2.0.md b/docs/guide/migration-from-1.x-to-2.0.md similarity index 100% rename from docs/guide/migration-from-1.0-to-2.0.md rename to docs/guide/migration-from-1.x-to-2.0.md diff --git a/docs/guide/migration-from-2.x-to-3.0.md b/docs/guide/migration-from-2.x-to-3.0.md index 8e151d176..f92638add 100644 --- a/docs/guide/migration-from-2.x-to-3.0.md +++ b/docs/guide/migration-from-2.x-to-3.0.md @@ -2,6 +2,84 @@ To upgrade your HyperFormula version from 2.x.x to 3.0.0, follow this guide. +## Importing language files + +We changed the way of importing language files in ES module system to a more modern way using `mjs` files and `exports` property. This change is required to make HyperFormula compatible with newer ESM configurations in Node and browser environments. + +The previous import paths became deprecated. For most environments they still work in version 3.0.0, but it will be removed in the future. To avoid any issues, update your code to use the new paths. + +### New import paths for ES and CommonJS module systems + +For ES and CommonJS modules, use the path `hyperformula/i18n/languages`, to import the language files. E.g.: + +```javascript +import { frFR } from "hyperformula/i18n/languages"; // ESM + +const { frFR } = require('hyperformula/i18n/languages'); // CommonJS +``` +If you use the UMD module system, you don't need to change anything. + +### Additional steps for projects using Angular + +1. Make sure you use Typescript 5 or newer +2. In your `tsconfig.json`, set: + +``` +"moduleResolution": "bundler", +``` + +### Additional steps for projects using Typescript + +In your `tsconfig.json`, set: + +``` +"module": "node16", +"moduleResolution": "node16", +``` + +### Additional steps for projects using Webpack 4 or older + +1. In your code, use the legacy paths for importing language files. Unfortunately, Webpack 4 does not support `exports` property. E.g.: + +```javascript +import { frFR } from "hyperformula/es/i18n/languages"; +``` + +2. In your `webpack.config.js`, add the following configuration to handle `.mjs` files properly: + +```javascript +module: { + rules: [ + { + test: /\.m?js$/, + include: /node_modules/, + type: "javascript/auto", + }, + ], +} +``` + +### Additional steps for projects using Parcel + +1. Make sure you use Parcel 2.9 or newer. Older versions of Parcel do not support `exports` property. +2. In your `package.json`, add the [following configuration](https://parceljs.org/blog/v2-9-0/#new-resolver): + +``` +"@parcel/resolver-default": { + "packageExports": true +} +``` + +If you don't want to upgrade Parcel, you can keep using the legacy import paths for language files, but they will be removed in one of the upcoming releases. E.g.: + +```javascript +import { frFR } from "hyperformula/es/i18n/languages"; +``` + +### Other projects + +We tested the changes with the most popular bundlers and frameworks. If you use a different configuration, and you encounter any issues, please contact us via GitHub. We will try to make it work for you, although for older versions of bundlers and frameworks, it might be impossible. + ## Removal of the `binarySearchThreshold` configuration option (deprecated since version 1.1.0) The `binarySearchThreshold` has no effect since version 1.1.0. If your codebase still uses this option, please remove it. diff --git a/package.json b/package.json index 0a84f1de7..cf68421e4 100644 --- a/package.json +++ b/package.json @@ -47,9 +47,10 @@ "last 2 op_mob versions" ], "license": "GPL-3.0-only", - "module": "es/index.js", + "type": "commonjs", + "module": "es/index.mjs", "main": "commonjs/index.js", - "jsnext:main": "es/index.js", + "jsnext:main": "es/index.mjs", "jsdelivr": "dist/hyperformula.min.js", "unpkg": "dist/hyperformula.min.js", "typings": "./typings/index.d.ts", @@ -60,7 +61,7 @@ "docs:code-examples:generate-all-js": "bash docs/code-examples-generator.sh --generateAll", "docs:code-examples:format-all-ts": "bash docs/code-examples-generator.sh --formatAllTsExamples", "bundle-all": "cross-env HF_COMPILE=1 npm-run-all clean compile bundle:** verify-bundles", - "bundle:es": "(node script/if-ne-env.js HF_COMPILE=1 || npm run compile) && cross-env-shell BABEL_ENV=es env-cmd -f ht.config.js babel lib --out-dir es", + "bundle:es": "(node script/if-ne-env.js HF_COMPILE=1 || npm run compile) && cross-env-shell BABEL_ENV=es env-cmd -f ht.config.js babel lib --out-file-extension .mjs --out-dir es", "bundle:cjs": "(node script/if-ne-env.js HF_COMPILE=1 || npm run compile) && cross-env-shell BABEL_ENV=commonjs env-cmd -f ht.config.js babel lib --out-dir commonjs", "bundle:development": "(node script/if-ne-env.js HF_COMPILE=1 || npm run compile) && cross-env-shell BABEL_ENV=dist NODE_ENV=development env-cmd -f ht.config.js webpack ./lib/index.js", "bundle:production": "(node script/if-ne-env.js HF_COMPILE=1 || npm run compile) && cross-env-shell BABEL_ENV=dist NODE_ENV=production env-cmd -f ht.config.js webpack ./lib/index.js", @@ -99,6 +100,10 @@ "check:licenses": "license-checker --production --excludePackages=\"hyperformula@0.0.1\" --onlyAllow=\"MIT; Apache-2.0; BSD-3-Clause; BSD-2-Clause; ISC; BSD; Unlicense\"", "tsnode": "ts-node --transpile-only -O {\\\"module\\\":\\\"commonjs\\\"}" }, + "dependencies": { + "chevrotain": "^6.5.0", + "tiny-emitter": "^2.1.0" + }, "devDependencies": { "@babel/cli": "^7.8.4", "@babel/core": "^7.8.4", @@ -170,8 +175,451 @@ "webpack-cli": "^3.3.11", "webpackbar": "^4.0.0" }, - "dependencies": { - "chevrotain": "^6.5.0", - "tiny-emitter": "^2.1.0" + "exports": { + ".": { + "types": "./typings/index.d.ts", + "import": "./es/index.mjs", + "require": "./commonjs/index.js" + }, + "./i18n/languages": { + "types": "./typings/i18n/languages/index.d.ts", + "import": "./es/i18n/languages/index.mjs", + "require": "./commonjs/i18n/languages/index.js" + }, + "./es/i18n/languages": { + "types": "./typings/i18n/languages/index.d.ts", + "import": "./es/i18n/languages/index.mjs", + "require": "./commonjs/i18n/languages/index.js" + }, + "./commonjs/i18n/languages": { + "types": "./typings/i18n/languages/index.d.ts", + "import": "./es/i18n/languages/index.mjs", + "require": "./commonjs/i18n/languages/index.js" + }, + "./i18n/languages/csCZ": { + "types": "./typings/i18n/languages/csCZ.d.ts", + "import": "./es/i18n/languages/csCZ.mjs", + "require": "./commonjs/i18n/languages/csCZ.js" + }, + "./es/i18n/languages/csCZ": { + "types": "./typings/i18n/languages/csCZ.d.ts", + "import": "./es/i18n/languages/csCZ.mjs", + "require": "./commonjs/i18n/languages/csCZ.js" + }, + "./es/i18n/languages/csCZ.js": { + "types": "./typings/i18n/languages/csCZ.d.ts", + "import": "./es/i18n/languages/csCZ.mjs", + "require": "./commonjs/i18n/languages/csCZ.js" + }, + "./commonjs/i18n/languages/csCZ": { + "types": "./typings/i18n/languages/csCZ.d.ts", + "import": "./es/i18n/languages/csCZ.mjs", + "require": "./commonjs/i18n/languages/csCZ.js" + }, + "./commonjs/i18n/languages/csCZ.js": { + "types": "./typings/i18n/languages/csCZ.d.ts", + "import": "./es/i18n/languages/csCZ.mjs", + "require": "./commonjs/i18n/languages/csCZ.js" + }, + "./i18n/languages/daDK": { + "types": "./typings/i18n/languages/daDK.d.ts", + "import": "./es/i18n/languages/daDK.mjs", + "require": "./commonjs/i18n/languages/daDK.js" + }, + "./es/i18n/languages/daDK": { + "types": "./typings/i18n/languages/daDK.d.ts", + "import": "./es/i18n/languages/daDK.mjs", + "require": "./commonjs/i18n/languages/daDK.js" + }, + "./es/i18n/languages/daDK.js": { + "types": "./typings/i18n/languages/daDK.d.ts", + "import": "./es/i18n/languages/daDK.mjs", + "require": "./commonjs/i18n/languages/daDK.js" + }, + "./commonjs/i18n/languages/daDK": { + "types": "./typings/i18n/languages/daDK.d.ts", + "import": "./es/i18n/languages/daDK.mjs", + "require": "./commonjs/i18n/languages/daDK.js" + }, + "./commonjs/i18n/languages/daDK.js": { + "types": "./typings/i18n/languages/daDK.d.ts", + "import": "./es/i18n/languages/daDK.mjs", + "require": "./commonjs/i18n/languages/daDK.js" + }, + "./i18n/languages/deDE": { + "types": "./typings/i18n/languages/deDE.d.ts", + "import": "./es/i18n/languages/deDE.mjs", + "require": "./commonjs/i18n/languages/deDE.js" + }, + "./es/i18n/languages/deDE": { + "types": "./typings/i18n/languages/deDE.d.ts", + "import": "./es/i18n/languages/deDE.mjs", + "require": "./commonjs/i18n/languages/deDE.js" + }, + "./es/i18n/languages/deDE.js": { + "types": "./typings/i18n/languages/deDE.d.ts", + "import": "./es/i18n/languages/deDE.mjs", + "require": "./commonjs/i18n/languages/deDE.js" + }, + "./commonjs/i18n/languages/deDE": { + "types": "./typings/i18n/languages/deDE.d.ts", + "import": "./es/i18n/languages/deDE.mjs", + "require": "./commonjs/i18n/languages/deDE.js" + }, + "./commonjs/i18n/languages/deDE.js": { + "types": "./typings/i18n/languages/deDE.d.ts", + "import": "./es/i18n/languages/deDE.mjs", + "require": "./commonjs/i18n/languages/deDE.js" + }, + "./i18n/languages/enGB": { + "types": "./typings/i18n/languages/enGB.d.ts", + "import": "./es/i18n/languages/enGB.mjs", + "require": "./commonjs/i18n/languages/enGB.js" + }, + "./es/i18n/languages/enGB": { + "types": "./typings/i18n/languages/enGB.d.ts", + "import": "./es/i18n/languages/enGB.mjs", + "require": "./commonjs/i18n/languages/enGB.js" + }, + "./es/i18n/languages/enGB.js": { + "types": "./typings/i18n/languages/enGB.d.ts", + "import": "./es/i18n/languages/enGB.mjs", + "require": "./commonjs/i18n/languages/enGB.js" + }, + "./commonjs/i18n/languages/enGB": { + "types": "./typings/i18n/languages/enGB.d.ts", + "import": "./es/i18n/languages/enGB.mjs", + "require": "./commonjs/i18n/languages/enGB.js" + }, + "./commonjs/i18n/languages/enGB.js": { + "types": "./typings/i18n/languages/enGB.d.ts", + "import": "./es/i18n/languages/enGB.mjs", + "require": "./commonjs/i18n/languages/enGB.js" + }, + "./i18n/languages/enUS": { + "types": "./typings/i18n/languages/enUS.d.ts", + "import": "./es/i18n/languages/enUS.mjs", + "require": "./commonjs/i18n/languages/enUS.js" + }, + "./es/i18n/languages/enUS": { + "types": "./typings/i18n/languages/enUS.d.ts", + "import": "./es/i18n/languages/enUS.mjs", + "require": "./commonjs/i18n/languages/enUS.js" + }, + "./es/i18n/languages/enUS.js": { + "types": "./typings/i18n/languages/enUS.d.ts", + "import": "./es/i18n/languages/enUS.mjs", + "require": "./commonjs/i18n/languages/enUS.js" + }, + "./commonjs/i18n/languages/enUS": { + "types": "./typings/i18n/languages/enUS.d.ts", + "import": "./es/i18n/languages/enUS.mjs", + "require": "./commonjs/i18n/languages/enUS.js" + }, + "./commonjs/i18n/languages/enUS.js": { + "types": "./typings/i18n/languages/enUS.d.ts", + "import": "./es/i18n/languages/enUS.mjs", + "require": "./commonjs/i18n/languages/enUS.js" + }, + "./i18n/languages/esES": { + "types": "./typings/i18n/languages/esES.d.ts", + "import": "./es/i18n/languages/esES.mjs", + "require": "./commonjs/i18n/languages/esES.js" + }, + "./es/i18n/languages/esES": { + "types": "./typings/i18n/languages/esES.d.ts", + "import": "./es/i18n/languages/esES.mjs", + "require": "./commonjs/i18n/languages/esES.js" + }, + "./es/i18n/languages/esES.js": { + "types": "./typings/i18n/languages/esES.d.ts", + "import": "./es/i18n/languages/esES.mjs", + "require": "./commonjs/i18n/languages/esES.js" + }, + "./commonjs/i18n/languages/esES": { + "types": "./typings/i18n/languages/esES.d.ts", + "import": "./es/i18n/languages/esES.mjs", + "require": "./commonjs/i18n/languages/esES.js" + }, + "./commonjs/i18n/languages/esES.js": { + "types": "./typings/i18n/languages/esES.d.ts", + "import": "./es/i18n/languages/esES.mjs", + "require": "./commonjs/i18n/languages/esES.js" + }, + "./i18n/languages/fiFI": { + "types": "./typings/i18n/languages/fiFI.d.ts", + "import": "./es/i18n/languages/fiFI.mjs", + "require": "./commonjs/i18n/languages/fiFI.js" + }, + "./es/i18n/languages/fiFI": { + "types": "./typings/i18n/languages/fiFI.d.ts", + "import": "./es/i18n/languages/fiFI.mjs", + "require": "./commonjs/i18n/languages/fiFI.js" + }, + "./es/i18n/languages/fiFI.js": { + "types": "./typings/i18n/languages/fiFI.d.ts", + "import": "./es/i18n/languages/fiFI.mjs", + "require": "./commonjs/i18n/languages/fiFI.js" + }, + "./commonjs/i18n/languages/fiFI": { + "types": "./typings/i18n/languages/fiFI.d.ts", + "import": "./es/i18n/languages/fiFI.mjs", + "require": "./commonjs/i18n/languages/fiFI.js" + }, + "./commonjs/i18n/languages/fiFI.js": { + "types": "./typings/i18n/languages/fiFI.d.ts", + "import": "./es/i18n/languages/fiFI.mjs", + "require": "./commonjs/i18n/languages/fiFI.js" + }, + "./i18n/languages/frFR": { + "types": "./typings/i18n/languages/frFR.d.ts", + "import": "./es/i18n/languages/frFR.mjs", + "require": "./commonjs/i18n/languages/frFR.js" + }, + "./es/i18n/languages/frFR": { + "types": "./typings/i18n/languages/frFR.d.ts", + "import": "./es/i18n/languages/frFR.mjs", + "require": "./commonjs/i18n/languages/frFR.js" + }, + "./es/i18n/languages/frFR.js": { + "types": "./typings/i18n/languages/frFR.d.ts", + "import": "./es/i18n/languages/frFR.mjs", + "require": "./commonjs/i18n/languages/frFR.js" + }, + "./commonjs/i18n/languages/frFR": { + "types": "./typings/i18n/languages/frFR.d.ts", + "import": "./es/i18n/languages/frFR.mjs", + "require": "./commonjs/i18n/languages/frFR.js" + }, + "./commonjs/i18n/languages/frFR.js": { + "types": "./typings/i18n/languages/frFR.d.ts", + "import": "./es/i18n/languages/frFR.mjs", + "require": "./commonjs/i18n/languages/frFR.js" + }, + "./i18n/languages/huHU": { + "types": "./typings/i18n/languages/huHU.d.ts", + "import": "./es/i18n/languages/huHU.mjs", + "require": "./commonjs/i18n/languages/huHU.js" + }, + "./es/i18n/languages/huHU": { + "types": "./typings/i18n/languages/huHU.d.ts", + "import": "./es/i18n/languages/huHU.mjs", + "require": "./commonjs/i18n/languages/huHU.js" + }, + "./es/i18n/languages/huHU.js": { + "types": "./typings/i18n/languages/huHU.d.ts", + "import": "./es/i18n/languages/huHU.mjs", + "require": "./commonjs/i18n/languages/huHU.js" + }, + "./commonjs/i18n/languages/huHU": { + "types": "./typings/i18n/languages/huHU.d.ts", + "import": "./es/i18n/languages/huHU.mjs", + "require": "./commonjs/i18n/languages/huHU.js" + }, + "./commonjs/i18n/languages/huHU.js": { + "types": "./typings/i18n/languages/huHU.d.ts", + "import": "./es/i18n/languages/huHU.mjs", + "require": "./commonjs/i18n/languages/huHU.js" + }, + "./i18n/languages/itIT": { + "types": "./typings/i18n/languages/itIT.d.ts", + "import": "./es/i18n/languages/itIT.mjs", + "require": "./commonjs/i18n/languages/itIT.js" + }, + "./es/i18n/languages/itIT": { + "types": "./typings/i18n/languages/itIT.d.ts", + "import": "./es/i18n/languages/itIT.mjs", + "require": "./commonjs/i18n/languages/itIT.js" + }, + "./es/i18n/languages/itIT.js": { + "types": "./typings/i18n/languages/itIT.d.ts", + "import": "./es/i18n/languages/itIT.mjs", + "require": "./commonjs/i18n/languages/itIT.js" + }, + "./commonjs/i18n/languages/itIT": { + "types": "./typings/i18n/languages/itIT.d.ts", + "import": "./es/i18n/languages/itIT.mjs", + "require": "./commonjs/i18n/languages/itIT.js" + }, + "./commonjs/i18n/languages/itIT.js": { + "types": "./typings/i18n/languages/itIT.d.ts", + "import": "./es/i18n/languages/itIT.mjs", + "require": "./commonjs/i18n/languages/itIT.js" + }, + "./i18n/languages/nbNO": { + "types": "./typings/i18n/languages/nbNO.d.ts", + "import": "./es/i18n/languages/nbNO.mjs", + "require": "./commonjs/i18n/languages/nbNO.js" + }, + "./es/i18n/languages/nbNO": { + "types": "./typings/i18n/languages/nbNO.d.ts", + "import": "./es/i18n/languages/nbNO.mjs", + "require": "./commonjs/i18n/languages/nbNO.js" + }, + "./es/i18n/languages/nbNO.js": { + "types": "./typings/i18n/languages/nbNO.d.ts", + "import": "./es/i18n/languages/nbNO.mjs", + "require": "./commonjs/i18n/languages/nbNO.js" + }, + "./commonjs/i18n/languages/nbNO": { + "types": "./typings/i18n/languages/nbNO.d.ts", + "import": "./es/i18n/languages/nbNO.mjs", + "require": "./commonjs/i18n/languages/nbNO.js" + }, + "./commonjs/i18n/languages/nbNO.js": { + "types": "./typings/i18n/languages/nbNO.d.ts", + "import": "./es/i18n/languages/nbNO.mjs", + "require": "./commonjs/i18n/languages/nbNO.js" + }, + "./i18n/languages/nlNL": { + "types": "./typings/i18n/languages/nlNL.d.ts", + "import": "./es/i18n/languages/nlNL.mjs", + "require": "./commonjs/i18n/languages/nlNL.js" + }, + "./es/i18n/languages/nlNL": { + "types": "./typings/i18n/languages/nlNL.d.ts", + "import": "./es/i18n/languages/nlNL.mjs", + "require": "./commonjs/i18n/languages/nlNL.js" + }, + "./es/i18n/languages/nlNL.js": { + "types": "./typings/i18n/languages/nlNL.d.ts", + "import": "./es/i18n/languages/nlNL.mjs", + "require": "./commonjs/i18n/languages/nlNL.js" + }, + "./commonjs/i18n/languages/nlNL": { + "types": "./typings/i18n/languages/nlNL.d.ts", + "import": "./es/i18n/languages/nlNL.mjs", + "require": "./commonjs/i18n/languages/nlNL.js" + }, + "./commonjs/i18n/languages/nlNL.js": { + "types": "./typings/i18n/languages/nlNL.d.ts", + "import": "./es/i18n/languages/nlNL.mjs", + "require": "./commonjs/i18n/languages/nlNL.js" + }, + "./i18n/languages/plPL": { + "types": "./typings/i18n/languages/plPL.d.ts", + "import": "./es/i18n/languages/plPL.mjs", + "require": "./commonjs/i18n/languages/plPL.js" + }, + "./es/i18n/languages/plPL": { + "types": "./typings/i18n/languages/plPL.d.ts", + "import": "./es/i18n/languages/plPL.mjs", + "require": "./commonjs/i18n/languages/plPL.js" + }, + "./es/i18n/languages/plPL.js": { + "types": "./typings/i18n/languages/plPL.d.ts", + "import": "./es/i18n/languages/plPL.mjs", + "require": "./commonjs/i18n/languages/plPL.js" + }, + "./commonjs/i18n/languages/plPL": { + "types": "./typings/i18n/languages/plPL.d.ts", + "import": "./es/i18n/languages/plPL.mjs", + "require": "./commonjs/i18n/languages/plPL.js" + }, + "./commonjs/i18n/languages/plPL.js": { + "types": "./typings/i18n/languages/plPL.d.ts", + "import": "./es/i18n/languages/plPL.mjs", + "require": "./commonjs/i18n/languages/plPL.js" + }, + "./i18n/languages/ptPT": { + "types": "./typings/i18n/languages/ptPT.d.ts", + "import": "./es/i18n/languages/ptPT.mjs", + "require": "./commonjs/i18n/languages/ptPT.js" + }, + "./es/i18n/languages/ptPT": { + "types": "./typings/i18n/languages/ptPT.d.ts", + "import": "./es/i18n/languages/ptPT.mjs", + "require": "./commonjs/i18n/languages/ptPT.js" + }, + "./es/i18n/languages/ptPT.js": { + "types": "./typings/i18n/languages/ptPT.d.ts", + "import": "./es/i18n/languages/ptPT.mjs", + "require": "./commonjs/i18n/languages/ptPT.js" + }, + "./commonjs/i18n/languages/ptPT": { + "types": "./typings/i18n/languages/ptPT.d.ts", + "import": "./es/i18n/languages/ptPT.mjs", + "require": "./commonjs/i18n/languages/ptPT.js" + }, + "./commonjs/i18n/languages/ptPT.js": { + "types": "./typings/i18n/languages/ptPT.d.ts", + "import": "./es/i18n/languages/ptPT.mjs", + "require": "./commonjs/i18n/languages/ptPT.js" + }, + "./i18n/languages/ruRU": { + "types": "./typings/i18n/languages/ruRU.d.ts", + "import": "./es/i18n/languages/ruRU.mjs", + "require": "./commonjs/i18n/languages/ruRU.js" + }, + "./es/i18n/languages/ruRU": { + "types": "./typings/i18n/languages/ruRU.d.ts", + "import": "./es/i18n/languages/ruRU.mjs", + "require": "./commonjs/i18n/languages/ruRU.js" + }, + "./es/i18n/languages/ruRU.js": { + "types": "./typings/i18n/languages/ruRU.d.ts", + "import": "./es/i18n/languages/ruRU.mjs", + "require": "./commonjs/i18n/languages/ruRU.js" + }, + "./commonjs/i18n/languages/ruRU": { + "types": "./typings/i18n/languages/ruRU.d.ts", + "import": "./es/i18n/languages/ruRU.mjs", + "require": "./commonjs/i18n/languages/ruRU.js" + }, + "./commonjs/i18n/languages/ruRU.js": { + "types": "./typings/i18n/languages/ruRU.d.ts", + "import": "./es/i18n/languages/ruRU.mjs", + "require": "./commonjs/i18n/languages/ruRU.js" + }, + "./i18n/languages/svSE": { + "types": "./typings/i18n/languages/svSE.d.ts", + "import": "./es/i18n/languages/svSE.mjs", + "require": "./commonjs/i18n/languages/svSE.js" + }, + "./es/i18n/languages/svSE": { + "types": "./typings/i18n/languages/svSE.d.ts", + "import": "./es/i18n/languages/svSE.mjs", + "require": "./commonjs/i18n/languages/svSE.js" + }, + "./es/i18n/languages/svSE.js": { + "types": "./typings/i18n/languages/svSE.d.ts", + "import": "./es/i18n/languages/svSE.mjs", + "require": "./commonjs/i18n/languages/svSE.js" + }, + "./commonjs/i18n/languages/svSE": { + "types": "./typings/i18n/languages/svSE.d.ts", + "import": "./es/i18n/languages/svSE.mjs", + "require": "./commonjs/i18n/languages/svSE.js" + }, + "./commonjs/i18n/languages/svSE.js": { + "types": "./typings/i18n/languages/svSE.d.ts", + "import": "./es/i18n/languages/svSE.mjs", + "require": "./commonjs/i18n/languages/svSE.js" + }, + "./i18n/languages/trTR": { + "types": "./typings/i18n/languages/trTR.d.ts", + "import": "./es/i18n/languages/trTR.mjs", + "require": "./commonjs/i18n/languages/trTR.js" + }, + "./es/i18n/languages/trTR": { + "types": "./typings/i18n/languages/trTR.d.ts", + "import": "./es/i18n/languages/trTR.mjs", + "require": "./commonjs/i18n/languages/trTR.js" + }, + "./es/i18n/languages/trTR.js": { + "types": "./typings/i18n/languages/trTR.d.ts", + "import": "./es/i18n/languages/trTR.mjs", + "require": "./commonjs/i18n/languages/trTR.js" + }, + "./commonjs/i18n/languages/trTR": { + "types": "./typings/i18n/languages/trTR.d.ts", + "import": "./es/i18n/languages/trTR.mjs", + "require": "./commonjs/i18n/languages/trTR.js" + }, + "./commonjs/i18n/languages/trTR.js": { + "types": "./typings/i18n/languages/trTR.d.ts", + "import": "./es/i18n/languages/trTR.mjs", + "require": "./commonjs/i18n/languages/trTR.js" + } } } diff --git a/script/check-publish-package.js b/script/check-publish-package.js index 20fa55e28..1a684f481 100644 --- a/script/check-publish-package.js +++ b/script/check-publish-package.js @@ -29,12 +29,12 @@ const FILES_CHECKLIST = [ 'commonjs/index.js', 'commonjs/HyperFormula.js', 'dist/hyperformula.js', - 'es/index.js', - 'es/HyperFormula.js', + 'es/index.mjs', + 'es/HyperFormula.mjs', 'typings/index.d.ts', 'typings/HyperFormula.d.ts', 'dist/languages/plPL.js', - 'es/i18n/languages/plPL.js', + 'es/i18n/languages/plPL.mjs', 'commonjs/i18n/languages/plPL.js', ]