-
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.
chore(build/azure): made azure follow module conventions
- Loading branch information
1 parent
c9cb288
commit 0ef7676
Showing
116 changed files
with
269 additions
and
84 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,4 @@ | ||
yalc.* | ||
.* | ||
tsconfig.json | ||
webpack.config.js |
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,11 @@ | ||
{ | ||
"name": "@spinnaker/azure", | ||
"version": "0.0.248", | ||
"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", | ||
"prepublishOnly": "npm run lib" | ||
} | ||
} |
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,79 @@ | ||
import { module } from 'angular'; | ||
|
||
import { CloudProviderRegistry, DeploymentStrategyRegistry } from '@spinnaker/core'; | ||
|
||
import './help/azure.help'; | ||
import './logo/azure.logo.less'; | ||
|
||
// load all templates into the $templateCache | ||
const templates = require.context('./', true, /\.html$/); | ||
templates.keys().forEach(function(key) { | ||
templates(key); | ||
}); | ||
|
||
export const AZURE_MODULE = 'spinnaker.azure'; | ||
module(AZURE_MODULE, [ | ||
require('./pipeline/stages/destroyAsg/azureDestroyAsgStage').name, | ||
require('./pipeline/stages/enableAsg/azureEnableAsgStage').name, | ||
require('./pipeline/stages/disableAsg/azureDisableAsgStage').name, | ||
require('./pipeline/stages/bake/azureBakeStage').name, | ||
require('./serverGroup/details/serverGroup.details.module').name, | ||
require('./serverGroup/serverGroup.transformer').name, | ||
require('./serverGroup/configure/wizard/CloneServerGroup.azure.controller').name, | ||
require('./serverGroup/configure/serverGroup.configure.azure.module').name, | ||
require('./instance/azureInstanceType.service').name, | ||
require('./loadBalancer/loadBalancer.transformer').name, | ||
require('./loadBalancer/details/loadBalancerDetail.controller').name, | ||
require('./loadBalancer/configure/createLoadBalancer.controller').name, | ||
require('./instance/details/instance.details.controller').name, | ||
require('./securityGroup/details/securityGroupDetail.controller').name, | ||
require('./securityGroup/configure/CreateSecurityGroupCtrl').name, | ||
require('./securityGroup/configure/EditSecurityGroupCtrl').name, | ||
require('./securityGroup/securityGroup.transformer').name, | ||
require('./securityGroup/securityGroup.reader').name, | ||
require('./image/image.reader').name, | ||
require('./validation/applicationName.validator').name, | ||
]).config(function() { | ||
CloudProviderRegistry.registerProvider('azure', { | ||
name: 'Azure', | ||
logo: { | ||
path: require('./logo/logo_azure.png'), | ||
}, | ||
image: { | ||
reader: 'azureImageReader', | ||
}, | ||
serverGroup: { | ||
transformer: 'azureServerGroupTransformer', | ||
detailsTemplateUrl: require('./serverGroup/details/serverGroupDetails.html'), | ||
detailsController: 'azureServerGroupDetailsCtrl', | ||
cloneServerGroupTemplateUrl: require('./serverGroup/configure/wizard/serverGroupWizard.html'), | ||
cloneServerGroupController: 'azureCloneServerGroupCtrl', | ||
commandBuilder: 'azureServerGroupCommandBuilder', | ||
configurationService: 'azureServerGroupConfigurationService', | ||
}, | ||
instance: { | ||
instanceTypeService: 'azureInstanceTypeService', | ||
detailsTemplateUrl: require('./instance/details/instanceDetails.html'), | ||
detailsController: 'azureInstanceDetailsCtrl', | ||
}, | ||
loadBalancer: { | ||
transformer: 'azureLoadBalancerTransformer', | ||
detailsTemplateUrl: require('./loadBalancer/details/loadBalancerDetail.html'), | ||
detailsController: 'azureLoadBalancerDetailsCtrl', | ||
createLoadBalancerTemplateUrl: require('./loadBalancer/configure/createLoadBalancer.html'), | ||
createLoadBalancerController: 'azureCreateLoadBalancerCtrl', | ||
CreateLoadBalancerModal: require('./loadBalancer/configure/AzureLoadBalancerChoiceModal') | ||
.AzureLoadBalancerChoiceModal, | ||
}, | ||
securityGroup: { | ||
transformer: 'azureSecurityGroupTransformer', | ||
reader: 'azureSecurityGroupReader', | ||
detailsTemplateUrl: require('./securityGroup/details/securityGroupDetail.html'), | ||
detailsController: 'azureSecurityGroupDetailsCtrl', | ||
createSecurityGroupTemplateUrl: require('./securityGroup/configure/createSecurityGroup.html'), | ||
createSecurityGroupController: 'azureCreateSecurityGroupCtrl', | ||
}, | ||
}); | ||
}); | ||
|
||
DeploymentStrategyRegistry.registerProvider('azure', ['redblack']); |
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 * from './azure.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.
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.
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.
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.
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.
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,39 @@ | ||
{ | ||
"buildOnSave": false, | ||
"compileOnSave": true, | ||
"compilerOptions": { | ||
"allowJs": false, | ||
"baseUrl": "./src", | ||
"declaration": true, | ||
"declarationDir": "lib", | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"jsx": "react", | ||
"lib": ["es2016", "dom", "es2017.object"], | ||
"moduleResolution": "node", | ||
"module": "esnext", | ||
"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"], | ||
"core/*": ["../../core/lib/*"] | ||
} | ||
}, | ||
"files": ["src/index.ts"], | ||
"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,130 @@ | ||
'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 TerserPlugin = require('terser-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/azure', | ||
libraryTarget: 'umd', | ||
umdNamedDefine: true, | ||
}, | ||
devtool: 'source-map', | ||
optimization: { | ||
minimizer: IS_PRODUCTION | ||
? [ | ||
new TerserPlugin({ | ||
cache: true, | ||
parallel: true, | ||
sourceMap: true, | ||
terserOptions: { | ||
ecma: 6, | ||
mangle: false, | ||
output: { | ||
comments: false, | ||
}, | ||
}, | ||
}), | ||
] | ||
: [], // disable minification in development mode | ||
}, | ||
resolve: { | ||
extensions: ['.json', '.js', '.jsx', '.ts', '.tsx', '.css', '.less', '.html'], | ||
modules: [NODE_MODULE_PATH, path.resolve('.')], | ||
alias: { | ||
'@spinnaker/core': path.resolve(basePath, 'app', 'scripts', 'modules', 'core', 'src'), | ||
coreImports: path.resolve( | ||
basePath, | ||
'app', | ||
'scripts', | ||
'modules', | ||
'core', | ||
'src', | ||
'presentation', | ||
'less', | ||
'imports', | ||
'commonImports.less', | ||
), | ||
azure: path.join(__dirname), | ||
}, | ||
}, | ||
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: '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=azure' }, | ||
{ 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