esm for react

main
Jackson Morgan 4 months ago
parent 0a24f36563
commit 7b03667727
  1. 6
      packages/react/jest.config.js
  2. 1
      packages/react/jest.setup.ts
  3. 21
      packages/react/package.json
  4. 2
      packages/react/test/trivial.test.ts
  5. 8
      packages/react/tsconfig.build.json
  6. 10
      packages/react/tsconfig.cjs.json
  7. 11
      packages/react/tsconfig.esm.json
  8. 9
      packages/react/vitest.config.js

@ -1,6 +0,0 @@
const sharedConfig = require("../../jest.config.js");
module.exports = {
...sharedConfig,
rootDir: "./",
testEnvironment: "jsdom",
};

@ -1 +0,0 @@
import "@inrupt/jest-jsdom-polyfills";

@ -2,12 +2,23 @@
"name": "@ldo/react",
"version": "1.0.0-alpha.9",
"description": "A React library for LDO.",
"main": "dist/index.js",
"type": "module",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsc --project tsconfig.build.json",
"watch": "tsc --project tsconfig.build.json --watch",
"test": "jest --coverage",
"test:watch": "jest --watch",
"build": "rimraf dist && npm run build:cjs && npm run build:esm",
"build:cjs": "tsc --project tsconfig.cjs.json",
"build:esm": "tsc --project tsconfig.esm.json",
"test": "vitest run --coverage",
"prepublishOnly": "npm run test && npm run build",
"build:ldo": "ldo build --input src/shapes --output src/ldo",
"lint": "eslint src/** --fix --no-error-on-unmatched-pattern"

@ -1,3 +1,5 @@
import { describe, it, expect } from "vitest";
describe("react", () => {
it("trivial", () => {
expect(true).toBe(true);

@ -1,8 +0,0 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"lib": ["dom"]
},
"include": ["./src"]
}

@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.cjs.json",
"compilerOptions": {
"outDir": "./dist/cjs",
"rootDir": "./src"
},
"include": [
"src"
]
}

@ -0,0 +1,11 @@
{
"extends": "../../tsconfig.esm.json",
"compilerOptions": {
"outDir": "./dist/esm",
"rootDir": "./src",
"declarationDir": "./dist/types"
},
"include": [
"src"
]
}

@ -0,0 +1,9 @@
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
coverage: {
provider: "istanbul",
},
},
});
Loading…
Cancel
Save