-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rollup, remove gulp for lots of things
- Loading branch information
Showing
20 changed files
with
213 additions
and
176 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
tmp | ||
dist | ||
|
||
# awesome-typescript-loader | ||
.awcache | ||
.sass-cache | ||
|
||
# npm | ||
node_modules | ||
|
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,17 @@ | ||
#!/usr/bin/env node | ||
|
||
const path = require('path') | ||
const tsConfig = require(path.resolve(__dirname, '../tsconfig.json')) | ||
|
||
let packagePaths = tsConfig.compilerOptions.paths | ||
let parts = [] | ||
|
||
for (let packageName in packagePaths) { | ||
let jsPath = packagePaths[packageName][0] | ||
let srcPath = path.dirname(jsPath) | ||
let distPath = 'dist/' + packageName | ||
|
||
parts.push(srcPath + ':' + distPath) | ||
} | ||
|
||
console.log(parts.join(' ')) |
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 |
---|---|---|
@@ -1,49 +1,11 @@ | ||
const gulp = require('gulp') | ||
const del = require('del') | ||
|
||
require('./tasks/webpack') | ||
require('./tasks/ts-types') | ||
require('./tasks/minify') | ||
require('./tasks/archive') | ||
require('./tasks/test') | ||
require('./tasks/lint') | ||
require('./tasks/bump') | ||
require('./tasks/example-repos') | ||
|
||
// when running just `gulp` | ||
gulp.task('default', [ 'dist' ]) | ||
|
||
// everything needed for running demos and developing | ||
gulp.task('dev', [ | ||
'webpack:dev', | ||
'ts-types' | ||
]) | ||
|
||
// watch anything that needs to be built | ||
gulp.task('watch', [ | ||
'webpack:watch', | ||
'ts-types:watch' | ||
]) | ||
|
||
// generates all files that end up in package manager release | ||
gulp.task('dist', [ | ||
'webpack', | ||
'ts-types', | ||
'minify' | ||
]) | ||
|
||
// like dist, but runs tests and linting, and generates archive | ||
gulp.task('release', [ | ||
'example-repos:build', | ||
'lint', | ||
'dist', | ||
'archive', | ||
'test:single' // headless, single run | ||
]) | ||
|
||
// group these somewhat unrelated tasks together for CI | ||
gulp.task('lint-and-example-repos', [ 'lint', 'example-repos:build' ]) | ||
|
||
gulp.task('clean', function() { | ||
return del([ 'dist/', 'tmp/', '.awcache/' ]) | ||
}) |
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,143 @@ | ||
import path from 'path' | ||
import glob from 'glob' | ||
import resolve from 'rollup-plugin-node-resolve' | ||
import multiEntry from 'rollup-plugin-multi-entry' | ||
import sourcemaps from 'rollup-plugin-sourcemaps' | ||
import rootPackageConfig from './package.json' | ||
import tsConfig from './tsconfig.json' | ||
|
||
let isDev | ||
if (!/^(development|production)$/.test(process.env.BUILD)) { | ||
console.warn('BUILD environment not specified. Assuming \'development\'') | ||
isDev = true | ||
} else { | ||
isDev = process.env.BUILD == 'development' | ||
} | ||
|
||
let packagePaths = tsConfig.compilerOptions.paths | ||
let packageNames = Object.keys(packagePaths) | ||
let packageGlobals = { | ||
superagent: 'superagent', | ||
luxon: 'luxon', | ||
moment: 'moment', | ||
rrule: 'rrule', | ||
fullcalendar: 'FullCalendar' | ||
} | ||
|
||
let watchOptions = { | ||
clearScreen: false // let tsc do the screan clearing | ||
} | ||
|
||
for (let packageName of packageNames) { | ||
if (!packageGlobals[packageName]) { | ||
packageGlobals[packageName] = 'FullCalendar.defaultPlugins.' + packageName | ||
} | ||
} | ||
|
||
let externalPackageNames = Object.keys( | ||
Object.assign( | ||
{}, | ||
packageGlobals, | ||
rootPackageConfig.dependencies, // hopefully covered in packageGlobals | ||
rootPackageConfig.peerDependencies // (if not, rollup will give an error) | ||
) | ||
) | ||
|
||
export default [ | ||
...packageNames.map(buildPackageConfig), | ||
...buildLocaleConfigs(), | ||
buildTestConfig() | ||
] | ||
|
||
function buildPackageConfig(packageName) { | ||
return { | ||
onwarn, | ||
watch: watchOptions, | ||
input: 'tmp/tsc-output/' + packagePaths[packageName][0] + '.js', | ||
external: externalPackageNames, | ||
output: { | ||
file: 'dist/' + packageName + '/main.js', | ||
globals: packageGlobals, | ||
exports: 'named', | ||
name: packageGlobals[packageName], | ||
format: 'umd', | ||
sourcemap: isDev, | ||
sourcemapExcludeSources: true | ||
}, | ||
plugins: [ | ||
resolve(), | ||
sourcemaps() | ||
] | ||
} | ||
} | ||
|
||
function buildLocaleConfigs() { | ||
let localePaths = glob.sync('tmp/tsc-output/locales/*.js') | ||
let configs = [] | ||
|
||
for (let localePath of localePaths) { | ||
configs.push({ | ||
onwarn, | ||
watch: watchOptions, | ||
input: localePath, | ||
external: externalPackageNames, | ||
output: { | ||
file: 'dist/fullcalendar/locales/' + path.basename(localePath), | ||
globals: packageGlobals, | ||
exports: 'none', | ||
format: 'umd' | ||
} | ||
}) | ||
} | ||
|
||
// ALL locales in one file | ||
configs.push({ | ||
onwarn, | ||
watch: watchOptions, | ||
input: localePaths, | ||
external: externalPackageNames, | ||
output: { | ||
file: 'dist/fullcalendar/locales-all.js', | ||
globals: packageGlobals, | ||
exports: 'none', | ||
format: 'umd' | ||
}, | ||
plugins: [ | ||
multiEntry() | ||
] | ||
}) | ||
|
||
return configs | ||
} | ||
|
||
function buildTestConfig() { | ||
return { | ||
onwarn, | ||
watch: watchOptions, | ||
input: [ | ||
'tmp/tsc-output/tests/automated/globals.js', | ||
'tmp/tsc-output/tests/automated/hacks.js', | ||
'tmp/tsc-output/tests/automated/**/*.js' | ||
], | ||
external: externalPackageNames, | ||
output: { | ||
file: 'tmp/automated-tests.js', | ||
globals: packageGlobals, | ||
exports: 'none', | ||
format: 'umd' | ||
}, | ||
plugins: [ | ||
resolve(), | ||
sourcemaps(), | ||
multiEntry({ | ||
exports: false // otherwise will complain about exported utils | ||
}) | ||
] | ||
} | ||
} | ||
|
||
function onwarn(warning, warn) { | ||
if (warning.code !== 'PLUGIN_WARNING') { | ||
warn(warning) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
|
||
@import './common/common.scss'; | ||
@import './common/common.standard.scss'; | ||
@import './common/common.jquery-ui.scss'; | ||
@import './common/common.bootstrap3.scss'; | ||
@import './common/common.bootstrap4.scss'; | ||
@import './toolbar.scss'; | ||
@import './view.scss'; | ||
@import './basic/basic.scss'; | ||
@import './common/common'; | ||
@import './common/standard'; | ||
@import './common/jqueryui'; | ||
@import './common/bootstrap3'; | ||
@import './common/bootstrap4'; | ||
@import './toolbar'; | ||
@import './view'; | ||
@import './basic/basic'; | ||
|
||
@media print { | ||
@import './common/print.scss'; | ||
@import './common/print'; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.