Skip to content

Commit

Permalink
chore: setup preconstruct (except for app-shell)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmenko committed Nov 25, 2020
1 parent 7b2be80 commit d5f3e1a
Show file tree
Hide file tree
Showing 71 changed files with 475 additions and 499 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ dist
dist-tarballs
public
packages/application-shell/test-utils
packages/application-shell-connectors/test-utils
packages/sdk/test-utils

# Editor/IDE
.idea
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
presets: ['@commercetools-frontend/babel-preset-mc-app'],
plugins: [
'babel-plugin-import-graphql',
'babel-plugin-typescript-to-proptypes',
],
};
40 changes: 33 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
"license": "MIT",
"private": true,
"scripts": {
"postinstall": "preconstruct dev",
"auth": "npm_config_registry=https://registry.npmjs.org npm whoami",
"clean": "lerna exec 'rm -rf build dist'",
"clean": "lerna exec 'rm -rf build dist test-utils/dist'",
"extract-intl": "formatjs extract --format=$(pwd)/packages/i18n/transifex-transformer.js --out-file=$(pwd)/packages/i18n/data/core.json 'packages/**/*messages.ts'",
"compile-intl": "yarn --cwd packages/i18n compile-data",
"l10n:build": "pushd packages/l10n; yarn generate-data",
Expand Down Expand Up @@ -43,11 +44,10 @@
"template-starter:build": "yarn --cwd application-templates/starter build",
"template-starter:start": "yarn --cwd application-templates/starter start",
"template-starter:start:prod:local": "yarn --cwd application-templates/starter start:prod:local",
"build": "NODE_ENV=production lerna run build --no-private",
"build:typings": "NODE_ENV=production lerna run build:typings --no-private",
"build:bundles": "NODE_ENV=production lerna run build:bundles --no-private",
"build:bundles:watch": "NODE_ENV=development lerna run --no-private --parallel build:bundles:watch",
"build:website": "yarn build --scope '@commercetools-frontend/application-components' --include-dependencies && yarn --cwd website build && yarn --cwd website-components-playground build",
"prebuild": "lerna run prebuild --no-private",
"build": "preconstruct build && yarn workspace @commercetools-frontend/application-shell run build",
"build:watch": "preconstruct watch & yarn workspace @commercetools-frontend/application-shell run build:bundles:watch",
"build:website": "yarn build && yarn --cwd website build && yarn --cwd website-components-playground build",
"now-build": "yarn build:website && rm -rf public && mv website/public public",
"labels:sync": "github-labels sync",
"generate-types:mc": "./scripts/graphql-cli.sh codegen --project mc",
Expand All @@ -68,7 +68,30 @@
"website-components-playground"
]
},
"devDependencies": {
"preconstruct": {
"packages": [
"packages/actions-global",
"packages/application-components",
"packages/application-config",
"packages/application-shell-connectors",
"packages/browser-history",
"packages/constants",
"packages/create-mc-app",
"packages/i18n",
"packages/l10n",
"packages/mc-html-template",
"packages/mc-scripts",
"packages/notifications",
"packages/permissions",
"packages/react-notifications",
"packages/sdk",
"packages/sentry",
"packages/url-utils",
"packages-backend/express",
"packages-backend/loggers"
]
},
"dependencies": {
"@babel/cli": "7.12.7",
"@babel/core": "7.12.7",
"@changesets/changelog-github": "0.2.7",
Expand All @@ -91,14 +114,17 @@
"@graphql-codegen/typescript-operations": "1.17.10",
"@percy/cypress": "2.3.2",
"@percy/puppeteer": "1.1.0",
"@preconstruct/cli": "2.0.0",
"@rollup/plugin-babel": "5.2.1",
"@rollup/plugin-commonjs": "16.0.0",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "10.0.0",
"@testing-library/cypress": "7.0.1",
"@testing-library/react": "11.2.2",
"@types/jest-environment-puppeteer": "4.4.0",
"@types/jquery": "3.5.4",
"@types/node": "14.14.9",
"@types/puppeteer": "5.4.0",
"@types/react": "16.14.2",
"@types/react-dom": "16.9.10",
"@types/react-redux": "7.1.11",
Expand Down
13 changes: 5 additions & 8 deletions packages-backend/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
"publishConfig": {
"access": "public"
},
"main": "./build/index.js",
"typings": "./build/index.d.ts",
"types": "./build/index.d.ts",
"files": ["build", "package.json", "LICENSE", "README.md"],
"scripts": {
"prebuild": "rimraf build/**",
"build": "tsc -p tsconfig.build.json"
},
"main": "dist/commercetools-backend-express.cjs.js",
"module": "dist/commercetools-backend-express.esm.js",
"files": ["dist", "package.json", "LICENSE", "README.md"],
"dependencies": {
"@babel/runtime": "7.12.5",
"@babel/runtime-corejs3": "7.12.5",
"@types/node": "14.14.9",
"express": "4.17.1",
"express-jwt": "6.0.0",
Expand Down
12 changes: 0 additions & 12 deletions packages-backend/express/tsconfig.build.json

This file was deleted.

3 changes: 0 additions & 3 deletions packages-backend/express/tsconfig.json

This file was deleted.

13 changes: 5 additions & 8 deletions packages-backend/loggers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@
"publishConfig": {
"access": "public"
},
"main": "./build/index.js",
"typings": "./build/index.d.ts",
"types": "./build/index.d.ts",
"files": ["build", "package.json", "LICENSE", "README.md"],
"scripts": {
"prebuild": "rimraf build/**",
"build": "tsc -p tsconfig.build.json"
},
"main": "dist/commercetools-backend-loggers.cjs.js",
"module": "dist/commercetools-backend-loggers.esm.js",
"files": ["dist", "package.json", "LICENSE", "README.md"],
"dependencies": {
"@babel/runtime": "7.12.5",
"@babel/runtime-corejs3": "7.12.5",
"@sentry/node": "5.27.6",
"@types/triple-beam": "1.3.2",
"express-winston": "4.0.5",
Expand Down
11 changes: 0 additions & 11 deletions packages-backend/loggers/tsconfig.build.json

This file was deleted.

3 changes: 0 additions & 3 deletions packages-backend/loggers/tsconfig.json

This file was deleted.

15 changes: 4 additions & 11 deletions packages/actions-global/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,21 @@
"publishConfig": {
"access": "public"
},
"main": "./dist/actions-global.cjs.js",
"module": "./dist/actions-global.es.js",
"typings": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.ts",
"main": "dist/commercetools-frontend-actions-global.cjs.js",
"module": "dist/commercetools-frontend-actions-global.esm.js",
"files": ["dist", "package.json", "LICENSE", "README.md"],
"scripts": {
"prepare": "./../../scripts/version.js replace",
"prebuild": "rimraf dist/**",
"build": "yarn build:bundles && yarn build:typings",
"build:bundles": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js -i ./src/index.ts",
"build:bundles:watch": "yarn build:bundles -w",
"build:typings": "cross-env tsc -p tsconfig.declarations.json --emitDeclarationOnly --declarationDir dist/typings"
"prepare": "./../../scripts/version.js replace"
},
"dependencies": {
"@babel/runtime": "7.12.5",
"@babel/runtime-corejs3": "7.12.5",
"@commercetools-frontend/browser-history": "17.3.0",
"@commercetools-frontend/constants": "17.3.0",
"@commercetools-frontend/notifications": "17.3.0",
"@commercetools-frontend/sentry": "17.4.1",
"@types/lodash": "^4.14.155",
"lodash": "4.17.20",
"lodash-es": "4.17.15",
"redux-thunk": "2.3.0"
},
"devDependencies": {
Expand Down
6 changes: 0 additions & 6 deletions packages/actions-global/tsconfig.declarations.json

This file was deleted.

4 changes: 0 additions & 4 deletions packages/actions-global/tsconfig.json

This file was deleted.

17 changes: 6 additions & 11 deletions packages/application-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
"publishConfig": {
"access": "public"
},
"main": "./dist/application-components.cjs.js",
"module": "./dist/application-components.es.js",
"typings": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.ts",
"main": "dist/commercetools-frontend-application-components.cjs.js",
"module": "dist/commercetools-frontend-application-components.esm.js",
"files": [
"dist",
"materials/media-queries.css",
Expand All @@ -27,12 +25,7 @@
"README.md"
],
"scripts": {
"prepare": "./../../scripts/version.js replace",
"prebuild": "rimraf dist/**",
"build": "yarn build:bundles && yarn build:typings",
"build:bundles": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js -i ./src/index.ts",
"build:bundles:watch": "yarn build:bundles -w",
"build:typings": "cross-env tsc -p tsconfig.declarations.json --emitDeclarationOnly --declarationDir dist/typings"
"prepare": "./../../scripts/version.js replace"
},
"dependencies": {
"@babel/runtime": "7.12.5",
Expand All @@ -42,7 +35,10 @@
"@commercetools-frontend/i18n": "17.4.1",
"@commercetools-uikit/card": "^10.42.2",
"@commercetools-uikit/constraints": "^10.42.2",
"@commercetools-uikit/flat-button": "^10.42.2",
"@commercetools-uikit/design-system": "^10.42.2",
"@commercetools-uikit/icon-button": "^10.42.2",
"@commercetools-uikit/icons": "^10.42.2",
"@commercetools-uikit/primary-button": "^10.42.2",
"@commercetools-uikit/secondary-button": "^10.42.2",
"@commercetools-uikit/secondary-icon-button": "^10.42.2",
Expand All @@ -54,7 +50,6 @@
"@types/prop-types": "^15.7.3",
"@types/react-modal": "^3.10.4",
"lodash": "4.17.20",
"lodash-es": "4.17.15",
"prop-types": "15.7.2",
"react-modal": "3.12.1",
"react-required-if": "1.0.3"
Expand Down
41 changes: 5 additions & 36 deletions packages/application-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,15 @@
"publishConfig": {
"access": "public"
},
"main": "./build/index.js",
"module": "./build/index.js",
"main": "dist/commercetools-frontend-application-config.cjs.js",
"module": "dist/commercetools-frontend-application-config.esm.js",
"typings": "./build/typings/src/index.d.ts",
"types": "./build/typings/src/index.d.ts",
"files": ["build", "schema.json", "package.json", "LICENSE", "README.md"],
"files": ["dist", "schema.json", "package.json", "LICENSE", "README.md"],
"scripts": {
"prepare": "./../../scripts/version.js replace",
"prebuild": "rimraf build/**",
"build": "yarn build:schema && yarn build:bundles && yarn build:typings",
"build:schema": "json2ts schema.json src/schema.ts --style.singleQuote --bannerComment '/* eslint-disable prettier/prettier */\n// This file was automatically generated by json-schema-to-typescript.\n// DO NOT MODIFY IT BY HAND. Instead, modify the source schema.json file.'",
"build:bundles": "babel src --out-dir build --extensions .ts --ignore src/types.ts,src/schema.ts",
"build:bundles:watch": "yarn build:bundles -w",
"build:typings": "cross-env tsc -p tsconfig.declarations.json --emitDeclarationOnly --declarationDir build/typings"
"prebuild": "yarn build:schema",
"build:schema": "json2ts schema.json src/schema.ts --style.singleQuote --bannerComment '/* eslint-disable prettier/prettier */\n// This file was automatically generated by json-schema-to-typescript.\n// DO NOT MODIFY IT BY HAND. Instead, modify the source schema.json file.'"
},
"dependencies": {
"@babel/runtime": "7.12.5",
Expand All @@ -39,38 +35,11 @@
"omit-empty-es": "1.0.3"
},
"devDependencies": {
"@babel/plugin-transform-runtime": "7.12.1",
"@babel/preset-env": "7.12.7",
"@babel/preset-typescript": "7.12.7",
"json-schema-to-typescript": "9.1.1",
"shelljs": "0.8.4"
},
"engines": {
"node": ">=10",
"npm": ">=5"
},
"babel": {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "10"
},
"modules": "commonjs",
"useBuiltIns": "usage",
"corejs": 3
}
],
"@babel/preset-typescript"
],
"plugins": [
[
"@babel/plugin-transform-runtime",
{
"corejs": 3
}
]
]
}
}
6 changes: 0 additions & 6 deletions packages/application-config/tsconfig.declarations.json

This file was deleted.

4 changes: 0 additions & 4 deletions packages/application-config/tsconfig.json

This file was deleted.

20 changes: 7 additions & 13 deletions packages/application-shell-connectors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,25 @@
"publishConfig": {
"access": "public"
},
"main": "./dist/application-shell-connectors.cjs.js",
"module": "./dist/application-shell-connectors.es.js",
"typings": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.ts",
"main": "dist/commercetools-frontend-application-shell-connectors.cjs.js",
"module": "dist/commercetools-frontend-application-shell-connectors.esm.js",
"files": ["dist", "test-utils", "package.json", "LICENSE", "README.md"],
"preconstruct": {
"entrypoints": ["./index.ts", "./test-utils/index.ts"]
},
"scripts": {
"prepare": "./../../scripts/version.js replace",
"prebuild": "rimraf dist/** test-utils/**",
"build": "yarn build:bundles && yarn build:test-utils && yarn build:typings",
"build:bundles": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js -i ./src/index.ts",
"build:bundles:watch": "yarn build:bundles -w",
"build:test-utils": "cross-env NODE_ENV=development rollup -c ../../rollup.config.js -i ./src/test-utils/index.ts",
"build:typings": "cross-env tsc -p tsconfig.declarations.json --emitDeclarationOnly --declarationDir dist/typings",
"postbuild:typings": "echo \"export * from '../dist/typings/test-utils';\" > test-utils/index.d.ts"
"prepare": "./../../scripts/version.js replace"
},
"dependencies": {
"@babel/runtime": "7.12.5",
"@babel/runtime-corejs3": "7.12.5",
"@commercetools-frontend/constants": "17.3.0",
"@commercetools-frontend/sentry": "17.4.1",
"@emotion/react": "11.1.1",
"@types/lodash": "^4.14.155",
"@types/prop-types": "^15.7.3",
"graphql": "14.7.0",
"lodash": "4.17.20",
"lodash-es": "4.17.15",
"moment-timezone": "^0.5.26",
"prop-types": "15.7.2"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/application-shell-connectors/test-utils/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"main": "dist/commercetools-frontend-application-shell-connectors-test-utils.cjs.js",
"module": "dist/commercetools-frontend-application-shell-connectors-test-utils.esm.js"
}

This file was deleted.

4 changes: 0 additions & 4 deletions packages/application-shell-connectors/tsconfig.json

This file was deleted.

Loading

0 comments on commit d5f3e1a

Please sign in to comment.