From 28f1de56d1ebc4f621aaefa9250d0fa4770379c7 Mon Sep 17 00:00:00 2001 From: Nicola Molinari Date: Sun, 15 Nov 2020 13:32:18 +0100 Subject: [PATCH] fix: build, temporary disable css imports --- babel.config.js | 2 +- package.json | 3 --- .../application-shell-connectors/package.json | 21 ++++------------ packages/application-shell/package.json | 1 + .../application-shell-provider.tsx | 3 ++- .../global-style-imports.ts | 4 ++-- .../{grid.mod.css => grid.css} | 16 ++++++------- .../{reset.mod.css => reset.css} | 0 .../src/components/navbar/navbar.tsx | 3 ++- packages/i18n/package.json | 1 + packages/jest-stylelint-runner/index.js | 2 +- packages/l10n/package.json | 16 +++---------- packages/permissions/package.json | 2 ++ .../use-is-authorized/use-is-authorized.ts | 3 +-- packages/sdk/package.json | 7 +++--- tsconfig.json | 19 +++++++-------- yarn.lock | 24 +------------------ 17 files changed, 40 insertions(+), 87 deletions(-) rename packages/application-shell/src/components/application-shell-provider/{grid.mod.css => grid.css} (74%) rename packages/application-shell/src/components/application-shell-provider/{reset.mod.css => reset.css} (100%) diff --git a/babel.config.js b/babel.config.js index 41224f8750..da9f0b3cf6 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,4 +1,4 @@ module.exports = { presets: ['@commercetools-frontend/babel-preset-mc-app'], - plugins: ['babel-plugin-import-graphql', 'import-postcss'], + plugins: ['babel-plugin-import-graphql'], }; diff --git a/package.json b/package.json index 3a9e957471..0eae74e30b 100644 --- a/package.json +++ b/package.json @@ -209,8 +209,5 @@ "node": ">=12", "npm": ">=5", "yarn": ">=1.10" - }, - "devDependencies": { - "babel-plugin-import-postcss": "2.0.0" } } diff --git a/packages/application-shell-connectors/package.json b/packages/application-shell-connectors/package.json index 4327321303..aa4d30b3b4 100644 --- a/packages/application-shell-connectors/package.json +++ b/packages/application-shell-connectors/package.json @@ -9,12 +9,7 @@ "directory": "packages/application-shell-connectors" }, "homepage": "https://docs.commercetools.com/custom-applications", - "keywords": [ - "javascript", - "frontend", - "react", - "toolkit" - ], + "keywords": ["javascript", "frontend", "react", "toolkit"], "license": "MIT", "private": false, "publishConfig": { @@ -24,18 +19,9 @@ "module": "dist/application-shell-connectors.esm.js", "typings": "./dist/typings/index.d.ts", "types": "./dist/typings/index.d.ts", - "files": [ - "dist", - "test-utils", - "package.json", - "LICENSE", - "README.md" - ], + "files": ["dist", "test-utils", "package.json", "LICENSE", "README.md"], "preconstruct": { - "entrypoints": [ - ".", - "test-utils" - ] + "entrypoints": [".", "test-utils"] }, "scripts": { "prepare": "./../../scripts/version.js replace", @@ -52,6 +38,7 @@ "@babel/runtime-corejs3": "7.12.5", "@commercetools-frontend/constants": "17.3.0", "@commercetools-frontend/sentry": "17.3.0", + "@emotion/core": "10.1.1", "@types/lodash": "^4.14.155", "@types/prop-types": "^15.7.3", "graphql": "14.7.0", diff --git a/packages/application-shell/package.json b/packages/application-shell/package.json index 3eadced162..33ffc6c222 100644 --- a/packages/application-shell/package.json +++ b/packages/application-shell/package.json @@ -52,6 +52,7 @@ "@commercetools-frontend/url-utils": "17.3.0", "@commercetools-uikit/avatar": "^10.39.8", "@commercetools-uikit/design-system": "^10.39.8", + "@commercetools-uikit/card": "^10.39.8", "@commercetools-uikit/flat-button": "^10.39.8", "@commercetools-uikit/icons": "^10.39.8", "@commercetools-uikit/loading-spinner": "^10.39.8", diff --git a/packages/application-shell/src/components/application-shell-provider/application-shell-provider.tsx b/packages/application-shell/src/components/application-shell-provider/application-shell-provider.tsx index e5ddb43530..3c7bf7c8fb 100644 --- a/packages/application-shell/src/components/application-shell-provider/application-shell-provider.tsx +++ b/packages/application-shell/src/components/application-shell-provider/application-shell-provider.tsx @@ -3,7 +3,8 @@ import type { TApplicationContext } from '@commercetools-frontend/application-sh import type { TAsyncLocaleDataProps } from '@commercetools-frontend/i18n'; import type { TrackingList } from '../../utils/gtm'; -import './global-style-imports'; +// FIXME: support loading css files +// import './global-style-imports'; import '../../track-performance'; import React from 'react'; import { Router } from 'react-router-dom'; diff --git a/packages/application-shell/src/components/application-shell-provider/global-style-imports.ts b/packages/application-shell/src/components/application-shell-provider/global-style-imports.ts index ff87ff2fc4..54744aef50 100644 --- a/packages/application-shell/src/components/application-shell-provider/global-style-imports.ts +++ b/packages/application-shell/src/components/application-shell-provider/global-style-imports.ts @@ -1,3 +1,3 @@ // Global MC styles -import './grid.mod.css'; -import './reset.mod.css'; +import './grid.css'; +import './reset.css'; diff --git a/packages/application-shell/src/components/application-shell-provider/grid.mod.css b/packages/application-shell/src/components/application-shell-provider/grid.css similarity index 74% rename from packages/application-shell/src/components/application-shell-provider/grid.mod.css rename to packages/application-shell/src/components/application-shell-provider/grid.css index bb283b8ff4..1c85773f8b 100644 --- a/packages/application-shell/src/components/application-shell-provider/grid.mod.css +++ b/packages/application-shell/src/components/application-shell-provider/grid.css @@ -3,43 +3,43 @@ TODO: implement a proper layout system with components, or simply use css-grid. */ -:global(.row) { +.row { clear: both; float: left; width: 100%; } -:global(.col-3) { +.col-3 { float: left; width: 25%; } -:global(.col-4) { +.col-4 { float: left; width: 33.333%; } -:global(.col-5) { +.col-5 { float: left; width: 41.666%; } -:global(.col-6) { +.col-6 { float: left; width: 50%; } -:global(.col-7) { +.col-7 { float: left; width: 58.333%; } -:global(.col-8) { +.col-8 { float: left; width: 66.666%; } -:global(.col-12) { +.col-12 { float: left; width: 100%; } diff --git a/packages/application-shell/src/components/application-shell-provider/reset.mod.css b/packages/application-shell/src/components/application-shell-provider/reset.css similarity index 100% rename from packages/application-shell/src/components/application-shell-provider/reset.mod.css rename to packages/application-shell/src/components/application-shell-provider/reset.css diff --git a/packages/application-shell/src/components/navbar/navbar.tsx b/packages/application-shell/src/components/navbar/navbar.tsx index c9eb5f6503..2d852038a4 100644 --- a/packages/application-shell/src/components/navbar/navbar.tsx +++ b/packages/application-shell/src/components/navbar/navbar.tsx @@ -44,12 +44,13 @@ import { RestrictedByPermissions } from '@commercetools-frontend/permissions'; import { location } from '../../utils/location'; import { GtmContext } from '../gtm-booter'; import LoadingPlaceholder from '../loading-placeholder'; -import styles from './navbar.mod.css'; +// import styles from './navbar.mod.css'; import messages from './messages'; import useLoadingMenuLayoutEffect from './use-loading-menu-layout-effect'; import useNavbarStateManager from './use-navbar-state-manager'; import nonNullable from './non-nullable'; +const styles = {}; /* diff --git a/packages/i18n/package.json b/packages/i18n/package.json index a8e666dba8..1abfd41f71 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -45,6 +45,7 @@ "@babel/runtime-corejs3": "7.12.5", "@commercetools-frontend/sentry": "17.3.0", "@commercetools-uikit/i18n": "^10.39.8", + "@emotion/core": "10.1.1", "@types/prop-types": "^15.7.3", "moment": "^2.24.0", "prop-types": "15.7.2" diff --git a/packages/jest-stylelint-runner/index.js b/packages/jest-stylelint-runner/index.js index b20ac251bc..c75f66f569 100644 --- a/packages/jest-stylelint-runner/index.js +++ b/packages/jest-stylelint-runner/index.js @@ -2,4 +2,4 @@ // if this file is missing, and you have a `module` or `main` that points to a non-existing file // (ie, a bundle that hasn't been built yet) then jest will fail if the bundle is not yet built. // all apps should export all their named exports from their root index.js -export * from './src'; +module.exports = require('./src'); diff --git a/packages/l10n/package.json b/packages/l10n/package.json index 83a9096fe6..2e6852f04a 100644 --- a/packages/l10n/package.json +++ b/packages/l10n/package.json @@ -9,12 +9,7 @@ "directory": "packages/l10n" }, "homepage": "https://docs.commercetools.com/custom-applications", - "keywords": [ - "javascript", - "frontend", - "react", - "toolkit" - ], + "keywords": ["javascript", "frontend", "react", "toolkit"], "license": "MIT", "private": false, "publishConfig": { @@ -24,13 +19,7 @@ "module": "dist/l10n.esm.js", "typings": "./dist/typings/src/index.d.ts", "types": "./dist/typings/src/index.d.ts", - "files": [ - "data", - "dist", - "package.json", - "LICENSE", - "README.md" - ], + "files": ["data", "dist", "package.json", "LICENSE", "README.md"], "scripts": { "prepare": "./../../scripts/version.js replace", "prebuild": "rimraf dist/**", @@ -44,6 +33,7 @@ "@babel/runtime": "7.12.5", "@babel/runtime-corejs3": "7.12.5", "@commercetools-frontend/sentry": "17.3.0", + "@emotion/core": "10.1.1", "@types/prop-types": "^15.7.3", "moment": "^2.24.0", "prop-types": "15.7.2" diff --git a/packages/permissions/package.json b/packages/permissions/package.json index 068dc1dc7c..95a5f3222f 100644 --- a/packages/permissions/package.json +++ b/packages/permissions/package.json @@ -32,6 +32,8 @@ "@babel/runtime": "7.12.5", "@babel/runtime-corejs3": "7.12.5", "@commercetools-frontend/application-shell-connectors": "17.3.0", + "@commercetools-frontend/sentry": "17.3.0", + "@emotion/core": "10.1.1", "@types/lodash": "^4.14.155", "@types/prop-types": "^15.7.3", "lodash": "4.17.20", diff --git a/packages/permissions/src/hooks/use-is-authorized/use-is-authorized.ts b/packages/permissions/src/hooks/use-is-authorized/use-is-authorized.ts index 413ff9b593..e425809185 100644 --- a/packages/permissions/src/hooks/use-is-authorized/use-is-authorized.ts +++ b/packages/permissions/src/hooks/use-is-authorized/use-is-authorized.ts @@ -1,4 +1,3 @@ -import React from 'react'; import invariant from 'tiny-invariant'; import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors'; import { reportErrorToSentry } from '@commercetools-frontend/sentry'; @@ -64,7 +63,7 @@ const useIsAuthorized = ({ demandedDataFences?: TDemandedDataFence[]; selectDataFenceData?: TSelectDataFenceData; shouldMatchSomePermissions?: boolean; -}) => { +}): boolean => { const impliedPermissions = getImpliedPermissions(demandedPermissions); invariant( diff --git a/packages/sdk/package.json b/packages/sdk/package.json index d882f0e2b9..e4a128e56d 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -47,8 +47,8 @@ "fast-equals": "2.0.0", "prop-types": "15.7.2", "qss": "2.0.3", - "uuid": "8.3.1", - "unfetch": "4.2.0" + "unfetch": "4.2.0", + "uuid": "8.3.1" }, "devDependencies": { "@types/enzyme": "3.10.8", @@ -56,8 +56,7 @@ "react": "16.14.0", "react-redux": "7.2.2", "redux": "4.0.5", - "redux-thunk": "2.3.0", - "uuid": "8.3.1" + "redux-thunk": "2.3.0" }, "peerDependencies": { "@types/react": "16.x", diff --git a/tsconfig.json b/tsconfig.json index 71ede1992b..684eefc35c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -36,15 +36,12 @@ // ] // }, "typeRoots": ["@types", "node_modules/@types"] - } - // "include": [ - // "jest.d.ts", - // "@types-extensions/*", - // "**/*.spec.ts", - // "**/*.spec.tsx" - // ], - // "exclude": [ - // "**/node_modules", - // "**/dist/**/*" - // ] + }, + "include": [ + "jest.d.ts", + "@types-extensions/*", + "**/*.spec.ts", + "**/*.spec.tsx" + ], + "exclude": ["**/node_modules", "**/dist/**/*"] } diff --git a/yarn.lock b/yarn.lock index 9523b04bf8..30541fde6e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7798,15 +7798,6 @@ babel-plugin-import-graphql@2.7.0: dependencies: graphql-tag "^2.9.2" -babel-plugin-import-postcss@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-import-postcss/-/babel-plugin-import-postcss-2.0.0.tgz#33820b15eda6f41cdd118bcbae6fc2fb515e860f" - integrity sha512-LwF0L956E7MqZtMOVQ7cotVpSpVSSynYyXgksrdli91KIeWdKkaxh8ybYmmyNqitHC0jq+cyWCKnWFn9blc9qQ== - dependencies: - cosmiconfig "^5.2.1" - deasync "^0.1.15" - postcss "^7.0.16" - babel-plugin-istanbul@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz#df4ade83d897a92df069c4d9a25cf2671293c854" @@ -10646,14 +10637,6 @@ de-indent@^1.0.2: resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d" integrity sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0= -deasync@^0.1.15: - version "0.1.21" - resolved "https://registry.yarnpkg.com/deasync/-/deasync-0.1.21.tgz#bb11eabd4466c0d8776f0d82deb8a6126460d30f" - integrity sha512-kUmM8Y+PZpMpQ+B4AuOW9k2Pfx/mSupJtxOsLzmnHY2WqZUYRFccFn2RhzPAqt3Xb+sorK/badW2D4zNzqZz5w== - dependencies: - bindings "^1.5.0" - node-addon-api "^1.7.1" - debounce-async@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/debounce-async/-/debounce-async-0.0.2.tgz#775783edeabff541e8104c96b4754eb42aee84e3" @@ -20242,11 +20225,6 @@ node-abi@^2.7.0: dependencies: semver "^5.4.1" -node-addon-api@^1.7.1: - version "1.7.2" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.2.tgz#3df30b95720b53c24e59948b49532b662444f54d" - integrity sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg== - node-addon-api@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.0.2.tgz#04bc7b83fd845ba785bb6eae25bc857e1ef75681" @@ -22795,7 +22773,7 @@ postcss@^6.0.1, postcss@^6.0.23: source-map "^0.6.1" supports-color "^5.4.0" -postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.21, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.31, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6, postcss@^7.0.7: +postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.21, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.31, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6, postcss@^7.0.7: version "7.0.35" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.35.tgz#d2be00b998f7f211d8a276974079f2e92b970e24" integrity sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==