Skip to content

Commit

Permalink
SSR fix, import default jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
x64Bits committed Oct 13, 2023
1 parent 2d48ba2 commit e2e5c07
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 18 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "solid-icons",
"version": "1.1.0-beta.1",
"version": "1.1.0-beta.2",
"description": "Modern solution for use icons on SolidJS",
"author": "Ignacio Zsabo",
"license": "MIT",
Expand Down Expand Up @@ -47,7 +47,7 @@
"rollup-plugin-delete": "^2.0.0",
"rollup-preset-solid": "^2.0.1",
"shx": "^0.3.4",
"solid-js": "1.6.9",
"solid-js": "^1.7.12",
"solid-testing-library": "^0.5.0",
"svgo": "3.0.2",
"ts-node": "^10.9.1",
Expand Down
18 changes: 11 additions & 7 deletions src/build/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,23 @@ export const log = console.log;

export const LIB_PACKAGE_JSON = /* javascript */ `{
"main": "./index.cjs",
"module": "./index.js"
}`;

export const PACK_PACKAGE_JSON = /* javascript */ `{
"sideEffects": false,
"module": "./index.js"
"module": "./index.jsx",
"solid": "./index.jsx",
"exports": {
".": {
"default": "./index.jsx",
"solid": "./index.jsx"
}
}
}`;

export const ROOT_EXPORT = {
browser: "./lib/index.js",
types: "./lib/index.d.ts",
node: "./lib/index.cjs",
default: "./lib/index.cjs",
default: "./lib/index.jsx",
solid: "./lib/index.jsx",
astro: "./lib/index.jsx",
};

export const includedFiles = ["LICENSE", "README.md"];
Expand Down
2 changes: 1 addition & 1 deletion src/build/file-types.ts → src/build/file-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const fileTypes = [
type: "mjs",
template: (iconContent: IconContent) => moduleTemplate(iconContent),
// eslint-disable-next-line quotes, @typescript-eslint/quotes
header: /* javascript */ `import { IconTemplate } from "../lib/index.js";`,
header: /* javascript */ `import { IconTemplate } from "../lib/index.jsx";`,
fileName: "index.js",
},
{
Expand Down
9 changes: 5 additions & 4 deletions src/build/lib-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
LIB_PACKAGE_JSON,
EXPORTS_KEYS,
} from "./constants";
import { fileTypes } from "./file-types";
import { fileTypes } from "./file-templates";
import { getFileByPath } from "./get-icons";
import packages from "./packages.json" assert { type: "json" };
import { PackageJSONExport, PackAttachedIcons, PackItem } from "./types";
Expand All @@ -39,8 +39,9 @@ function getPackageExports(
},
"require": "./${current.shortName}/index.cjs",
"browser": "./${current.shortName}/index.js",
"node": "./${current.shortName}/index.cjs",
"default": "./${current.shortName}/index.cjs"
"node": "./${current.shortName}/index.js",
"default": "./${current.shortName}/index.js",
"solid": "./${current.shortName}/index.js"
}`);

const runtimeExports = [
Expand Down Expand Up @@ -75,7 +76,7 @@ function writeAssetsFiles() {
delete packageDotJson.engines;
packageDotJson.main = "./lib/index.cjs";
packageDotJson.types = "./lib/index.d.ts";
packageDotJson.module = "./lib/index.js";
packageDotJson.module = "./lib/index.jsx";
packageDotJson.unpkg = "./lib/index.cjs";

packageDotJson.exports = {
Expand Down
14 changes: 10 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3916,6 +3916,11 @@ semver@^7.3.7:
dependencies:
lru-cache "^6.0.0"

seroval@^0.5.0:
version "0.5.1"
resolved "https://registry.yarnpkg.com/seroval/-/seroval-0.5.1.tgz#e6d17365cdaaae7e50815c7e0bcd7102facdadf3"
integrity sha512-ZfhQVB59hmIauJG5Ydynupy8KHyr5imGNtdDhbZG68Ufh1Ynkv9KOYOAABf71oVbQxJ8VkWnMHAjEHE7fWkH5g==

shebang-command@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
Expand Down Expand Up @@ -3969,12 +3974,13 @@ slash@^3.0.0:
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==

solid-js@1.6.9:
version "1.6.9"
resolved "https://registry.yarnpkg.com/solid-js/-/solid-js-1.6.9.tgz#98dc71f1bacf9e6efe771cf47c0d023e5bd892ed"
integrity sha512-kV3fMmm+1C2J95c8eDOPKGfZHnuAkHUBLG4hX1Xu08bXeAIPqmxuz/QdH3B8SIdTp3EatBVIyA6RCes3hrGzpg==
solid-js@^1.7.12:
version "1.7.12"
resolved "https://registry.yarnpkg.com/solid-js/-/solid-js-1.7.12.tgz#e196aceb03790c15aedf109771c5bb9cc92516ea"
integrity sha512-QoyoOUKu14iLoGxjxWFIU8+/1kLT4edQ7mZESFPonsEXZ//VJtPKD8Ud1aTKzotj+MNWmSs9YzK6TdY+fO9Eww==
dependencies:
csstype "^3.1.0"
seroval "^0.5.0"

solid-refresh@^0.4.1:
version "0.4.1"
Expand Down

0 comments on commit e2e5c07

Please sign in to comment.