From 5c3acc8a4d33173183b492382d623b578fb75136 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Thu, 2 Mar 2023 14:30:40 +0100 Subject: [PATCH] Rename package `module` files to `index.js` Makes it easier to import, you don't have to specify the file name, just the package name. --- package.json | 2 +- src/entry.js | 2 +- src/headless/README.md | 2 +- src/headless/{headless.js => index.js} | 0 src/headless/package.json | 2 +- src/{converse.js => index.js} | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename src/headless/{headless.js => index.js} (100%) rename src/{converse.js => index.js} (98%) diff --git a/package.json b/package.json index fe57b2781..24332846c 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "10.1.2", "description": "Browser based XMPP chat client", "browser": "dist/converse.js", - "module": "src/converse.js", + "module": "src/index.js", "workspaces": [ "src/headless" ], diff --git a/src/entry.js b/src/entry.js index 38a6a161d..e30a438df 100644 --- a/src/entry.js +++ b/src/entry.js @@ -57,7 +57,7 @@ const converse = { if (settings.assets_path) { __webpack_public_path__ = settings.assets_path; // eslint-disable-line no-undef } - require('./converse.js'); + require('./index.js'); Object.keys(plugins).forEach(name => converse.plugins.add(name, plugins[name])); return converse; } diff --git a/src/headless/README.md b/src/headless/README.md index 70d2e0c0a..8f83e4b14 100644 --- a/src/headless/README.md +++ b/src/headless/README.md @@ -13,5 +13,5 @@ It's also installable with NPM/Yarn as [@converse/headless](https://www.npmjs.co The main distribution of Converse relies on the headless build. -The file [src/headless/headless.js](https://github.com/jcbrand/converse.js/blob/master/src/headless/headless.js) +The file [src/headless/index.js](https://github.com/jcbrand/converse.js/blob/master/src/headless/index.js) is used to determine which plugins are included in the build. diff --git a/src/headless/headless.js b/src/headless/index.js similarity index 100% rename from src/headless/headless.js rename to src/headless/index.js diff --git a/src/headless/package.json b/src/headless/package.json index bf85bc3a2..c6ca24000 100644 --- a/src/headless/package.json +++ b/src/headless/package.json @@ -10,7 +10,7 @@ "homepage": "https://conversejs.org", "license": "MPL-2.0", "main": "dist/converse-headless.js", - "module": "headless.js", + "module": "index.js", "keywords": [ "converse.js", "XMPP", diff --git a/src/converse.js b/src/index.js similarity index 98% rename from src/converse.js rename to src/index.js index e93ee169a..53d571346 100644 --- a/src/converse.js +++ b/src/index.js @@ -4,7 +4,7 @@ * @license Mozilla Public License (MPLv2) */ -import "@converse/headless/headless"; +import "@converse/headless"; import "./i18n/index.js"; import "shared/registry.js"; import { CustomElement } from 'shared/components/element';