This repository has been archived by the owner on Oct 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add E2E_SELECTORS - Use 'me' shortcut when making requests - event handler: call puppeteer event handler if exists - allow edit the whole launch options and mask token field - add eslintrc - webpack: let picker-plugin accepts relative and absoluate path - webpack: disable reload - install @babel/plugin-transform-modules-commonjs to resolve problems of mixing commonjs and es6 module - refactor config.js - install eslint, babel - story: only apply default launch options when not specify
- Loading branch information
Showing
30 changed files
with
4,207 additions
and
1,068 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Express server for building and hosting the loader and picker page in dev | ||
* env. | ||
*/ | ||
/* eslint-disable no-console */ | ||
const express = require('express'); | ||
const webpack = require('webpack'); | ||
const webpackDevMiddleware = require('webpack-dev-middleware'); | ||
const webpackHotMiddleware = require('webpack-hot-middleware'); | ||
|
||
const webpackDevConfig = require('./webpack.story.conf'); | ||
|
||
const app = express(); | ||
const compiler = webpack(webpackDevConfig); | ||
|
||
console.log('Starting Dev Server...'); | ||
|
||
// Accept HMR requests from storybook server. | ||
app.use((req, res, next) => { | ||
res.append('Access-Control-Allow-Origin', ['*']); | ||
res.append('Access-Control-Allow-Methods', 'GET'); | ||
next(); | ||
}); | ||
|
||
// bind webpack and hot reload | ||
app.use(webpackDevMiddleware(compiler, { | ||
logTime: true, | ||
stats: 'minimal', | ||
publicPath: '/', | ||
})); | ||
app.use(webpackHotMiddleware(compiler, { | ||
log: console.log, | ||
path: '/__webpack_hmr', | ||
heartbeat: 10 * 1000, | ||
})); | ||
|
||
// Listen on 2 ports to host loader and picker separately. | ||
app.listen(8081, () => { | ||
console.log('Loader hosted at http://localhost:8081/sdk/kloudless.picker.js'); | ||
console.log( | ||
'React binding hosted at ' | ||
+ 'http://localhost:8081/sdk/kloudless.picker.react.js', | ||
); | ||
console.log( | ||
'Vue binding hosted at ' + | ||
'http://localhost:8081/sdk/kloudless.picker.vue.js', | ||
); | ||
console.log('Webpack bundles are compiling...'); | ||
}); | ||
app.listen(8082, () => { | ||
console.log( | ||
'View page hosted at http://localhost:8082/file-picker/v2/index.html', | ||
); | ||
console.log('Webpack bundles are compiling...'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.