This repository has been archived by the owner on Jun 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Tried to get Scripts folder to be loaded as es2015-modules (by ts-n…
…ode), but ts-node wouldn't have it. (see issue: TypeStrong/ts-node#436) * Converted last of .js files in Scripts, to .ts. * MS own-modules are always loaded from root. (I manage them, so it's easy for me to make sure they all work together -- ie. the advantage of honoring semver for lib subdependencies is lower, when those subdependencies are my own modules) BTW, note that latest chrome (79) has issue when debugging source-mapped file: hovering over variables in the Sources text-editor doesn't display anything. I know this is a Chrome bug, since it works fine in Chromium, and the bug shows up in Chrome even on the actual canonicaldebate.com, which I haven't touched in months. I'll just wait for the fix rather than trying to work around.
- Loading branch information
Showing
13 changed files
with
154 additions
and
114 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 was deleted.
Oops, something went wrong.
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,49 @@ | ||
import debug_base from 'debug'; // eslint-disable-line no-underscore-dangle | ||
import { exec } from 'child_process'; | ||
|
||
const { TRAVIS_BRANCH, TRAVIS_PULL_REQUEST, FIREBASE_TOKEN } = process.env; | ||
const debug = debug_base('app:build:deploy'); | ||
|
||
const deployToFirebase = (cb) => { | ||
debug('Travis Variables:', { TRAVIS_PULL_REQUEST, TRAVIS_BRANCH }); | ||
if (!!TRAVIS_PULL_REQUEST && TRAVIS_PULL_REQUEST !== 'false') { | ||
debug('Skipping Firebase Deploy - Build is a Pull Request'); | ||
return; | ||
} | ||
|
||
if (TRAVIS_BRANCH !== 'prod' && TRAVIS_BRANCH !== 'stage' && TRAVIS_BRANCH !== 'master') { | ||
debug('Skipping Firebase Deploy - Build is a not a Build Branch', TRAVIS_BRANCH); | ||
return; | ||
} | ||
|
||
if (!FIREBASE_TOKEN) { | ||
debug('Error: FIREBASE_TOKEN env variable not found'); | ||
cb('Error: FIREBASE_TOKEN env variable not found', null); | ||
return; | ||
} | ||
|
||
debug('Deploying to Firebase...'); | ||
|
||
exec(`firebase deploy --token ${FIREBASE_TOKEN}`, (error, stdout) => { | ||
if (error !== null) { | ||
if (cb) { | ||
cb(error, null); | ||
return; | ||
} | ||
} | ||
if (cb) { | ||
cb(null, stdout); | ||
} | ||
}); | ||
}; | ||
|
||
(function () { | ||
deployToFirebase((err, stdout) => { | ||
if (err || !stdout) { | ||
debug('error deploying to Firebase: ', err); | ||
return; | ||
} | ||
debug(stdout); // log output of firebase cli | ||
debug('\nSuccessfully deployed to Firebase'); | ||
}); | ||
}()); |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
import webpack from 'webpack'; | ||
import debug_base from 'debug'; | ||
import { config } from '../Config'; | ||
|
||
const debug = debug_base('app:build:webpack-compiler'); | ||
|
||
export function webpackCompiler(webpackConfig, statsFormat?): Promise<webpack.Stats.ToJsonOutput> { | ||
statsFormat = statsFormat || config.compiler_stats; | ||
|
||
return new Promise((resolve, reject) => { | ||
const compiler = webpack(webpackConfig); | ||
|
||
compiler.run((err, stats) => { | ||
if (err) { | ||
debug('Webpack compiler encountered a fatal error.', err); | ||
return reject(err); | ||
} | ||
|
||
const jsonStats = stats.toJson(); | ||
debug('Webpack compile completed.'); | ||
debug(stats.toString(statsFormat)); | ||
|
||
if (jsonStats.errors.length > 0) { | ||
debug('Webpack compiler encountered errors.'); | ||
debug(jsonStats.errors.join('\n')); | ||
return reject(new Error('Webpack compiler encountered errors')); | ||
} if (jsonStats.warnings.length > 0) { | ||
debug('Webpack compiler encountered warnings.'); | ||
debug(jsonStats.warnings.join('\n')); | ||
} else { | ||
debug('No errors or warnings encountered.'); | ||
} | ||
resolve(jsonStats); | ||
}); | ||
}); | ||
} |
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,4 @@ | ||
{ | ||
"@type": "Load the js files in this folder as es2015 modules, rather than commonjs.", | ||
"type": "module" | ||
} |
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.