-
Notifications
You must be signed in to change notification settings - Fork 1
Description
[enhancement] Integrate with reportage and TypeScript
[monitoring] Introduce monitoring mode
Motivations
- Integration with
reportagetest runner - Shorter build cycle for debugging and testing
- Infrastructure for further enhancements
Design Principles
- When
monitoringmode is disabled, the build is the same as before the mode is introduced - When
monitoringmode is enabled, some security features are temporarily loosened so thatreportagecan work withthin-hookapplications - In addition to Chrome for Linux, Chrome for Windows is supported via WSL and VMware (as host and guest)
Components and Features
-
NEW
enableMonitoring: Enable/Disable monitoring mode- NEW config:
['mode'].enableMonitoring:trueorfalse
- NEW config:
-
NEW
monitor: Startmonitorservers- NEW command task:
monitor
- NEW command task:
-
NEW
monitorServer: StartmonitorHTTPS server- NEW command task:
monitorServercalled frommonitor
- NEW command task:
-
config:
bootstrap-js: Allow no-hook scripts from reporter server- config:
['bootstrap-js'].additionalParameters:trueonenableMonitoring - NEW config:
['bootstrap-js'].enableMonitoring - NEW config:
['bootstrap-js'].reporterOrigin - NEW config:
[path.base]/[path.config]/bootstrap-js/parameters.js:hook.parameters.noHookforreporterOriginifenableMonitoringistrue
- config:
-
config:
policy: Allow no-hook scripts from reporter server- NEW config:
['policy'].enableMonitoring - NEW config:
['policy'].reporterOrigin: Allow reporter and test scripts to run as no-hook - config:
[path.base]/[path.config]/wildcardWhitelist.js: Inmonitoringmode, allowreportage's reporterOrigin scripts to run as no-hook
- NEW config:
-
NEW
generate-version: Flexible customization of app version at['hook-min-js'].searchParams.version- NEW plugin:
@thin-hook/generate-version - NEW task:
generate-version - NEW config:
['generate-version'] - phase:
init
- NEW plugin:
-
NEW
reportage-nginx-conf: Generate[path.base]/nginx.confforreportagereporter server- NEW task:
reportage-nginx-conf - NEW plugin:
@thin-hook/reportage-nginx-conf - NEW config:
['reportage-nginx-conf'] - NEW config:
[path.base]/[path.config]/reportage-nginx-conf/nginx.conf: template for[path.base]/nginx.conf - phase:
reportage
- NEW task:
-
NEW
reportage-config-js: Generate[path.base]/[path.test]/reportage.config.jsforreportage- NEW task:
reportage-config-js - NEW plugin:
@thin-hook/reportage-config-js - NEW config:
['reportage-config-js'] - NEW config:
[path.base]/[path.config]/reportage-config-js/reportage.config.js: template for[path.base]/[path.test]/reportage.config.js - NEW config:
[path.base]/[path.test]/package.json: Set"type":"module"to load[path.base]/[path.test]/*.js as ES modules - phase:
reportage
- NEW task:
-
NEW sample tests for
reportage- NEW module:
[path.base]/[path.test]/suites-loader.js - NEW module:
[path.base]/[path.test]/common-suite.js - NEW module:
[path.base]/[path.test]/basic-suite.js
- NEW module:
-
NEW
reportage-nginx-mkdir-log: Create[path.base]/[path.test]/logdirectory- NEW command task:
reportage-nginx-mkdir-log
- NEW command task:
-
NEW
reportage-nginx-start: Start nginx in background- NEW command task:
reportage-nginx-start - NEW config:
['reportage-nginx-conf']
- NEW command task:
-
NEW
reportage-nginx-stop: Stop nginx- NEW command task:
reportage-nginx-stop - NEW config:
['reportage-nginx-conf']
- NEW command task:
-
NEW
reportage-nginx-foreground: Start nginx in foreground- NEW command task:
reportage-nginx-foreground - NEW config:
['reportage-nginx-conf']
- NEW command task:
-
NEW
reportage-run: StartreportageCLI test- NEW command task:
reportage-run - NEW config:
['reportage-config-js']
- NEW command task:
-
NEW
reportage-browser: Launch Chrome browser locally on Linux withreportageconfigurations- NEW command task:
reportage-browser - NEW config:
['reportage-config-js']
- NEW command task:
-
NEW
reportage-browser-wsl: Launch Chrome for Windows from within Ubuntu WSL withreportageconfigurations- NEW command task:
reportage-browser-wsl - NEW config:
['reportage-config-js']
- NEW command task:
-
NEW
reportage-browser-windows-cmd: Generate a Windows cmd file for launching Chrome for Windows withreportageconfigurations for VMware- NEW command task:
reportage-browser-windows-command - NEW config:
['reportage-config-js']
- NEW command task:
-
generate-cert-sh: Support wildcard host names forreportage- plugin:
@thin-hook/generate-cert-sh - shell script
[path.base]/[path.keys]/generate_cert.sh:1.localhost...32.localhost,*.${SERVER_HOST} - keys:
[path.base]/[path.keys]/[certificates.CA]/wildcard.${HOST}.[key|crt]
- plugin:
-
cache-bundle-automation: DeprecatecacheBundleUploadServiceand useerrorReportServiceinstead- command task :
cache-bundle-automation
- command task :
-
cache-bundle-js: Supportmonitormode- plugin:
@thin-hook/cache-bundle-js: Inmonitoringmode, skip collecting data forcache-bundle.json
- plugin:
-
update-html-hash: DeprecatecacheBundleUploadServiceand useerrorReportServiceinstead- command task :
update-html-hash
- command task :
-
integrity-service-helpers: Skip building if already built- command task :
integrity-service-helpers - plugin:
[path.backend]/integrity-service-helpers
- command task :
-
validation-console: Skip building if already built- command task :
validation-console - plugin:
[path.backend]/validatioin-console
- command task :
-
cacheBundleGeneration.js: Avoid deprecated puppeteer APIpage.waitFor()- plugin:
[path.backend]/cacheBundleGeneration.js
- plugin:
-
integrityService.js: Supportmonitormode- plugin:
[path.backend]/integrityService.js: Inmonitormode, skip the host name (authority) check and the hash (ClientIntegrity) validation forreportageto work
- plugin:
-
cache-automation-js: Supportmonitormode- NEW script:
[path.base]/[path.config]/cache-automation-js/monitoring-automation.js: importreportagereporter script - script:
[path.base]/[path.config]/cache-automation-js/automation.js: includemonitoring-automation.jsifenableMonitoringistrue
- NEW script:
[enhancement] TypeScript support
Motivations
- TypeScript is the de-facto standard for the current web development
- Language features beyond ES2018 can be supported through transpilation
Design Principles
- Compatible libraries (ES2018-target) can replace the released versions to achieve compatibility
transpilephase is newly introduced to preprocess the sources into executable JavaScript- The target directory of the
transpilephase can be eitherrootorrawdirectory - Both bundling and raw execution are supported with the same module access policies
Components and Features
-
NEW
transpileTarget: Configure where to performtranspilephase tasks;raworroot- NEW config:
['path'].transpileTarget:raworroot
- NEW config:
-
NEW
build-compat-libs: Build compatible libraries for thin-hook (ES2018)- NEW command task:
build-compat-libs - NEW config:
['path'].compatLib - NEW shell script:
[path.base]/[path.compatLib]/build-compat-libs.sh: any build scripts can be added- NEW sample shell script:
[path.base]/[path.compatLib]/build-react.sh: React with ESM exports - NEW sample shell script:
[path.base]/[path.compatLib]/build-material-web.sh:@material/webwith ES2018 target
- NEW sample shell script:
- phase:
prepare
- NEW command task:
-
NEW
non-js-imports: Support importing non-js contents from modules- NEW task:
non-js-imports - NEW plubin:
@thin-hook/non-js-imports - NEW config:
['non-js-imports'] - phase:
transpile
- NEW task:
-
NEW
frontend-modules-raw: Install frontend modules in[path.base]/[path.raw]/- NEW command task:
frontend-modules-raw - phase:
prepare
- NEW command task:
-
NEW
frontend-modules-locked-production: Install frontend modules in[path.base]/[path.root]/- NEW command task:
frontend-modules-locked-production - phase:
postTranspile
- NEW command task:
-
NEW
compile-scss: Compile scss to css in[path.base]/[path[path.tranpileTarget]]/- NEW command task:
compile-scss - NEW config:
['non-js-imports'].scssDirectories: get the list of directories with scss files - NEW package dependency:
sass - phase:
transpile
- NEW command task:
-
NEW
typescript: Compile TypeScript in[path.base]/[path[path.tranpileTarget]]/- NEW command task:
typescript - NEW package dependency:
typescript - phase:
transpile
- NEW command task:
Updated inject phases
-
inject: Introduce monitoring mode and TypeScript support- NEW phase:
init: typically [generate-version] - NEW phase:
prepare: typilcally [build-compat-libs,frontend-modules-raw] - NEW phase:
transpile: typilcally [compile-scss,typescript,non-js-imports] - NEW phase:
postTranspile: typically [frontend-modules-locked-production] - NEW phase:
reportage: typically [reportage-nginx-mkdir-log,reportage-nginx-conf,reportage-config-js] - NEW phase:
monitoring: typically [dummy-script-hashes-integrity,clean-gzip-json,dummy-integrity,cache-bundle-automation-json] - NEW phases
prepareRoot: list of phases for preparing[path.base]/[path.root]- phases with
transpileTarget:root: typically [prepare,clean,transpile,postTranspile] - phases with
transpileTarget:raw: typically [prepare,transpile,clean,postTranspile]
- phases with
- phases with
enableMonitoring:false: typically [init, ...prepareRoot,backend,plugin,cache,frontend] - phases with
enableMonitoring:true: typically [init, ...prepareRoot,backend,reportage,plugin,monitoring]
- NEW phase: