Skip to content

Commit

Permalink
fix: include esm builds in dist files (#544)
Browse files Browse the repository at this point in the history
Fixes #543.
  • Loading branch information
JasonBerry authored Aug 9, 2024
1 parent 2fb7ee1 commit 3bff866
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 86 deletions.
37 changes: 18 additions & 19 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,69 @@ module.exports = {
env: {
browser: true,
es2021: true,
node: true,
node: true
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"algolia",
"algolia/typescript",
"algolia/typescript"
],
overrides: [
{
env: {
node: true,
node: true
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
sourceType: "script"
}
},
{
files: "*.test.*",
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
},
},
"@typescript-eslint/explicit-function-return-type": "off"
}
}
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: "tsconfig.json",
project: "tsconfig.json"
},
plugins: ["@typescript-eslint"],
rules: {
"prettier/prettier": [
"error",
{},
{
"usePrettierrc": true
usePrettierrc: true
}
],
"jsdoc/check-tag-names": [
"error",
{
definedTags: ["jest-environment"],
},
definedTags: ["jest-environment"]
}
],
"@typescript-eslint/naming-convention": [
"error",
{
selector: "typeAlias",
format: ["PascalCase"],
format: ["PascalCase"]
},
{
selector: "typeParameter",
format: ["PascalCase"],
format: ["PascalCase"]
},
{
selector: "interface",
format: ["PascalCase"],
},
format: ["PascalCase"]
}
],
"@typescript-eslint/comma-spacing": "off",
"@typescript-eslint/func-call-spacing": "off",
"@typescript-eslint/type-annotation-spacing": "off",

},
"@typescript-eslint/type-annotation-spacing": "off"
}
};
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Search Insights lets you report click, conversion and view metrics using the [Al
- [Node.js](#nodejs)
- [Documentation](#documentation)
- [Contributing](#contributing)
- [Releasing](#releasing)
- [License](#license)

<!-- tocstop -->
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions index-node.cjs.js → index-browser.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const aa = require("./dist/search-insights-node.cjs.min.js");
const aa = require("./dist/search-insights-browser.min.cjs");

module.exports = aa.default;
Object.keys(aa).forEach(key => {
Object.keys(aa).forEach((key) => {
if (key !== "default") {
module.exports[key] = aa[key];
}
Expand Down
3 changes: 0 additions & 3 deletions index-browser.cjs.d.ts

This file was deleted.

8 changes: 0 additions & 8 deletions index-browser.cjs.js

This file was deleted.

3 changes: 3 additions & 0 deletions index-browser.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./dist/entry-browser";
import aa from "./dist/entry-browser";
export default aa;
1 change: 0 additions & 1 deletion index-browser.esm.js

This file was deleted.

3 changes: 3 additions & 0 deletions index-browser.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./dist/search-insights-browser.mjs";
import aa from "./dist/search-insights-browser.mjs";
export default aa;
8 changes: 8 additions & 0 deletions index-node.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const aa = require("./dist/search-insights-node.cjs");

module.exports = aa.default;
module.exports.createInsightsClient = aa.createInsightsClient;
module.exports.getRequesterForNode = aa.getRequesterForNode;
module.exports.AlgoliaAnalytics = aa.AlgoliaAnalytics;
module.exports.getFunctionalInterface = aa.getFunctionalInterface;
module.exports.processQueue = aa.processQueue;
3 changes: 0 additions & 3 deletions index-node.cjs.d.ts

This file was deleted.

3 changes: 3 additions & 0 deletions index-node.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./dist/entry-node";
import aa from "./dist/entry-node";
export default aa;
Loading

0 comments on commit 3bff866

Please sign in to comment.