Added initial commit of shared libraries

This commit is contained in:
David Watrous 2021-03-06 08:26:03 -05:00 коммит произвёл David Watrous
Родитель 0b4a42232c
Коммит 80765b8744
2994 изменённых файлов: 29801 добавлений и 43273 удалений

Просмотреть файл

@ -1,4 +1,7 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true

Просмотреть файл

@ -1,31 +0,0 @@
{
"plugins": [
"@typescript-eslint",
"unused-imports"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"unused-imports/no-unused-imports": "error",
"max-len": [
"error",
{
"code": 140,
"ignoreComments": true,
"ignoreUrls": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}
],
"no-case-declarations": "off",
"no-console": "error",
"no-extra-boolean-cast": "off",
"no-useless-escape": "off"
}
}

Просмотреть файл

@ -1,116 +1,4 @@
{
"root": true,
"ignorePatterns": [
"node_modules/**/*",
"**/node_modules/**/*",
"dist/**/*",
"build/**/*",
"python/**/*",
"docs/**/*",
"data/**/*"
],
"env": {
"browser": true,
"es6": true,
"node": true
},
"overrides": [
/*
* TYPESCRIPT FILES
*/
{
"files": ["src/**/*.ts"],
"extends": [
".eslintrc.common.json",
"prettier",
"prettier/@typescript-eslint"
],
"plugins": [
"@angular-eslint/eslint-plugin",
"@angular-eslint/eslint-plugin-template",
"@typescript-eslint"
],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": ["bl", "be"],
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": ["bl", "be"],
"style": "camelCase"
}
],
"@angular-eslint/no-forward-ref": "off",
"@angular-eslint/no-input-rename": "warn",
"@angular-eslint/use-lifecycle-interface": "warn",
"@typescript-eslint/no-var-requires": "warn",
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/ban-ts-comment": "warn"
}
},
/*
* COMPONENT TEMPLATES
*/
{
"files": ["src/**/*.html"],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {
"@angular-eslint/template/use-track-by-function": "warn"
}
},
/*
* @BATCH-FLASK
*/
{
"files": ["src/@batch-flask/**/*.ts"],
"rules": {
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "app",
"message": "Importing modules in @batch-flask from app/* is forbidden"
},
{
"name": "common",
"message": "Importing modules in @batch-flask from common/* is forbidden"
}
],
"patterns": ["app/*", "common/*"]
}
]
}
},
/*
* NODE SCRIPTS
*/
{
"files": ["scripts/**/*.ts", "config/**/*.ts"],
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
],
"parserOptions": {
"project": [
"tsconfig.eslint.json"
],
"sourceType": "script",
"createDefaultProgram": false
},
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}
]
"extends": ["./util/common-config/.eslintrc-common.json", "prettier"]
}

27
.gitignore поставляемый
Просмотреть файл

@ -1,21 +1,8 @@
node_modules/
build/
dll/
typings/
logs/
env/
*.log*
*.mem.csv
release/
.awcache
/**/node_modules/
/**/lib
/**/lib-cjs
/**/lib-umd
/**/build
/desktop/release/
coverage/
*.stackdump
.nyc_output/
coverage.lcov
documentation/
.python-version
# Ignore the english compiled file
i18n/resources.en.json
i18n/xliff/
i18n/xliffs/
env/

Просмотреть файл

@ -19,5 +19,4 @@
// Emphasis used instead of a heading
"MD036": false
}

13
.prettierignore Normal file
Просмотреть файл

@ -0,0 +1,13 @@
/**/node_modules/
/**/lib/
/**/lib-cjs/
/**/lib-umd/
/**/test-results/
*.md
*.html
desktop
docs
.vsts
.vscode

3
.prettierrc.json Normal file
Просмотреть файл

@ -0,0 +1,3 @@
{
"endOfLine": "auto"
}

1
.vscode/extensions.json поставляемый
Просмотреть файл

@ -4,7 +4,6 @@
"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"rvest.vs-code-prettier-eslint",
"davidanson.vscode-markdownlint"
]
}

174
.vscode/launch.json поставляемый
Просмотреть файл

@ -1,64 +1,154 @@
{
"version": "0.2.0",
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!**/node_modules/**"
],
"configurations": [
{
"name": "Debug: Main",
"name": "Web: Launch",
"type": "pwa-chrome",
"request": "launch",
"preLaunchTask": "Start web dev server",
"url": "http://127.0.0.1:9000",
"webRoot": "${workspaceFolder}",
"sourceMaps": true,
"trace": true,
"outFiles": [
"${workspaceRoot}/web/lib/**/*.js"
],
"postDebugTask": "Terminate all tasks",
"presentation": {
"group": "Web",
"order": 10
}
},
{
"name": "Web: Test Watch",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"./node_modules/.bin/jest",
"--runInBand",
"--watch"
],
"cwd": "${workspaceRoot}/web",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229,
"presentation": {
"group": "Web",
"order": 20
}
},
{
"name": "Common: Test Watch",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"./node_modules/.bin/jest",
"--runInBand",
"--watch"
],
"cwd": "${workspaceRoot}/packages/common",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229,
"presentation": {
"group": "Packages",
"order": 10
}
},
{
"name": "React: Test Watch",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"./node_modules/.bin/jest",
"--runInBand",
"--watch"
],
"cwd": "${workspaceRoot}/packages/react",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229,
"presentation": {
"group": "Packages",
"order": 20
}
},
{
"name": "Service: Test Watch",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"./node_modules/.bin/jest",
"--runInBand",
"--watch"
],
"cwd": "${workspaceRoot}/packages/service",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229,
"presentation": {
"group": "Packages",
"order": 20
}
},
{
"name": "Desktop: Debug Client",
"type": "node",
"request": "launch",
"protocol": "inspector",
"program": "${workspaceRoot}/src/client/main.ts",
"preLaunchTask": "Start desktop dev server",
"program": "${workspaceRoot}/desktop/src/client/main.ts",
"stopOnEntry": false,
"args": [
"--remote-debugging-port=9222",
"--nolazy"
],
"cwd": "${workspaceRoot}",
"preLaunchTask": "build-client",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"cwd": "${workspaceRoot}/desktop",
"runtimeExecutable": "${workspaceRoot}/desktop/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
"runtimeExecutable": "${workspaceRoot}/desktop/node_modules/.bin/electron.cmd"
},
"env": {
"NODE_ENV": "development",
"HOT": "1"
},
"console": "internalConsole",
"console": "integratedTerminal",
"outputCapture": "std",
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/build/**/*.js"
"${workspaceRoot}/desktop/build/**/*.js"
],
"postDebugTask": "Terminate all tasks",
"presentation": {
"hidden": false,
"group": "Debug",
"order": 20
},
"skipFiles": [
"<node_internals>/**",
"${workspaceFolder}/node_modules/**"
]
"group": "Desktop",
"order": 30
}
},
{
"name": "Attach: Renderer",
"type": "chrome",
"name": "Desktop: Attach Debugger to Render Process",
"type": "pwa-chrome",
"request": "attach",
"port": 9222,
"sourceMaps": true,
"trace": "verbose",
"trace": true,
"url": "file://*",
"webRoot": "${workspaceRoot}/build",
"timeout": 30000,
"timeout": 300000,
"presentation": {
"hidden": false,
"group": "Debug",
"order": 30
},
"skipFiles": [
"<node_internals>/**",
"${workspaceFolder}/node_modules/**"
]
"group": "Desktop",
"order": 40
}
},
{
"name": "Test: Client",
"name": "Desktop: Test Client",
"type": "node",
"request": "launch",
"protocol": "inspector",
@ -72,9 +162,8 @@
"NODE_ENV": "test"
},
"presentation": {
"hidden": false,
"group": "Test",
"order": 10
"group": "Desktop",
"order": 20
},
"skipFiles": [
"<node_internals>/**",
@ -84,16 +173,17 @@
],
"compounds": [
{
"name": "Debug: All",
"configurations": [
"Debug: Main",
"Attach: Renderer"
],
"presentation": {
"hidden": false,
"group": "Debug",
"order": 10
}
"name": "Desktop: Launch",
"configurations": [
"Desktop: Debug Client",
"Desktop: Attach Debugger to Render Process"
],
"stopAll": true,
"presentation": {
"hidden": false,
"group": "Desktop",
"order": 10
}
}
]
}

81
.vscode/settings.json поставляемый
Просмотреть файл

@ -1,31 +1,76 @@
// Place your settings in this file to overwrite default and user settings.
{
// The number of spaces a tab is equal to. This setting is overriden based on the file contents when `editor.detectIndentation` is on.
// Angular
"vsicons.presets.angular": true,
// CSS
"css.validate": false,
"scss.validate": false,
// Default Formatting
"editor.tabSize": 4,
// When opening a file, `editor.tabSize` and `editor.insertSpaces` will be detected based on the file contents.
"editor.detectIndentation": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": false,
// Per Language Formatting
// Keep this up to date with .prettierignore
// Run Prettier first, followed by ESLint
"[javascript]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": [
"source.formatDocument",
"source.fixAll.eslint"
]
},
"[typescript]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": [
"source.formatDocument",
"source.fixAll.eslint"
]
},
"[typescriptreact]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": [
"source.formatDocument",
"source.fixAll.eslint"
]
},
"[json]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": [
"source.formatDocument",
"source.fixAll.eslint"
]
},
"[jsonc]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": [
"source.formatDocument",
"source.fixAll.eslint"
]
},
// Python
"python.autoComplete.extraPaths": ["${workspaceRoot}/python"],
"python.formatting.provider": "yapf",
// Typescript
"typescript.tsdk": "node_modules/typescript/lib",
// General
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"build/**": true,
"python/build/**": true,
"release/**": true,
"dll/**": true
"**/build/**": true,
"**/lib/**": true,
"**/lib-*/**": true,
"desktop/python/build/**": true,
"desktop/release/**": true,
"desktop/dll/**": true
},
"files.exclude": {
"**/__pycache__/**/*": true,
".awcache/**": true
},
"python.autoComplete.extraPaths": ["${workspaceRoot}/python"],
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"vsicons.presets.angular": true,
"css.validate": false,
"scss.validate": false,
"python.formatting.provider": "yapf",
"editor.codeActionsOnSave": {
"source.fixAll": true
}
}

83
.vscode/tasks.json поставляемый
Просмотреть файл

@ -4,28 +4,91 @@
"version": "2.0.0",
"tasks": [
{
"label": "build-client",
"label": "Build all",
"type": "npm",
"script": "build-client:dev",
"problemMatcher": [
"$tsc"
],
"script": "build",
"group": {
"kind": "build",
"isDefault": true
}
},
"problemMatcher": [
"$tsc"
]
},
{
"label": "Build desktop client",
"type": "npm",
"script": "stylelint"
"script": "build:desktop:client",
"problemMatcher": [
"$tsc"
],
"group": "build"
},
{
"label": "Lint all",
"type": "npm",
"script": "eslint",
"script": "lint",
"problemMatcher": [
"$eslint-stylish"
],
"label": "npm: eslint"
]
},
{
"label": "Start web dev server",
"type": "npm",
"script": "start:web",
"promptOnClose": true,
"isBackground": true,
"problemMatcher": [
{
"owner": "typescript",
"base": "$tsc-watch",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "Starting compilation.*?"
},
"endsPattern": {
"regexp": "Compiled.*?"
}
}
}
]
},
{
"label": "Start desktop dev server",
"type": "npm",
"script": "start:desktop",
"promptOnClose": true,
"isBackground": true,
"problemMatcher": [
{
"owner": "typescript",
"base": "$tsc-watch",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "Starting compilation.*?"
},
"endsPattern": {
"regexp": "Compiled.*?"
}
}
}
]
},
{
"label": "Terminate all tasks",
"command": "echo ${input:terminate}",
"type": "shell",
"problemMatcher": []
}
],
"inputs": [
{
"id": "terminate",
"type": "command",
"command": "workbench.action.tasks.terminate",
"args": "terminateAll"
}
]
}

Просмотреть файл

Просмотреть файл

@ -5,6 +5,6 @@ steps:
- task: PublishBuildArtifacts@1
displayName: Publish artifacts
inputs:
pathtoPublish: ./release
pathtoPublish: ./desktop/release
artifactName: ${{ parameters.folder }}
artifactType: Container

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -3,7 +3,7 @@ steps:
- script: |
set -e
. "$(Agent.WorkFolder)/.venv/batchexplorer/bin/activate"
npm run build-and-pack
yarn build:package
displayName: Build and pack
- template: ../common/publish-artifacts.yml
parameters:

Просмотреть файл

@ -4,5 +4,6 @@ steps:
set -e
echo "Node.js version $(node --version)"
echo "NPM version $(npm --version)"
npm ci
echo "Yarn version $(yarn --version)"
yarn install
displayName: Install MacOS dependencies

Просмотреть файл

@ -3,15 +3,15 @@ steps:
- script: |
set -e
. "$(Agent.WorkFolder)/.venv/batchexplorer/bin/activate"
npm run -s build:prod
npm run -s build-python
npm run -s package darwin-app
cd ./release/mac
yarn build:prod
yarn build-python
yarn package darwin-app
cd ./desktop/release/mac
zip -y -r ../BatchExplorer-mac.zip ./BatchExplorer.app
cd ../..
rm -rf ./release/mac/*.app
mkdir ./release/keep
cp ./release/*.zip ./release/keep/before-code-sign.zip
rm -rf ./desktop/release/mac/*.app
mkdir ./desktop/release/keep
cp ./desktop/release/*.zip ./desktop/release/keep/before-code-sign.zip
displayName: Build .app
- template: ./sign.yml
@ -23,10 +23,13 @@ steps:
rm -f ./release/mac/*.pkg
# rm -rf ./release/*.zip
mv ./release/*.zip ./release/code-sign-results.zip
npm run -s package darwin-dmg
yarn package darwin-dmg
rm -rf ./release/mac/*
workingDirectory: desktop
displayName: Build dmg
- script: npm run package darwin-manifest
- script: yarn package darwin-manifest
workingDirectory: desktop
displayName: Create manifest
- template: ../common/generate-sbom.yml
- template: ../common/publish-artifacts.yml

Просмотреть файл

@ -2,7 +2,7 @@ steps:
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
inputs:
ConnectedServiceName: 'ESRP CodeSign'
FolderPath: ./release
FolderPath: ./desktop/release
Pattern: 'BatchExplorer-mac.zip'
signConfigType: inlineSignParams
inlineOperation: |

Просмотреть файл

@ -1,5 +1,5 @@
steps:
- powershell: ./scripts/azpipelines/build-type.ps1 "$(Build.SourceBranch)" "$(Build.BuildNumber)"
- powershell: ./.vsts/common/build-type.ps1 "$(Build.SourceBranch)" "$(Build.BuildNumber)"
displayName: Resolve build type
- template: ./node-setup.yml

Просмотреть файл

@ -1,36 +1,12 @@
steps:
- template: ./linux-dependencies.yml
- script: npm run test-models
displayName: Test models against swagger
- script: |
export DISPLAY=:99
xvfb-run --server-args '-screen 0 1024x768x24' npm run test
displayName: Run tests
- task: PublishTestResults@2
inputs:
testRunner: 'JUnit'
testResultsFiles: $(System.DefaultWorkingDirectory)/coverage/TESTS*.xml
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/coverage/cobertura.xml
reportDirectory: $(System.DefaultWorkingDirectory)/coverage/html
- script: codecov -t $(codecov.uploadToken)
displayName: Upload code coverage to codecov
- script: |
set -e
. "$(Agent.WorkFolder)/.venv/batchexplorer/bin/activate"
npm run build-and-pack
yarn build:package
displayName: Build and pack
- script: npm run lint
displayName: Lint
- template: ../common/publish-artifacts.yml
parameters:
folder: linux

Просмотреть файл

@ -3,12 +3,13 @@ steps:
- script: |
set -e
. "$(Agent.WorkFolder)/.venv/batchexplorer/bin/activate"
npm run build-and-pack
yarn build:package
displayName: Build and pack
- script: |
set -e
. "$(Agent.WorkFolder)/.venv/batchexplorer/bin/activate"
npm run package linux-manifest
yarn package linux-manifest
workingDirectory: desktop
displayName: Create manifest
- template: ../common/generate-sbom.yml
- template: ../common/publish-artifacts.yml

Просмотреть файл

@ -12,6 +12,7 @@ steps:
set -e
echo "Node.js version $(node --version)"
echo "NPM version $(npm --version)"
echo "Yarn version $(yarn --version)"
npm install -g codecov
npm install
yarn install
displayName: Install Linux dependencies

31
.vsts/linux/test.yml Normal file
Просмотреть файл

@ -0,0 +1,31 @@
steps:
- template: ./linux-dependencies.yml
- script: yarn lint
displayName: Lint
- script: yarn build:clean
displayName: Build packages
- script: yarn test-models
workingDirectory: desktop
displayName: Test models against swagger
- script: |
export DISPLAY=:99
xvfb-run --server-args '-screen 0 1024x768x24' yarn test:all
displayName: Run tests
- task: PublishTestResults@2
inputs:
testRunner: 'JUnit'
testResultsFiles: '**/TEST*-*.xml'
searchFolder: $(System.DefaultWorkingDirectory)/build
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/build/*/coverage/cobertura.xml
reportDirectory: $(System.DefaultWorkingDirectory)/build/*/coverage/html
- script: codecov -t $(codecov.uploadToken)
displayName: Upload code coverage to codecov

Просмотреть файл

@ -3,6 +3,10 @@ steps:
inputs:
versionSpec: '16.x.x'
- script: |
corepack enable
displayName: Install Yarn via Corepack
- script: |
cp .vsts/pipelines.npmrc .npmrc
displayName: Stage .npmrc configuration

Просмотреть файл

@ -28,6 +28,14 @@ jobs:
steps:
- template: ./win/ci.yml
- job: Test
pool:
name: Azure-Pipelines-EO-Batch-Explorer
demands:
- ImageOverride -equals BatchExplorerBuildImage-Linux
steps:
- template: ./linux/test.yml
- job: RegisterDependencies
displayName: Register dependencies
pool:

Просмотреть файл

@ -5,7 +5,7 @@ steps:
versionSpec: '3.8.x'
displayName: Install Python 3.8 for Batch Explorer
- bash: ./scripts/azpipelines/setup-python.sh
- bash: ./.vsts/common/setup-python.sh
displayName: Set up Python environment and private feed
- task: PipAuthenticate@1
@ -16,7 +16,7 @@ steps:
- script: |
set -e
. "$(Agent.WorkFolder)/.venv/batchexplorer/bin/activate"
pip install -r python/requirements.txt
pip install -r desktop/python/requirements.txt
condition: ne( variables['Agent.OS'], 'Windows_NT' )
displayName: Install Python dependencies (Linux)
@ -24,6 +24,6 @@ steps:
. .vsts/win/exec.ps1
$ErrorActionPreference = "Stop"
$(Agent.WorkFolder)\.venv\batchexplorer\Scripts\Activate.ps1
exec { pip install -r python/requirements.txt }
exec { pip install -r desktop/python/requirements.txt }
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: Install Python dependencies (Windows)

Просмотреть файл

@ -8,10 +8,11 @@ pool:
steps:
- template: ./node-setup.yml
- script: npm ci
- script: yarn install
displayName: Install dependencies
- script: npm run build-i18n-xliff
- script: yarn build-i18n-xliff
workingDirectory: desktop
displayName: Build english XLIFF file
- script: |

Просмотреть файл

@ -4,15 +4,16 @@ steps:
- powershell: |
$(Agent.WorkFolder)\.venv\batchexplorer\Scripts\Activate.ps1
npm run build-and-pack
yarn build:package
displayName: Build and package
- powershell: |
. .vsts/win/exec.ps1
. ../.vsts/win/exec.ps1
$ErrorActionPreference = "Stop"
$env:BE_TEST_AAD_USER_EMAIL = "$(uiTestingAccountEmail)"
$env:BE_TEST_AAD_USER_PASSWORD = "$(uiTestingAccountPassword)"
npm run test-e2e
yarn test-e2e
workingDirectory: desktop
displayName: End to end tests
- template: ./security-analysis.yml

Просмотреть файл

@ -3,7 +3,7 @@ steps:
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
displayName: "Run CredScan"
inputs:
suppressionsFile: test/cred-scan-exclude.json
suppressionsFile: .vsts/cred-scan-exclude.json
toolMajorVersion: V2
debugMode: false

Просмотреть файл

@ -1,16 +1,20 @@
steps:
- template: ./credscan.yml
- template: ./win-dependencies.yml
- powershell: ./scripts/azpipelines/update-build-name.ps1
displayName: Resolve version
- powershell: |
. .vsts/win/exec.ps1
$ErrorActionPreference = "Stop"
$(Agent.WorkFolder)\.venv\batchexplorer\Scripts\Activate.ps1
exec { npm run build:prod }
exec { npm run build-python }
exec { npm run package win-exe }
displayName: Build executable
exec { yarn build:prod }
exec { yarn build-python }
exec { yarn package win-exe }
workingDirectory: desktop
exec { yarn build:prod }
displayName: Build all packages
- template: ./security-analysis.yml
@ -21,7 +25,9 @@ steps:
**/*.exe
**/*.dll
!**/python36.dll
- powershell: npm run package win-installer
- powershell: yarn package win-installer
workingDirectory: desktop
displayName: Build installer
- template: ./sign.yml
@ -29,7 +35,9 @@ steps:
name: "Sign installer"
pattern: |
**/BatchExplorer*Setup*.exe
- powershell: npm run package win-manifest
- powershell: yarn package win-manifest
workingDirectory: desktop
displayName: Create manifest
- template: ../common/generate-sbom.yml
- template: ../common/publish-artifacts.yml

Просмотреть файл

@ -9,7 +9,7 @@ steps:
displayName: ${{ parameters.name }}
inputs:
ConnectedServiceName: 'ESRP CodeSign'
FolderPath: ./release
FolderPath: ./desktop/release
Pattern: ${{ parameters.pattern }}
UseMinimatch: true
signConfigType: inlineSignParams

Просмотреть файл

@ -1,12 +1,11 @@
steps:
- template: ../dependencies.yml
# KLUDGE: Use `npm i` instead of `npm ci` due to this issue:
# https://github.com/npm/cli/issues/558#issuecomment-580392554
- powershell: |
. .vsts/win/exec.ps1
$ErrorActionPreference = "Stop"
exec { Write-Host "Node.js version" $(node --version) }
exec { Write-Host "NPM version" $(npm --version) }
exec { npm install --loglevel=error }
exec { Write-Host "Yarn version" $(yarn --version) }
exec { yarn install }
displayName: Install Windows dependencies

53
README-tmp.md Normal file
Просмотреть файл

@ -0,0 +1,53 @@
# Azure Batch Shared User Interface Libraries
This directory contains Typescript libraries intended for use across various Batch UIs. These packages depend on each other and can be built together using the scripts inside the root package.json.
## Package Layout
These libraries consist of various NPM packages which are meant to be distributed (in the `packages/` directory), along with private utility packages which are for development only (in the `util/` directory).
- `packages/common` - A common package intended to be able to run in a Node.js environment as well as a web browser environment. Has minimal external dependencies, and provides various core functions and interfaces such as:
- A common HTTP layer which wraps specific implementations of HTTP auth and transport (such as the Azure Portal's `batch()` API for sending/receiving multiple logical HTTP requests in a single request/response)
- A reactive data layer for forms, intended to act as a view model for a form UI
- `packages/react` - A React-based component package specifically designed to be deployed in an Azure Portal ReactView blade. Its peerDependencies are tailored toward a specific version of the Azure Portal SDK, and should be kept up to date with the version of the SDK that we are targeting. This packages builds a small AMD-compatible file which excludes any dependencies which the Azure Portal already provides such as React, FluentUI and Redux.
- `packages/standalone` - A package targeted for deployment in a web browser. Builds a single Javascript bundle which contains all of its required dependencies, and includes any UI components which do not make sense in the portal, such as those for top-level navigation, authentication, etc.
## Development Prerequisites
Before developing against these libraries, make sure you have installed:
- [Node.js](https://nodejs.org) 14 or higher
- [Yarn](https://classic.yarnpkg.com) 1.2 stable (**not** Yarn 2.x)
## Building and Running Tests
To build the shared libraries, run the following from the same directory as this README.md:
```shell
yarn install && yarn build:clean
```
## Unit Tests
Unit tests are automatically run via [Jest](https://jestjs.io/) when invoking any `build` script. To develop tests live, `cd` to the package's directory (for example `packages/common`) then run the command:
```shell
yarn test:watch
```
This will start Jest in an interactive mode and watch the source code for changes, rebuilding and rerunning tests automatically.
To set breakpoints and debug tests, run `yarn test:debug`, then open Edge or Chrome and go to [edge://inspect](edge://inspect) or [chrome://inspect](edge://inspect) respectively. This should auto-detect the running Node.js debugger port, and allow you to connect the Chromium dev tools. Note that when the debugger connects, execution will have already been paused. To resume, click the play button in your debugger.
## Developing in a Local Web Server
To start a development server and watch for changes, `cd` to the `packages/standalone` directory and run the following command:
```shell
yarn start
```
This will start a webpack dev server at <http://127.0.0.1:9000> and watch for any changes to the `standalone` package. To pick up live changes from other packages, run `yarn watch` either from the same directory as this README.md, or from the individual package directory.

Просмотреть файл

@ -0,0 +1,14 @@
{
"extends": [
"../util/common-config/.eslintrc-common.json"
],
"rules": {
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"no-case-declarations": "off",
"no-extra-boolean-cast": "off",
"no-useless-escape": "off"
}
}

134
desktop/.eslintrc.js Normal file
Просмотреть файл

@ -0,0 +1,134 @@
module.exports = {
ignorePatterns: [
"node_modules/**/*",
"**/node_modules/**/*",
"lib/**/*",
"build/**/*",
"python/**/*",
"docs/**/*",
"data/**/*"
],
env: {
browser: true,
es6: true,
node: true
},
overrides: [
/*
* TYPESCRIPT FILES
*/
{
files: ["src/**/*.ts"],
extends: [
".eslintrc.desktop.json",
"prettier"
],
plugins: [
"@angular-eslint/eslint-plugin",
"@angular-eslint/eslint-plugin-template",
"@typescript-eslint"
],
rules: {
"@angular-eslint/component-selector": [
"error",
{
type: "element",
prefix: ["bl", "be"],
style: "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
type: "attribute",
prefix: ["bl", "be"],
style: "camelCase"
}
],
"@angular-eslint/no-forward-ref": "off",
"@angular-eslint/no-input-rename": "warn",
"@angular-eslint/use-lifecycle-interface": "warn",
"@typescript-eslint/no-var-requires": "warn",
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/ban-ts-comment": "warn"
}
},
/*
* COMPONENT TEMPLATES
*/
{
files: ["src/**/*.html"],
extends: [
"plugin:@angular-eslint/template/recommended"
],
rules: {
"@angular-eslint/template/use-track-by-function": "warn",
"max-len": "off"
}
},
/*
* @BATCH-FLASK
*/
{
files: ["src/@batch-flask/**/*.ts"],
rules: {
"no-restricted-imports": [
"error",
{
paths: [
{
name: "app",
message: "Importing modules in @batch-flask from app/* is forbidden"
},
{
name: "common",
message: "Importing modules in @batch-flask from common/* is forbidden"
}
],
patterns: ["app/*", "common/*"]
}
]
}
},
/*
* NODE SCRIPTS
*/
{
files: ["scripts/**/*.ts", "config/**/*.ts"],
extends: [
".eslintrc.desktop.json",
"prettier"
],
parserOptions: {
project: [
"tsconfig.eslint.json"
],
tsconfigRootDir: __dirname,
sourceType: "script",
createDefaultProgram: false
},
rules: {
"@typescript-eslint/no-var-requires": "off",
"no-console": "off",
"no-constant-condition": ["error", { "checkLoops": false }]
}
},
{
files: [
"scripts/**/*.js",
"config/**/*.js",
"test/client/**/*.js",
"test/spectron/run.js",
"karma.conf.js"],
extends: [
"eslint:recommended",
"prettier"
],
rules: {
"@typescript-eslint/no-var-requires": "off",
"no-console": "off",
"no-constant-condition": ["error", { "checkLoops": false }]
}
}
]
};

17
desktop/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,17 @@
build/
dll/
typings/
logs/
*.log*
*.mem.csv
.awcache
*.stackdump
.nyc_output/
coverage.lcov
documentation/
.python-version
# Ignore the english compiled file
i18n/resources.en.json
i18n/xliff/
i18n/xliffs/

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -1,5 +1,6 @@
const webpack = require("webpack");
const helpers = require("./helpers");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const { AngularCompilerPlugin } = require("@ngtools/webpack");
@ -23,6 +24,12 @@ const baseConfig = {
resolve: {
extensions: [".ts", ".js", ".json", ".scss", ".css", ".html"],
modules: [helpers.root(), helpers.root("src"), "node_modules"],
alias: {
// Prevent duplicate copies of react from being resolved
// (See https://github.com/facebook/react/issues/13991)
react: path.resolve("../node_modules/react"),
"react-dom": path.resolve('../node_modules/react-dom'),
},
},
module: {

Просмотреть файл

@ -1,14 +1,11 @@
const config = require("./webpack.config.base");
const path = require("path");
const webpack = require("webpack");
const merge = require("webpack-merge");
const helpers = require("./helpers");
const DefinePlugin = require("webpack/lib/DefinePlugin");
const WriteFilePlugin = require("write-file-webpack-plugin");
const { defineEnv } = require("./webpack.common");
const EvalSourceMapDevToolPlugin = require("webpack/lib/EvalSourceMapDevToolPlugin");
const webpackMergeDll = merge.strategy({ plugins: "replace" });
merge.strategy({ plugins: "replace" });
const ENV = "development";
const host = "localhost";

Просмотреть файл

@ -1,8 +1,5 @@
const config = require("./webpack.config.base");
const helpers = require("./helpers");
const path = require("path");
const DefinePlugin = require("webpack/lib/DefinePlugin");
const webpack = require("webpack");
const LoaderOptionsPlugin = require("webpack/lib/LoaderOptionsPlugin");
const merge = require("webpack-merge");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");

Просмотреть файл

@ -1,6 +1,4 @@
const DefinePlugin = require("webpack/lib/DefinePlugin");
const config = require("./webpack.config.base");
const webpack = require("webpack");
const helpers = require("./helpers");
const { commonRules, defineEnv } = require("./webpack.common");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
@ -59,7 +57,7 @@ config.module.rules = config.module.rules = [
],
exclude: [
helpers.root("src/test"),
/\.(e2e|spec)\.ts$/,
/\.(e2e|spec)\.(ts)$/,
/node_modules/
]
}

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/prefer-namespace-keyword */
declare module "element-resize-detector" {
module ElementResizeDetectorMaker {

Просмотреть файл

Просмотреть файл

@ -8,7 +8,7 @@ files:
- "build/"
- "package.json"
- "dev-app-update.yml"
- "!node_modules/jschardet/"
- "!../node_modules/jschardet/"
extraResources:
- from: "python/dist/main"
@ -18,7 +18,7 @@ extraResources:
- "ThirdPartyNotices.txt"
- "data"
- "i18n"
- "node_modules/jschardet/"
- "../node_modules/jschardet/"
protocols:
- name: "BatchExplorer protocol"

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

233
desktop/package.json Normal file
Просмотреть файл

@ -0,0 +1,233 @@
{
"name": "batch-explorer",
"sideEffects": [
"src/@batch-flask/extensions/*",
"src/app/environment.ts",
"src/app/commands/**/*",
"*.scss"
],
"productName": "Batch Explorer",
"description": "Batch Explorer is a tool to manage your Azure Batch accounts",
"repository": {
"type": "git",
"url": "https://github.com/Azure/BatchExplorer"
},
"author": {
"name": "Microsoft Corporation",
"email": "tiguerin@microsoft.com"
},
"version": "2.9.0",
"main": "build/client/main.prod.js",
"scripts": {
"ts": "ts-node --project tsconfig.node.json --files",
"ts:fast": "yarn ts -T",
"start": "yarn electron:prod",
"clean": "rimraf build/* dll/* python/dist/* python/build/*",
"karma": "node --max_old_space_size=4096 ../node_modules/karma/bin/karma",
"test": "yarn test-client:coverage && yarn test-app",
"test-app": "cross-env COVERAGE=1 yarn karma start",
"test-app:mem": "cross-env DEBUG_MEM=1 yarn test-app",
"test-app-watch": "yarn karma start --auto-watch --no-single-run",
"test-app-watch:time": "cross-env DEBUG_TIME=1 yarn test-app-watch",
"test-browser": "yarn test-app",
"test-browser-watch": "yarn test-app-watch",
"test-client": "cross-env NODE_ENV=test node test/client/run-jasmine.js",
"test-client:coverage": "nyc -e .ts -x \"*.spec.ts\" yarn test-client && nyc report --reporter=text-lcov > coverage.lcov",
"test-client-watch": "yarn test-client --watch",
"test-e2e": "playwright test",
"test-e2e:debug": "playwright test --debug",
"test-models": "yarn ts scripts/swagger/validate-models.ts",
"build-client": " tsc -p tsconfig.node.json",
"build-client:dev": " tsc -p tsconfig.node.json --noUnusedLocals false",
"build-app": "yarn webpack --profile --colors --display-error-details --display-cached",
"build-python": "pyinstaller python/main.spec -y --distpath=python/dist --workpath=python/build",
"build-i18n": "yarn ts scripts/i18n/generate.ts",
"build-i18n-xliff": "yarn ts scripts/i18n/create-xliff.ts",
"build-i18n-digest": "yarn ts scripts/i18n/digest-xliff.ts",
"build": "yarn clean && yarn build-client && yarn build-app && yarn build-i18n",
"build:clean": "yarn build",
"build:package": "yarn build:prod && yarn build-python && yarn package",
"build:prod": "cross-env NODE_ENV=production yarn build",
"build:test": "yarn build && yarn test",
"watch": "yarn webpack --watch --progress --profile --colors --display-error-details --display-cached",
"electron": "electron build/client/main.js",
"electron:prod": "cross-env NODE_ENV=production electron build/client/main.js",
"dev": "concurrently --kill-others \"yarn dev-server\" \"yarn dev-electron\"",
"dev-electron": "cross-env HOT=1 electron build/client/main.js",
"dev-server": "yarn webpack-dev-server --hot --inline --colors --content-base app/",
"eslint": "eslint -c .eslintrc.js . --quiet",
"eslint:verbose": "eslint -c .eslintrc.js .",
"stylelint": "stylelint --syntax scss \"src/app/**/*.scss\"",
"lint": "yarn eslint && yarn stylelint",
"lint:fix": "yarn eslint --fix && yarn stylelint",
"package": "yarn ts scripts/package/package.ts",
"start-publish": "yarn ts scripts/publish/publish.ts",
"webpack": "node --trace-deprecation --max_old_space_size=4096 ../node_modules/webpack/bin/webpack.js",
"webpack:stats": "cross-env NODE_ENV=production yarn webpack --profile --json > coverage/webpack-stats.json",
"webpack-dev-server": "node --trace-deprecation --max_old_space_size=4096 ../node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"rebuild:app-deps": "electron-builder install-app-deps",
"workspace:build": "yarn build",
"workspace:build:clean": "yarn build",
"workspace:build:desktop": "yarn build",
"workspace:build:desktop:client": "yarn build-client:dev",
"workspace:build:package": "yarn build:package",
"workspace:build:prod": "yarn build:prod",
"workspace:build:test": "yarn build:test",
"workspace:clean": "yarn clean",
"workspace:launch:desktop": "yarn dev",
"workspace:lint": "yarn lint",
"workspace:lint:fix": "yarn lint:fix",
"workspace:start:desktop": "yarn dev-server",
"workspace:test": "yarn test",
"workspace:test:desktop": "yarn test",
"workspace:test:all": "yarn test"
},
"license": "MIT",
"engines": {
"node": ">=10.0.0"
},
"devDependencies": {
"@angular-eslint/eslint-plugin": "^4.0.0",
"@angular-eslint/eslint-plugin-template": "^4.0.0",
"@angular-eslint/template-parser": "^4.0.0",
"@angular/compiler-cli": "^11.0.0",
"@batch/build-util": "^1.0.0",
"@batch/common-config": "^1.0.0",
"@batch/ui-common": "^1.0.0",
"@batch/ui-playground": "^1.0.0",
"@batch/ui-react": "^1.0.0",
"@batch/ui-service": "^1.0.0",
"@fluentui/react": "7.147.1",
"@fluentui/react-theme-provider": "0.16.2",
"@ngtools/webpack": "^11.0.0",
"@playwright/test": "^1.18.1",
"@types/chart.js": "^2.9.24",
"@types/d3": "^5.7.2",
"@types/extract-zip": "^1.6.2",
"@types/glob": "^7.1.3",
"@types/hammerjs": "^2.0.36",
"@types/inflection": "^1.5.28",
"@types/jasmine": "^3.5.12",
"@types/js-yaml": "^3.12.5",
"@types/luxon": "^1.24.3",
"@types/node": "^14.16.0",
"@types/node-fetch": "^2.5.7",
"@types/proxyquire": "^1.3.28",
"@types/react": "16.9.35",
"@types/react-dom": "16.9.8",
"@types/strip-json-comments": "^0.0.30",
"@types/tinycolor2": "^1.4.2",
"@types/webdriverio": "^4.13.3",
"@types/xml2js": "^0.4.5",
"@uifabric/azure-themes": "7.5.19",
"angular2-template-loader": "^0.6.2",
"colors": "^1.4.0",
"concurrently": "^5.3.0",
"copy-webpack-plugin": "^6.0.3",
"css-loader": "^2.1.1",
"electron": "12.2.3",
"electron-builder": "22.14.13",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "^31.6.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"file-loader": "^3.0.1",
"fork-ts-checker-webpack-plugin": "^5.1.0",
"html-webpack-plugin": "^3.2.0",
"istanbul-instrumenter-loader": "^3.0.1",
"jasmine": "~3.5.0",
"jasmine-core": "^3.6.0",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^6.3.14",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.3",
"karma-electron": "^6.3.4",
"karma-jasmine": "^4.0.1",
"karma-jasmine-html-reporter": "^1.5.4",
"karma-junit-reporter": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-sourcemap-loader": "^0.3.8",
"karma-webpack": "^4.0.2",
"loader-utils": "^1.4.0",
"merge2": "^1.4.1",
"mini-css-extract-plugin": "^0.5.0",
"monaco-editor": "^0.19.0",
"monaco-editor-webpack-plugin": "^1.9.0",
"node-fetch": "^2.6.7",
"nyc": "^15.1.0",
"playwright": "^1.18.1",
"prettier": "^2.2.1",
"proxyquire": "^2.1.3",
"raw-loader": "^1.0.0",
"react": "16.13.1",
"react-dom": "16.13.1",
"rimraf": "^2.7.1",
"sass": "^1.26.10",
"sass-loader": "^9.0.3",
"style-loader": "^0.23.1",
"stylelint": "^13.6.1",
"to-string-loader": "^1.1.6",
"ts-loader": "^5.4.5",
"ts-node": "^8.10.2",
"tslib": "~2.3.1",
"typescript": "~4.1.0",
"url-loader": "^1.1.2",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",
"webpack-inline-manifest-plugin": "^4.0.1",
"webpack-merge": "^4.2.2",
"yesno": "^0.0.1"
},
"dependencies": {
"@angular/animations": "^11.0.0",
"@angular/cdk": "^11.0.0",
"@angular/common": "^11.0.0",
"@angular/compiler": "^11.0.0",
"@angular/core": "^11.0.0",
"@angular/forms": "^11.0.0",
"@angular/material": "^11.0.0",
"@angular/platform-browser": "^11.0.0",
"@angular/platform-browser-dynamic": "^11.0.0",
"@angular/platform-server": "^11.0.0",
"@angular/router": "^11.0.0",
"@azure/msal-node": "^1.3.1",
"@azure/storage-blob": "^10.5.0",
"applicationinsights": "^1.8.5",
"azure-storage": "^2.10.4",
"chart.js": "^2.9.3",
"chokidar": "^3.4.3",
"commander": "^8.0.0",
"d3": "^5.16.0",
"decode-uri-component": "^0.2.0",
"download": "^8.0.0",
"electron-updater": "^4.3.8",
"element-resize-detector": "^1.2.1",
"extract-zip": "^1.6.7",
"focus-visible": "^4.1.5",
"font-awesome": "^4.7.0",
"get-proxy-settings": "^0.1.12",
"glob": "^7.1.6",
"hammerjs": "^2.0.8",
"https-proxy-agent": "^3.0.0",
"immutable": "^3.8.2",
"inflection": "^1.12.0",
"js-yaml": "^3.14.0",
"jschardet": "^2.2.1",
"keytar": "^7.7.0",
"load-json-file": "^5.3.0",
"luxon": "^1.24.1",
"make-dir": "^2.1.0",
"node-abi": "^2.18.0",
"node-forge": "^1.0.0",
"patternomaly": "^1.3.2",
"reflect-metadata": "^0.1.13",
"rxjs": "^6.6.7",
"strip-json-comments": "^2.0.1",
"tinycolor2": "^1.4.1",
"winston": "^3.3.3",
"winston-daily-rotate-file": "^3.10.0",
"write-file-webpack-plugin": "^4.5.1",
"xml2js": "^0.4.23",
"zone.js": "^0.11.0"
}
}

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -1,4 +1,4 @@
$version = npm run -s ts "scripts/package/get-version.ts"
$version = yarn ts "scripts/package/get-version.ts"
Write-Host "Updating build number to $version"
Write-Host "##vso[build.updatebuildnumber]$version"

Просмотреть файл

Просмотреть файл

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше