Skip to content

Commit

Permalink
Add calypso:main field to packages, rename build tasks, don't build p…
Browse files Browse the repository at this point in the history
…ackages on every Calypso build
  • Loading branch information
jsnajdr committed Jun 25, 2020
1 parent 6a76b55 commit 3bf05d8
Show file tree
Hide file tree
Showing 21 changed files with 49 additions and 50 deletions.
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -56,7 +56,7 @@
"autoprefixer": "check-npm-client && postcss -u autoprefixer -r --no-map --config packages/calypso-build/postcss.config.js",
"postcss": "check-npm-client && postcss -r --config packages/calypso-build/postcss.config.js",
"prebuild": "check-npm-client && yarn run install-if-deps-outdated",
"build": "check-npm-client && yarn run build-static && yarn run build-packages && yarn run build-css && run-p -s build-devdocs:* && run-p -s build-server build-client-if-prod build-client-if-desktop",
"build": "check-npm-client && yarn run build-static && yarn run build-css && run-p -s build-devdocs:* && run-p -s build-server build-client-if-prod build-client-if-desktop",
"build-css": "check-npm-client && run-p -s build-css:*",
"build-css:directly": "check-npm-client && node-sass --importer node_modules/node-sass-package-importer/dist/cli.js --include-path client client/assets/stylesheets/directly.scss public/directly.css --output-style compressed && yarn run -s postcss public/directly.css",
"build-css:editor": "check-npm-client && node-sass --importer node_modules/node-sass-package-importer/dist/cli.js --include-path client client/assets/stylesheets/editor.scss public/editor.css --output-style compressed && yarn run -s postcss public/editor.css",
Expand All @@ -75,8 +75,8 @@
"build-client-if-prod": "check-npm-client && node -e \"process.env.CALYPSO_ENV === 'production' && process.exit(1)\" || yarn run build-client-both",
"build-client-if-desktop": "check-npm-client && node -e \"(process.env.CALYPSO_ENV === 'desktop' || process.env.CALYPSO_ENV === 'desktop-development') && process.exit(1)\" || yarn run build-client-fallback",
"build-client-stats": "check-npm-client && NODE_ENV=production CALYPSO_ENV=production EMIT_STATS=true PROGRESS=true yarn run build-client-evergreen",
"build-packages": "check-npm-client && npx lerna run prepare --stream",
"build-packages:watch": "check-npm-client && node bin/watch-packages-and-rebuild.js",
"prepare-packages": "check-npm-client && npx lerna run prepare --stream",
"build-packages": "check-npm-client && npx lerna run build --stream",
"build-languages": "check-npm-client && yarn run translate && node bin/build-languages.js",
"build-languages-if-enabled": "check-npm-client && node -e \"(process.env.BUILD_TRANSLATION_CHUNKS === 'true' || process.env.ENABLE_FEATURES === 'use-translation-chunks') && process.exit(1)\" || yarn run build-languages",
"clean": "check-npm-client && yarn run clean:packages && yarn run clean:build && yarn run clean:public && yarn run clean:translations",
Expand All @@ -90,7 +90,7 @@
"eslint-branch": "check-npm-client && node bin/eslint-branch.js",
"install-if-deps-outdated": "check-npm-client && node bin/install-if-deps-outdated.js",
"install-if-no-packages": "check-npm-client && node bin/install-if-no-packages.js",
"postinstall": "check-npm-client && yarn run build-packages",
"postinstall": "check-npm-client && yarn run prepare-packages",
"lint": "check-npm-client && run-s -s lint:*",
"lint:config-defaults": "check-npm-client && node bin/validate-config-keys.js",
"lint:css": "check-npm-client && stylelint \"**/*.scss\" --syntax scss",
Expand All @@ -99,7 +99,7 @@
"lint:package-json": "check-npm-client && npmPkgJsonLint './package.json' './client/package.json' './packages/*/package.json' './apps/*/package.json'",
"prestart": "check-npm-client && npx check-node-version --package && yarn run install-if-deps-outdated && node bin/welcome.js",
"start": "check-npm-client && yarn run -s build",
"poststart": "check-npm-client && run-p -s start-build-if-web start-build-if-desktop build-packages:watch",
"poststart": "check-npm-client && run-p -s start-build-if-web start-build-if-desktop",
"start-fallback": "check-npm-client && DEV_TARGET=fallback yarn run start",
"start-jetpack-cloud": "check-npm-client && CALYPSO_ENV=jetpack-cloud-development yarn start",
"reformat-files": "check-npm-client && ./node_modules/.bin/prettier --ignore-path .eslintignore --write \"**/*.{js,jsx,json,ts,tsx}\"",
Expand Down
8 changes: 4 additions & 4 deletions packages/browser-data-collector/package.json
Expand Up @@ -5,8 +5,9 @@
"homepage": "https://github.com/Automattic/wp-calypso",
"license": "GPL-2.0-or-later",
"author": "Automattic Inc.",
"main": "dist/cjs/index",
"module": "dist/esm/index",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/Automattic/wp-calypso.git",
Expand All @@ -18,8 +19,7 @@
},
"scripts": {
"clean": "check-npm-client && npx rimraf dist \"../../.tsc-cache/packages__browser-data-collector*\"",
"prepublish": "check-npm-client && yarn run clean",
"prepare": "check-npm-client && tsc --project ./tsconfig.json && tsc --project ./tsconfig-cjs.json",
"build": "check-npm-client && tsc --project ./tsconfig.json && tsc --project ./tsconfig-cjs.json",
"watch": "check-npm-client && tsc --project ./tsconfig.json --watch"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/calypso-analytics/package.json
Expand Up @@ -6,8 +6,9 @@
"license": "GPL-2.0-or-later",
"author": "Automattic Inc.",
"sideEffects": true,
"main": "dist/cjs/index",
"module": "dist/esm/index",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/Automattic/wp-calypso.git",
Expand All @@ -26,8 +27,7 @@
},
"scripts": {
"clean": "check-npm-client && npx rimraf dist \"../../.tsc-cache/packages__calypso-analytics*\"",
"prepublish": "check-npm-client && yarn run clean",
"prepare": "check-npm-client && tsc --project ./tsconfig.json && tsc --project ./tsconfig-cjs.json",
"build": "check-npm-client && tsc --project ./tsconfig.json && tsc --project ./tsconfig-cjs.json",
"watch": "check-npm-client && tsc --project ./tsconfig.json --watch"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/package.json
Expand Up @@ -7,6 +7,7 @@
"author": "Automattic Inc.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.js",
"sideEffects": [
"*.css",
"*.scss"
Expand Down Expand Up @@ -41,7 +42,6 @@
},
"scripts": {
"clean": "check-npm-client && npx rimraf dist \"../../.tsc-cache/packages__components*\"",
"prepublish": "check-npm-client && yarn run clean",
"prepare": "check-npm-client && transpile && tsc && copy-assets"
"build": "check-npm-client && transpile && tsc && copy-assets"
}
}
4 changes: 2 additions & 2 deletions packages/composite-checkout/package.json
Expand Up @@ -4,11 +4,11 @@
"description": "A checkout component for Automattic brands",
"main": "dist/cjs/public-api.js",
"module": "dist/esm/public-api.js",
"calypso:main": "src/public-api.js",
"sideEffects": false,
"scripts": {
"clean": "check-npm-client && npx rimraf dist",
"prepublish": "check-npm-client && yarn run clean",
"prepare": "check-npm-client && transpile"
"build": "check-npm-client && transpile"
},
"files": [
"dist",
Expand Down
4 changes: 2 additions & 2 deletions packages/data-stores/package.json
Expand Up @@ -7,6 +7,7 @@
"author": "Automattic Inc.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.ts",
"sideEffects": false,
"repository": {
"type": "git",
Expand All @@ -27,8 +28,7 @@
"types": "dist/types",
"scripts": {
"clean": "check-npm-client && npx rimraf dist \"../../.tsc-cache/packages__data-stores*\"",
"prepare": "check-npm-client && tsc --project ./tsconfig.json && tsc --project ./tsconfig-cjs.json",
"prepublish": "check-npm-client && yarn run clean",
"build": "check-npm-client && tsc --project ./tsconfig.json && tsc --project ./tsconfig-cjs.json",
"watch": "check-npm-client && tsc --project ./tsconfig.json --watch"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/domain-picker/package.json
Expand Up @@ -7,6 +7,7 @@
"author": "Automattic Inc.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.tsx",
"sideEffects": [
"*.css",
"*.scss"
Expand All @@ -25,8 +26,7 @@
"types": "dist/types",
"scripts": {
"clean": "check-npm-client && npx rimraf dist ../../.tsc-cache/packages__domain-picker*",
"prepare": "check-npm-client && tsc --project ./tsconfig.json && tsc --project ./tsconfig-cjs.json && copy-assets",
"prepublish": "check-npm-client && yarn run clean",
"build": "check-npm-client && tsc --project ./tsconfig.json && tsc --project ./tsconfig-cjs.json && copy-assets",
"watch": "check-npm-client && tsc --project ./tsconfig.json --watch"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/format-currency/package.json
Expand Up @@ -4,6 +4,7 @@
"description": "JavaScript library for formatting currency",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.js",
"sideEffects": false,
"repository": {
"type": "git",
Expand All @@ -29,8 +30,7 @@
},
"scripts": {
"clean": "check-npm-client && npx rimraf dist",
"prepublish": "check-npm-client && yarn run clean",
"prepare": "check-npm-client && transpile"
"build": "check-npm-client && transpile"
},
"types": "types"
}
4 changes: 2 additions & 2 deletions packages/i18n-calypso/package.json
Expand Up @@ -4,6 +4,7 @@
"description": "i18n JavaScript library on top of Tannin originally used in Calypso",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.js",
"types": "types/index.d.ts",
"sideEffects": false,
"repository": {
Expand Down Expand Up @@ -38,7 +39,6 @@
},
"scripts": {
"clean": "check-npm-client && npx rimraf dist",
"prepublish": "check-npm-client && yarn run clean",
"prepare": "check-npm-client && transpile"
"build": "check-npm-client && transpile"
}
}
4 changes: 2 additions & 2 deletions packages/load-script/package.json
Expand Up @@ -4,6 +4,7 @@
"description": "Async Script Loader.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.js",
"keywords": [
"wordpress"
],
Expand All @@ -28,7 +29,6 @@
},
"scripts": {
"clean": "check-npm-client && npx rimraf dist",
"prepublish": "check-npm-client && yarn run clean",
"prepare": "check-npm-client && transpile"
"build": "check-npm-client && transpile"
}
}
4 changes: 2 additions & 2 deletions packages/media-library/package.json
Expand Up @@ -7,6 +7,7 @@
"author": "Automattic Inc.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/Automattic/wp-calypso.git",
Expand All @@ -26,7 +27,6 @@
"dependencies": {},
"scripts": {
"clean": "check-npm-client && npx rimraf dist types \"../../.tsc-cache/packages__media-library*\"",
"prepublish": "check-npm-client && yarn run clean",
"prepare": "check-npm-client && transpile && tsc && copy-assets"
"build": "check-npm-client && transpile && tsc && copy-assets"
}
}
4 changes: 2 additions & 2 deletions packages/photon/package.json
Expand Up @@ -4,6 +4,7 @@
"description": "JavaScript library for the WordPress.com Photon image manipulation service",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.js",
"sideEffects": false,
"repository": {
"type": "git",
Expand Down Expand Up @@ -38,7 +39,6 @@
},
"scripts": {
"clean": "check-npm-client && npx rimraf dist",
"prepublish": "check-npm-client && yarn run clean",
"prepare": "check-npm-client && transpile"
"build": "check-npm-client && transpile"
}
}
5 changes: 2 additions & 3 deletions packages/plans-grid/package.json
Expand Up @@ -7,6 +7,7 @@
"author": "Automattic Inc.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.ts",
"sideEffects": [
"*.css",
"*.scss"
Expand All @@ -22,11 +23,9 @@
"bugs": {
"url": "https://github.com/Automattic/wp-calypso/issues"
},
"types": "dist/types",
"scripts": {
"clean": "check-npm-client && npx rimraf dist ../../.tsc-cache/packages__plans-grid*",
"prepare": "check-npm-client && tsc --project ./tsconfig.json && tsc --project ./tsconfig-cjs.json && copy-assets",
"prepublish": "check-npm-client && yarn run clean",
"build": "check-npm-client && tsc --project ./tsconfig.json && tsc --project ./tsconfig-cjs.json && copy-assets",
"watch": "check-npm-client && tsc --project ./tsconfig.json --watch"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/popup-monitor/package.json
Expand Up @@ -4,6 +4,7 @@
"description": "Utility to facilitate the monitoring of a popup window close action.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.js",
"sideEffects": false,
"keywords": [
"wordpress",
Expand All @@ -29,8 +30,7 @@
],
"scripts": {
"clean": "npx rimraf dist",
"prepublish": "yarn run clean",
"prepare": "transpile"
"build": "transpile"
},
"dependencies": {
"lodash": "^4.17.15"
Expand Down
4 changes: 2 additions & 2 deletions packages/react-i18n/package.json
Expand Up @@ -7,6 +7,7 @@
"author": "Automattic Inc.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.tsx",
"sideEffects": false,
"repository": {
"type": "git",
Expand All @@ -26,8 +27,7 @@
"types": "dist/types",
"scripts": {
"clean": "check-npm-client && npx rimraf dist ../../.tsc-cache/packages__react-i18n*",
"prepare": "check-npm-client && tsc --project ./tsconfig.json && tsc --project ./tsconfig-cjs.json",
"prepublish": "check-npm-client && yarn run clean",
"build": "check-npm-client && tsc --project ./tsconfig.json && tsc --project ./tsconfig-cjs.json",
"watch": "check-npm-client && tsc --project ./tsconfig.json --watch"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/request-external-access/package.json
Expand Up @@ -4,6 +4,7 @@
"description": "Utility for requesting authorization of sharing services.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.js",
"sideEffects": false,
"keywords": [
"wordpress",
Expand All @@ -30,8 +31,7 @@
],
"scripts": {
"clean": "npx rimraf dist",
"prepublish": "yarn run clean",
"prepare": "transpile"
"build": "transpile"
},
"dependencies": {
"@automattic/popup-monitor": "^1.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/tree-select/package.json
Expand Up @@ -11,6 +11,7 @@
"license": "GPL-2.0-or-later",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.js",
"sideEffects": false,
"repository": {
"type": "git",
Expand All @@ -29,7 +30,6 @@
],
"scripts": {
"clean": "check-npm-client && npx rimraf dist",
"prepublish": "check-npm-client && yarn run clean",
"prepare": "check-npm-client && transpile"
"build": "check-npm-client && transpile"
}
}
4 changes: 2 additions & 2 deletions packages/viewport-react/package.json
Expand Up @@ -4,6 +4,7 @@
"description": "React helpers for tracking viewport changes",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.js",
"sideEffects": false,
"repository": {
"type": "git",
Expand All @@ -26,8 +27,7 @@
},
"scripts": {
"clean": "check-npm-client && npx rimraf dist",
"prepublish": "check-npm-client && yarn run clean",
"prepare": "check-npm-client && transpile"
"build": "check-npm-client && transpile"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/viewport/package.json
Expand Up @@ -4,6 +4,7 @@
"description": "Vanilla helpers for tracking viewport changes",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.js",
"sideEffects": false,
"repository": {
"type": "git",
Expand All @@ -18,8 +19,7 @@
"homepage": "https://github.com/Automattic/wp-calypso/tree/master/packages/viewport#readme",
"scripts": {
"clean": "check-npm-client && npx rimraf dist",
"prepublish": "check-npm-client && yarn run clean",
"prepare": "check-npm-client && transpile"
"build": "check-npm-client && transpile"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/wpcom-proxy-request/package.json
Expand Up @@ -4,6 +4,7 @@
"description": "Proxied cookie-authenticated REST API requests to WordPress.com",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.js",
"sideEffects": false,
"keywords": [
"browser",
Expand Down Expand Up @@ -37,8 +38,7 @@
"types": "types",
"scripts": {
"clean": "check-npm-client && npx rimraf dist",
"prepublish": "check-npm-client && npm run clean",
"prepare": "check-npm-client && transpile"
"build": "check-npm-client && transpile"
},
"dependencies": {
"@babel/runtime": "^7.8.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/wpcom.js/package.json
Expand Up @@ -4,12 +4,12 @@
"version": "6.0.0",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"calypso:main": "src/index.js",
"author": "Automattic, Inc.",
"private": true,
"scripts": {
"clean": "check-npm-client && npx rimraf dist",
"prepublish": "check-npm-client && yarn run clean",
"prepare": "check-npm-client && run-s build:modules build:bundle",
"build": "check-npm-client && run-s build:modules build:bundle",
"build:modules": "check-npm-client && transpile && copy-assets",
"build:bundle": "check-npm-client && webpack --display errors-only"
},
Expand Down

0 comments on commit 3bf05d8

Please sign in to comment.