-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(appengine): support publishing appengine module as an npm package (
- Loading branch information
1 parent
fa43648
commit 28b568e
Showing
81 changed files
with
223 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "@spinnaker/appengine", | ||
"version": "0.0.1", | ||
"main": "lib/lib.js", | ||
"typings": "lib/index.d.ts", | ||
"scripts": { | ||
"clean": "../../../../node_modules/rimraf/bin.js lib", | ||
"lib": "npm run clean && ../../../../node_modules/typescript/bin/tsc && node ../../../../node_modules/webpack/bin/webpack.js", | ||
"prepare": "npm run lib" | ||
} | ||
} |
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.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export { APPENGINE_MODULE } from './appengine.module'; |
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.
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
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
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
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
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
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
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
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
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.
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"buildOnSave": false, | ||
"compileOnSave": true, | ||
"compilerOptions": { | ||
"allowJs": false, | ||
"baseUrl": "./src", | ||
"declaration": true, | ||
"declarationDir": "lib", | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"jsx": "react", | ||
"lib": [ | ||
"es2016", | ||
"dom" | ||
], | ||
"moduleResolution": "node", | ||
"module": "commonjs", | ||
"noEmitHelpers": false, | ||
"noImplicitAny": true, | ||
"noImplicitReturns": true, | ||
"noImplicitThis": false, // should really get to a place where we can turn this on | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"outDir": "lib", | ||
"pretty": true, | ||
"removeComments": false, | ||
"rootDir": "./src", | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"inlineSources": true, | ||
"strictNullChecks": false, // should really get to a place where we can turn this on | ||
"target": "es6", | ||
"typeRoots": [ | ||
"../../../../node_modules/@types" | ||
], | ||
"paths": { | ||
"@spinnaker/core": ["../../core/lib"], | ||
"appengine/*": ["*"], | ||
"appengine": ["."] | ||
} | ||
}, | ||
"include": [ | ||
"src/**/*.ts", | ||
"src/**/*.tsx" | ||
], | ||
"exclude": [ | ||
"./lib", | ||
"**/*.spec.*" | ||
] | ||
} |
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,126 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
const basePath = path.join(__dirname, '..', '..', '..', '..'); | ||
const NODE_MODULE_PATH = path.join(basePath, 'node_modules'); | ||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); | ||
const nodeExternals = require('webpack-node-externals'); | ||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); | ||
const exclusionPattern = /(node_modules|\.\.\/deck)/; | ||
const WEBPACK_THREADS = Math.max(require('physical-cpu-count') - 1, 1); | ||
|
||
const WATCH = process.env.WATCH === 'true'; | ||
const WEBPACK_MODE = WATCH ? 'development' : 'production'; | ||
const IS_PRODUCTION = WEBPACK_MODE === 'production'; | ||
|
||
module.exports = { | ||
context: basePath, | ||
mode: WEBPACK_MODE, | ||
stats: 'minimal', | ||
watch: WATCH, | ||
entry: { | ||
lib: path.join(__dirname, 'src', 'index.ts'), | ||
}, | ||
output: { | ||
path: path.join(__dirname, 'lib'), | ||
filename: '[name].js', | ||
library: '@spinnaker/appengine', | ||
libraryTarget: 'umd', | ||
umdNamedDefine: true, | ||
}, | ||
devtool: 'source-map', | ||
optimization: { | ||
minimizer: IS_PRODUCTION ? [ | ||
new UglifyJSPlugin({ | ||
cache: true, | ||
parallel: true, | ||
sourceMap: true, | ||
uglifyOptions: { mangle: false } | ||
}) | ||
] : [], // disable minification in development mode | ||
}, | ||
resolve: { | ||
extensions: ['.json', '.js', '.jsx', '.ts', '.tsx', '.css', '.less', '.html'], | ||
modules: [ | ||
NODE_MODULE_PATH, | ||
path.resolve('.'), | ||
], | ||
alias: { | ||
'@spinnaker/appengine': path.join(__dirname, 'src'), | ||
'coreImports': path.resolve(basePath, 'app', 'scripts', 'modules', 'core', 'src', 'presentation', 'less', 'imports', 'commonImports.less'), | ||
'appengine': path.join(__dirname, 'src') | ||
} | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
use: [ | ||
{ loader: 'cache-loader' }, | ||
{ loader: 'thread-loader', options: { workers: WEBPACK_THREADS } }, | ||
{ loader: 'babel-loader' }, | ||
{ loader: 'envify-loader' }, | ||
{ loader: 'eslint-loader' }, | ||
], | ||
exclude: exclusionPattern | ||
}, | ||
{ | ||
test: /\.tsx?$/, | ||
use: [ | ||
{ loader: 'cache-loader' }, | ||
{ loader: 'thread-loader', options: { workers: WEBPACK_THREADS } }, | ||
{ loader: 'babel-loader' }, | ||
{ loader: 'ts-loader', options: { happyPackMode: true } }, | ||
{ loader: 'tslint-loader' }, | ||
], | ||
exclude: exclusionPattern | ||
}, | ||
{ | ||
test: /\.less$/, | ||
use: [ | ||
{ loader: 'style-loader' }, | ||
{ loader: 'css-loader' }, | ||
{ loader: 'postcss-loader' }, | ||
{ loader: 'less-loader' }, | ||
], | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
{ loader: 'style-loader' }, | ||
{ loader: 'css-loader' }, | ||
{ loader: 'postcss-loader' }, | ||
] | ||
}, | ||
{ | ||
test: /\.html$/, | ||
exclude: exclusionPattern, | ||
use: [ | ||
{ loader: 'ngtemplate-loader?relativeTo=' + (path.resolve(__dirname)) + '&prefix=appengine' }, | ||
{ loader: 'html-loader' }, | ||
] | ||
}, | ||
{ | ||
test: /\.(woff|woff2|otf|ttf|eot|png|gif|ico|svg)$/, | ||
use: [ | ||
{ loader: 'file-loader', options: { name: '[name].[hash:5].[ext]'} }, | ||
], | ||
}, | ||
{ | ||
test: require.resolve('jquery'), | ||
use: [ | ||
{ loader: 'expose-loader?$' }, | ||
{ loader: 'expose-loader?jQuery' }, | ||
], | ||
}, | ||
], | ||
}, | ||
plugins: [ | ||
new ForkTsCheckerWebpackPlugin({ checkSyntacticErrors: true }), | ||
], | ||
externals: [ | ||
'@spinnaker/core', | ||
'exports-loader?"n3-line-chart"!n3-charts/build/LineChart.js', | ||
nodeExternals({ modulesDir: '../../../../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
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