Skip to content

Commit 9a4ebf9

Browse files
committed
Fix tsup
1 parent 80119f6 commit 9a4ebf9

File tree

6 files changed

+290
-565
lines changed

6 files changed

+290
-565
lines changed

packages/react-components/package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
"version": "4.21.0-beta.1",
44
"description": "The Official Commerce Layer React Components",
55
"type": "module",
6-
"module": "lib/index.js",
7-
"types": "lib/index.d.ts",
8-
"files": ["lib", "package.json", "README.md"],
6+
"module": "dist/index.js",
7+
"types": "dist/index.d.ts",
8+
"files": ["dist", "package.json", "README.md"],
99
"exports": {
10+
"./package.json": "./package.json",
1011
".": {
11-
"require": "./lib/index.cjs",
12-
"import": "./lib/index.js"
12+
"import": "./dist/index.js",
13+
"default": "./dist/index.cjs"
1314
}
1415
},
1516
"engines": {
@@ -22,14 +23,16 @@
2223
"scripts": {
2324
"lint": "biome lint --error-on-warnings ./src",
2425
"lint:fix": "pnpm biome lint --write ./src",
26+
"lint:tsc": "tsc",
2527
"test": "pnpm audit --audit-level high && (pnpm audit || exit 0) && pnpm lint && vitest run --silent",
2628
"coverage": "vitest run --coverage",
2729
"test:e2e": "NODE_ENV=test playwright test",
2830
"test:e2e:coverage": "nyc pnpm test:e2e && pnpm coverage:report",
2931
"coverage:report": "nyc report --reporter=html",
30-
"build": "tsup",
32+
"build": "tsup && pnpm lint:tsc",
3133
"build:dev": "tsc -b tsconfig.prod.json tsconfig.prod.esm.json --verbose && tsc-alias -p tsconfig.prod.json && tsc-alias -p tsconfig.prod.esm.json",
32-
"dev": "NODE_OPTIONS='--inspect' next dev"
34+
"dev": "NODE_OPTIONS='--inspect' next dev",
35+
"check-exports": "attw --pack ."
3336
},
3437
"repository": {
3538
"type": "git",
@@ -69,6 +72,7 @@
6972
"rapid-form": "2.1.0"
7073
},
7174
"devDependencies": {
75+
"@arethetypeswrong/cli": "^0.17.4",
7276
"@commercelayer/js-auth": "^6.7.1",
7377
"@faker-js/faker": "^9.5.1",
7478
"@playwright/test": "^1.50.1",

packages/react-components/tsconfig.json

Lines changed: 23 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
"compilerOptions": {
33
/* Visit https://aka.ms/tsconfig.json to read more about this file */
44
/* Basic Options */
5+
"module": "Preserve",
56
"resolveJsonModule": true,
67
"incremental": false /* Enable incremental compilation */,
78
"target": "ESNext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
8-
"module": "ESNext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
99
// "lib": [], /* Specify library files to be included in the compilation. */
1010
// "allowJs": true, /* Allow javascript files to be compiled. */
1111
// "checkJs": true, /* Report errors in .js files. */
1212
"jsx": "react-jsx" /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */,
13-
"declaration": true /* Generates corresponding '.d.ts' file. */,
13+
// "declaration": true /* Generates corresponding '.d.ts' file. */,
1414
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
1515
// "sourceMap": true, /* Generates corresponding '.map' file. */
1616
// "outFile": "./", /* Concatenate and emit output to single file. */
1717
// "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
1818
// "composite": true, /* Enable project compilation */
1919
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
2020
// "removeComments": true, /* Do not emit comments to output. */
21-
// "noEmit": true, /* Do not emit outputs. */
21+
"noEmit": true /* Do not emit outputs. */,
2222
"importHelpers": true /* Import emit helpers from 'tslib'. */,
2323
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
2424
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
@@ -32,49 +32,27 @@
3232
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
3333
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
3434
/* Additional Checks */
35-
"noUnusedLocals": true, /* Report errors on unused locals. */
36-
"noUnusedParameters": true, /* Report errors on unused parameters. */
37-
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
38-
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
39-
"noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
40-
"noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
41-
"types": [
42-
"vitest/globals"
43-
],
35+
"noUnusedLocals": true /* Report errors on unused locals. */,
36+
"noUnusedParameters": true /* Report errors on unused parameters. */,
37+
"noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
38+
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */,
39+
"noUncheckedIndexedAccess": true /* Include 'undefined' in index signature results */,
40+
"noPropertyAccessFromIndexSignature": true /* Require undeclared properties from index signatures to use element accesses. */,
41+
"types": ["vitest/globals"],
4442
/* Module Resolution Options */
4543
"moduleResolution": "Node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
4644
"baseUrl": "." /* Base directory to resolve non-absolute module names. */,
4745
"paths": {
48-
"@commercelayer/react-components": [
49-
"src/index"
50-
],
51-
"#components/*": [
52-
"src/components/*"
53-
],
54-
"#components-utils/*": [
55-
"src/components/utils/*"
56-
],
57-
"#reducers/*": [
58-
"src/reducers/*"
59-
],
60-
"#context/*": [
61-
"src/context/*"
62-
],
63-
"#typings/*": [
64-
"src/typings/*"
65-
],
66-
"#typings": [
67-
"src/typings/index"
68-
],
69-
"#utils/*": [
70-
"src/utils/*"
71-
],
72-
"#config/*": [
73-
"src/config/*"
74-
],
75-
"#hooks/*": [
76-
"src/hooks/*"
77-
]
46+
"@commercelayer/react-components": ["src/index"],
47+
"#components/*": ["src/components/*"],
48+
"#components-utils/*": ["src/components/utils/*"],
49+
"#reducers/*": ["src/reducers/*"],
50+
"#context/*": ["src/context/*"],
51+
"#typings/*": ["src/typings/*"],
52+
"#typings": ["src/typings/index"],
53+
"#utils/*": ["src/utils/*"],
54+
"#config/*": ["src/config/*"],
55+
"#hooks/*": ["src/hooks/*"]
7856
} /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */,
7957
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
8058
// "typeRoots": [], /* List of folders to include type definitions from. */
@@ -95,12 +73,6 @@
9573
"skipLibCheck": true /* Skip type checking of declaration files. */,
9674
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
9775
},
98-
"include": [
99-
"**/*.ts",
100-
"**/*.tsx",
101-
"vitest.config.mts"
102-
],
103-
"exclude": [
104-
"node_modules"
105-
]
106-
}
76+
"include": ["**/*.ts", "**/*.tsx", "vitest.config.mts"],
77+
"exclude": ["node_modules", "specs"]
78+
}

packages/react-components/tsconfig.prod.esm.json

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)