From 32f4b70ab8fed7c7a299c72f390a34b0372a71a0 Mon Sep 17 00:00:00 2001 From: Arne Molland Date: Thu, 7 Apr 2022 20:33:41 +0200 Subject: [PATCH] package: distribute as cjs-only module --- .eslintrc.js | 24 +++++++++++++++++ .eslintrc.json | 9 ------- jest.config.cjs => jest.config.js | 4 +-- package-lock.json | 43 +++++++++++++++---------------- package.json | 12 ++++----- 5 files changed, 51 insertions(+), 41 deletions(-) create mode 100644 .eslintrc.js delete mode 100644 .eslintrc.json rename jest.config.cjs => jest.config.js (77%) diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..d96e033a --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,24 @@ +module.exports = { + extends: [ + 'eslint:recommended', + 'plugin:react/recommended', + 'plugin:storybook/recommended', + 'plugin:mdx/recommended' + ], + settings: { + 'mdx/code-blocks': true + }, + rules: { + 'import/first': 'error', + 'import/no-duplicates': 'error', + 'no-unused-vars': 'error', + 'no-console': 'error', + 'no-empty': 'error', + 'no-nested-ternary': 'error', + 'no-useless-escape': 'error', + 'no-var': 'error', + complexity: ['error', 6], + eqeqeq: 'error', + quotes: ['error', 'single'] + } +} diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 9bab7e1c..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": [ - "eslint:recommended", - "plugin:react/recommended" - ], - "rules": { - "no-console": 2 - } -} diff --git a/jest.config.cjs b/jest.config.js similarity index 77% rename from jest.config.cjs rename to jest.config.js index 779c5881..37124aff 100644 --- a/jest.config.cjs +++ b/jest.config.js @@ -4,7 +4,5 @@ module.exports = { transform: { 'node_modules/variables/.+\\.(j|t)sx?$': 'ts-jest' }, - testPathIgnorePatterns: [ - "dist" - ] + testPathIgnorePatterns: ['dist'] } diff --git a/package-lock.json b/package-lock.json index 4b994ac2..f58cae00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,10 +36,10 @@ "@types/jest": "^27.4.1", "@types/jsdom": "^16.2.14", "@types/node": "17.0.23", - "@types/react": "^17.0.43", - "@types/react-dom": "^17.0.14", + "@types/react": "^18.0.0", + "@types/react-dom": "^18.0.0", "@types/rollup-plugin-peer-deps-external": "^2.2.1", - "@types/styled-components": "^5.1.24", + "@types/styled-components": "^5.1.25", "acorn-jsx": "^5.3.2", "awesome-typescript-loader": "^5.2.1", "babel-loader": "^8.2.4", @@ -9551,9 +9551,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "17.0.43", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.43.tgz", - "integrity": "sha512-8Q+LNpdxf057brvPu1lMtC5Vn7J119xrP1aq4qiaefNioQUYANF/CYeK4NsKorSZyUGJ66g0IM+4bbjwx45o2A==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.0.tgz", + "integrity": "sha512-7+K7zEQYu7NzOwQGLR91KwWXXDzmTFODRVizJyIALf6RfLv2GDpqpknX64pvRVILXCpXi7O/pua8NGk44dLvJw==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -9562,9 +9562,9 @@ } }, "node_modules/@types/react-dom": { - "version": "17.0.14", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.14.tgz", - "integrity": "sha512-H03xwEP1oXmSfl3iobtmQ/2dHF5aBHr8aUMwyGZya6OW45G+xtdzmq6HkncefiBt5JU8DVyaWl/nWZbjZCnzAQ==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.0.tgz", + "integrity": "sha512-49897Y0UiCGmxZqpC8Blrf6meL8QUla6eb+BBhn69dTXlmuOlzkfr7HHY/O8J25e1lTUMs+YYxSlVDAaGHCOLg==", "dev": true, "dependencies": { "@types/react": "*" @@ -9642,11 +9642,10 @@ "license": "MIT" }, "node_modules/@types/styled-components": { - "version": "5.1.24", - "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-5.1.24.tgz", - "integrity": "sha512-mz0fzq2nez+Lq5IuYammYwWgyLUE6OMAJTQL9D8hFLP4Pkh7gVYJii/VQWxq8/TK34g/OrkehXaFNdcEKcItug==", + "version": "5.1.25", + "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-5.1.25.tgz", + "integrity": "sha512-fgwl+0Pa8pdkwXRoVPP9JbqF0Ivo9llnmsm+7TCI330kbPIFd9qv1Lrhr37shf4tnxCOSu+/IgqM7uJXLWZZNQ==", "dev": true, - "license": "MIT", "dependencies": { "@types/hoist-non-react-statics": "*", "@types/react": "*", @@ -37124,9 +37123,9 @@ "dev": true }, "@types/react": { - "version": "17.0.43", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.43.tgz", - "integrity": "sha512-8Q+LNpdxf057brvPu1lMtC5Vn7J119xrP1aq4qiaefNioQUYANF/CYeK4NsKorSZyUGJ66g0IM+4bbjwx45o2A==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.0.tgz", + "integrity": "sha512-7+K7zEQYu7NzOwQGLR91KwWXXDzmTFODRVizJyIALf6RfLv2GDpqpknX64pvRVILXCpXi7O/pua8NGk44dLvJw==", "dev": true, "requires": { "@types/prop-types": "*", @@ -37135,9 +37134,9 @@ } }, "@types/react-dom": { - "version": "17.0.14", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.14.tgz", - "integrity": "sha512-H03xwEP1oXmSfl3iobtmQ/2dHF5aBHr8aUMwyGZya6OW45G+xtdzmq6HkncefiBt5JU8DVyaWl/nWZbjZCnzAQ==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.0.tgz", + "integrity": "sha512-49897Y0UiCGmxZqpC8Blrf6meL8QUla6eb+BBhn69dTXlmuOlzkfr7HHY/O8J25e1lTUMs+YYxSlVDAaGHCOLg==", "dev": true, "requires": { "@types/react": "*" @@ -37208,9 +37207,9 @@ "dev": true }, "@types/styled-components": { - "version": "5.1.24", - "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-5.1.24.tgz", - "integrity": "sha512-mz0fzq2nez+Lq5IuYammYwWgyLUE6OMAJTQL9D8hFLP4Pkh7gVYJii/VQWxq8/TK34g/OrkehXaFNdcEKcItug==", + "version": "5.1.25", + "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-5.1.25.tgz", + "integrity": "sha512-fgwl+0Pa8pdkwXRoVPP9JbqF0Ivo9llnmsm+7TCI330kbPIFd9qv1Lrhr37shf4tnxCOSu+/IgqM7uJXLWZZNQ==", "dev": true, "requires": { "@types/hoist-non-react-statics": "*", diff --git a/package.json b/package.json index 621e895d..1579fc27 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,7 @@ "name": "@gameflow-tv/flume", "version": "0.0.0-dev", "description": "React implementation of the Flume design system", - "module": "dist/index.js", - "main": "dist/index.xjs", - "type": "module", + "main": "dist/index.js", "files": [ "dist", "bundle.scss" @@ -32,7 +30,7 @@ "postbuild": "npm run bundle-styles", "bundle-styles": "scss-bundle -e src/styles/index.scss -o bundle.scss --rootDir src/styles", "watch": "tsc && npm run build:bundle -- --watch", - "build:bundle": "tsup src/index.ts --format cjs,esm --dts --clean" + "build:bundle": "tsup src/index.ts --dts --clean" }, "husky": { "hooks": { @@ -75,10 +73,10 @@ "@types/jest": "^27.4.1", "@types/jsdom": "^16.2.14", "@types/node": "17.0.23", - "@types/react": "^17.0.43", - "@types/react-dom": "^17.0.14", + "@types/react": "^18.0.0", + "@types/react-dom": "^18.0.0", "@types/rollup-plugin-peer-deps-external": "^2.2.1", - "@types/styled-components": "^5.1.24", + "@types/styled-components": "^5.1.25", "acorn-jsx": "^5.3.2", "awesome-typescript-loader": "^5.2.1", "babel-loader": "^8.2.4",