Skip to content

Commit

Permalink
fix: test output, webpack resolution, clean build
Browse files Browse the repository at this point in the history
- remove build test output for ts
- actual clean build (use rimraf not rm -rf)
- remove css bundling workaround, use seperate entrypoint for webpack bundle vs css
  • Loading branch information
acao committed Dec 9, 2019
1 parent 19d8d7f commit 3b1c2c1
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 32 deletions.
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
"packages/*",
"packages/examples/*"
],
"browserify-shim": {
"react": "global:React",
"react-dom": "global:ReactDOM"
},
"browser": {
"copy-to-clipboard": "./node-modules/copy-to-clipboard/index.js"
},
"husky": {
"hooks": {
"pre-commit": "yarn lint",
Expand All @@ -22,7 +15,7 @@
"build": "yarn run build-clean && yarn build-ts && yarn build-js",
"build-js": "lerna run build --scope codemirror-graphql --scope graphql-language-service-server --scope graphiql graphql-language-service",
"build-ts": "tsc --build",
"build-clean": "tsc --build --clean && rm -rf 'packages/**/src/{dist,esm,bundle}' && lerna run build-clean --parallel",
"build-clean": "tsc --build --clean && rimraf 'packages/**/{dist,esm,bundle,coverage}' && lerna run build-clean --parallel",
"build-demo": "lerna run build-demo",
"build-bundles": "lerna run build-bundles",
"test": "yarn run lint && yarn run check && yarn run build && yarn run testonly && yarn build-bundles && yarn run e2e && yarn build-demo",
Expand Down
4 changes: 2 additions & 2 deletions packages/graphiql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"analyze-bundle": "cross-env NODE_ENV=production CDN=1 ANALYZE=1 yarn webpack -p",
"build": "yarn build-clean && yarn build-cjs && yarn build-esm && yarn build-flow",
"build-clean": "rimraf esm dist",
"build-cjs": "babel src --ignore __tests__ --out-dir dist/ && mkdirp dist/css && copy 'src/css/*.css' dist/css",
"build-esm": "cross-env ESM=1 babel src --ignore __tests__ --out-dir esm/ && mkdirp dist/css && copy 'src/css/*.css' esm/css",
"build-cjs": "babel src --ignore __tests__ --out-dir dist/",
"build-esm": "cross-env ESM=1 babel src --ignore __tests__ --out-dir esm/",
"build-bundles": "yarn build-bundles-clean && yarn build-bundles-dev && yarn build-bundles-min",
"build-bundles-dev": "cross-env NODE_ENV=development CDN=1 yarn webpack -d --bail",
"build-bundles-min": "cross-env NODE_ENV=production CDN=1 yarn webpack -p --bail",
Expand Down
4 changes: 2 additions & 2 deletions packages/graphiql/resources/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const resultConfig = {
'react-hot-loader/patch', // activate HMR for React
'webpack-dev-server/client?http://localhost:8080', // bundle the client for webpack-dev-server and connect to the provided endpoint
'webpack/hot/only-dev-server', // bundle the client for hot reloading, only- means to only hot reload for successful updates
'./index.js', // the entry point of our app
'./cdn.js', // the entry point of our app
]
: './index.js',
: './cdn.js',
context: rootPath('src'),
output: {
path: rootPath(),
Expand Down
22 changes: 22 additions & 0 deletions packages/graphiql/src/cdn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright (c) 2019 GraphQL Contributors.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import 'regenerator-runtime/runtime';

import './css/app.css';
import './css/codemirror.css';
import './css/foldgutter.css';
import './css/info.css';
import './css/jump.css';
import './css/lint.css';
import './css/loading.css';
import './css/show-hint.css';

import './css/doc-explorer.css';
import './css/history.css';

import { GraphiQL } from './components/GraphiQL';
export default GraphiQL;
12 changes: 0 additions & 12 deletions packages/graphiql/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,5 @@
*/
import 'regenerator-runtime/runtime';

import './css/app.css';
import './css/codemirror.css';
import './css/foldgutter.css';
import './css/info.css';
import './css/jump.css';
import './css/lint.css';
import './css/loading.css';
import './css/show-hint.css';

import './css/doc-explorer.css';
import './css/history.css';

import { GraphiQL } from './components/GraphiQL';
export default GraphiQL;
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
{
"path": "../graphql-language-service-utils"
}
]
],
"exclude": ["**/__tests__/**","**/*.spec.*"]
}
3 changes: 2 additions & 1 deletion packages/graphql-language-service-interface/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
{
"path": "../graphql-language-service-utils"
}
]
],
"exclude": ["**/__tests__/**","**/*.spec.*"]
}
3 changes: 2 additions & 1 deletion packages/graphql-language-service-parser/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
{
"path": "../graphql-language-service-types"
}
]
],
"exclude": ["**/__tests__/**","**/*.spec.*"]
}
3 changes: 2 additions & 1 deletion packages/graphql-language-service-parser/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
{
"path": "../graphql-language-service-types"
}
]
],
"exclude": ["**/__tests__/**","**/*.spec.*"]
}
3 changes: 2 additions & 1 deletion packages/graphql-language-service-types/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"compilerOptions": {
"rootDir": "./src",
"outDir": "./esm",
}
},
"exclude": ["**/__tests__/**","**/*.spec.*"]
}
3 changes: 2 additions & 1 deletion packages/graphql-language-service-types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
}
},
"exclude": ["**/__tests__/**","**/*.spec.*"]
}
3 changes: 2 additions & 1 deletion packages/graphql-language-service-utils/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
{
"path": "../graphql-language-service-types"
}
]
],
"exclude": ["**/__tests__/**","**/*.spec.*"]
}
2 changes: 1 addition & 1 deletion packages/graphql-language-service-utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"path": "../graphql-language-service-types"
}
],
"exclude": ["**/*-test.*","**/*.spec.*"]
"exclude": ["**/__tests__/**","**/*.spec.*"]
}
1 change: 1 addition & 0 deletions resources/tsconfig.base.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"baseUrl": "."
},
"exclude": [
"**/__tests__/**",
"**/dist/**.*",
"**/*.spec.ts",
"**/*.spec.js",
Expand Down

0 comments on commit 3b1c2c1

Please sign in to comment.