Remove prepublish script (#12702)

This commit is contained in:
Felix Becker 2020-08-04 20:54:35 +02:00 committed by GitHub
parent d142f1ef4b
commit 75188c68d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 36 additions and 9 deletions

9
.vscode/tasks.json vendored
View File

@ -19,6 +19,15 @@
"runOn": "folderOpen",
},
},
{
"label": "Watch code generation",
"detail": "Watch files and generate types when files are changed",
"type": "npm",
"script": "watch-generate",
"group": "build",
"problemMatcher": [],
"isBackground": true,
},
{
"label": "stylelint",
"command": "yarn",

View File

@ -9,7 +9,7 @@
"dev": "yarn run build-inline-extensions && NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\":\\\"commonjs\\\"}\" node -r ts-node/register scripts/development",
"dev:no-reload": "AUTO_RELOAD=false yarn run dev",
"dev:firefox": "if type web-ext 2>/dev/null; then web-ext run --source-dir ./build/firefox; else echo 'web-ext not found. Install it with: yarn global add web-ext'; exit 1; fi",
"build": "yarn run build-inline-extensions && NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\":\\\"commonjs\\\"}\" node -r ts-node/register scripts/build",
"build": "yarn --cwd .. generate && yarn run build-inline-extensions && NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\":\\\"commonjs\\\"}\" node -r ts-node/register scripts/build",
"release": "yarn release:chrome",
"release:chrome": "webstore upload --auto-publish --source build/bundles/chrome-bundle.zip --extension-id dgjhfomjieaadpoljlnidmbgkdffpack --client-id $GOOGLE_CLIENT_ID --client-secret $GOOGLE_CLIENT_SECRET --refresh-token $GOOGLE_REFRESH_TOKEN",
"release:ff": "./scripts/release-ff.sh",

View File

@ -7,6 +7,9 @@ echo "--- yarn"
yarn --mutex network --frozen-lockfile --network-timeout 60000
yarn --mutex network --cwd dev/release --frozen-lockfile --network-timeout 60000
echo "--- generate"
yarn gulp generate
for cmd in "$@"; do
echo "--- $cmd"
yarn -s run "$cmd"

View File

@ -6,6 +6,9 @@ echo "--- yarn in root"
# mutex is necessary since CI runs various yarn installs in parallel
yarn --mutex network --frozen-lockfile --network-timeout 60000
echo "--- generate"
yarn gulp generate
cd "$1"
echo "--- test"

View File

@ -129,6 +129,7 @@ func addSharedTests(c Config) func(pipeline *bk.Pipeline) {
pipeline.AddStep(":chromatic:",
bk.AutomaticRetry(5),
bk.Cmd("yarn --mutex network --frozen-lockfile --network-timeout 60000"),
bk.Cmd("yarn gulp generate"),
bk.Cmd(chromaticCommand))
// Shared tests

View File

@ -16,6 +16,11 @@ const { webpack: webWebpack, webpackDevServer: webWebpackDevServer } = require('
*/
const generate = gulp.parallel(schema, graphQlSchema, graphQlOperations)
/**
* Generates files needed for builds whenever files change.
*/
const watchGenerate = gulp.series(generate, gulp.parallel(watchSchema, watchGraphQlSchema, watchGraphQlOperations))
/**
* Builds everything.
*/
@ -24,13 +29,11 @@ const build = gulp.series(generate, webWebpack)
/**
* Watches everything and rebuilds on file changes.
*/
const watch = gulp.series(
generate,
gulp.parallel(watchSchema, watchGraphQlSchema, watchGraphQlOperations, webWebpackDevServer)
)
const watch = gulp.series(generate, gulp.parallel(watchGenerate, webWebpackDevServer))
module.exports = {
generate,
watchGenerate,
build,
watch,
schema,

View File

@ -18,8 +18,9 @@
"all:tsgql": "yarn --cwd web run tsgql validate -p . --exitOnWarn && yarn --cwd shared run tsgql validate -p . --exitOnWarn && yarn --cwd browser run tsgql validate -p . --exitOnWarn",
"build-ts": "tsc -b .",
"graphql-lint": "graphql-schema-linter --old-implements-syntax --comment-descriptions cmd/frontend/graphqlbackend/schema.graphql",
"prepublish": "gulp generate",
"build-web": "yarn --cwd web run build",
"generate": "gulp generate",
"watch-generate": "gulp watchGenerate",
"test": "jest --testPathIgnorePatterns end-to-end regression integration storybook",
"test-integration": "TS_NODE_PROJECT=web/src/integration/tsconfig.json NODE_NO_WARNINGS=1 mocha ./web/src/integration/**/*.test.ts",
"cover-integration": "nyc --hook-require=false yarn test-integration",

View File

@ -4,7 +4,14 @@ const log = require('fancy-log')
const gulp = require('gulp')
const createWebpackCompiler = require('webpack')
const WebpackDevServer = require('webpack-dev-server')
const { graphQlSchema, schema, watchGraphQlSchema, watchSchema } = require('../shared/gulpfile')
const {
graphQlSchema,
graphQlOperations,
schema,
watchGraphQlSchema,
watchGraphQlOperations,
watchSchema,
} = require('../shared/gulpfile')
const webpackConfig = require('./webpack.config')
const WEBPACK_STATS_OPTIONS = {
@ -72,7 +79,7 @@ async function webpackDevelopmentServer() {
/**
* Builds everything.
*/
const build = gulp.parallel(gulp.series(gulp.parallel(schema, graphQlSchema), gulp.parallel(webpack)))
const build = gulp.series(gulp.parallel(schema, graphQlOperations, graphQlSchema), gulp.parallel(webpack))
/**
* Watches everything and rebuilds on file changes.
@ -80,7 +87,7 @@ const build = gulp.parallel(gulp.series(gulp.parallel(schema, graphQlSchema), gu
const watch = gulp.series(
// Ensure the typings that TypeScript depends on are build to avoid first-time-run errors
gulp.parallel(schema, graphQlSchema),
gulp.parallel(watchSchema, watchGraphQlSchema, webpackDevelopmentServer)
gulp.parallel(watchSchema, watchGraphQlSchema, watchGraphQlOperations, webpackDevelopmentServer)
)
module.exports = { build, watch, webpackDevServer: webpackDevelopmentServer, webpack }