@angular-custom-builders/lite-serve
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -6,8 +6,8 @@ { | ||
"schematics": { | ||
"liteServe": { | ||
"setup": { | ||
"factory": "./src/schematics/lite-serve/schematic", | ||
"schema": "./src/schematics/lite-serve/schema.json", | ||
"description": "lite-serve schematic" | ||
"description": "Add the lite-serve to a specific app" | ||
} | ||
} | ||
} |
{ | ||
"name": "@angular-custom-builders/lite-serve", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Custom builder to run lite-server with options", | ||
@@ -17,3 +17,6 @@ "main": "src/index.js", | ||
}, | ||
"dependencies": { | ||
"browser-sync": "^2.26.7" | ||
}, | ||
"typings": "src/index.d.ts" | ||
} |
@@ -94,1 +94,55 @@ # lite-serve | ||
## Quick-start using Nx <a name="quickstart"></a> | ||
1. Create a new project with the nx cli. | ||
```sh | ||
npx create-nx-workspace@latest workspace --preset="angular" --appName="myapp" --style="css" | ||
cd myapp | ||
``` | ||
1. Add `lite-serve` dependency | ||
```sh | ||
yarn add -D @angular-custom-builders/lite-serve | ||
``` | ||
1. Add a new section on the app | ||
```json | ||
"lite-serve": { | ||
"builder": "@angular-custom-builders/lite-serve:dist-serve", | ||
"options": { | ||
"browserTarget": "myapp:build" | ||
} | ||
} | ||
``` | ||
1. Change the e2e to use the lit-serve | ||
In case of Cypress | ||
```json | ||
"e2e": { | ||
"builder": "@nrwl/cypress:cypress", | ||
"options": { | ||
"cypressConfig": "apps/myapp-e2e/cypress.json", | ||
"tsConfig": "apps/myapp-e2e/tsconfig.e2e.json", | ||
"devServerTarget": "myapp:lite-serve" | ||
} | ||
}, | ||
``` | ||
In case of Protractor | ||
```json | ||
"e2e": { | ||
"builder": "@angular-devkit/build-angular:protractor", | ||
"options": { | ||
"protractorConfig": "apps/admin-ee-e2e/protractor.conf.js", | ||
"devServerTarget": "myapp:lite-serve" | ||
} | ||
}, | ||
``` | ||
1. Run the e2e with an existing dist folder | ||
```sh | ||
ng run myapp-e2e:e2e | ||
``` |
@@ -6,22 +6,28 @@ "use strict"; | ||
const rxjs_1 = require("rxjs"); | ||
const operators_1 = require("rxjs/operators"); | ||
const browserSync = require("browser-sync"); | ||
browserSync.create(); | ||
function runBuilder(options, context) { | ||
return rxjs_1.of({ success: true }).pipe(operators_1.tap(() => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
let outputPath = 'dist'; | ||
if (options.browserTarget) { | ||
const browserTarget = architect_1.targetFromTargetString(options.browserTarget); | ||
const rawBrowserOptions = yield context.getTargetOptions(browserTarget); | ||
outputPath = rawBrowserOptions.outputPath; | ||
return rxjs_1.Observable.create((observer) => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
try { | ||
let outputPath = 'dist'; | ||
if (options.browserTarget) { | ||
const browserTarget = architect_1.targetFromTargetString(options.browserTarget); | ||
const rawBrowserOptions = yield context.getTargetOptions(browserTarget); | ||
outputPath = rawBrowserOptions.outputPath; | ||
} | ||
browserSync.init({ | ||
port: options.port, | ||
server: outputPath, | ||
watch: false, | ||
open: options.open, | ||
logLevel: options.logLevel | ||
}); | ||
context.logger.info(`lite-serve serving folder ${outputPath} on port ${options.port}`); | ||
observer.next({ success: true }); | ||
observer.complete(); | ||
} | ||
browserSync.init({ | ||
port: options.port, | ||
server: outputPath, | ||
watch: false, | ||
open: options.open, | ||
logLevel: options.logLevel | ||
}); | ||
context.logger.info(`lite-serve serving folder ${outputPath} on port ${options.port}`); | ||
}))); | ||
catch (e) { | ||
observer.error(`ERROR: Something went wrong in @angular-custom-builders/lite-serve - ${e.message}`); | ||
} | ||
})); | ||
} | ||
@@ -28,0 +34,0 @@ exports.runBuilder = runBuilder; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16241
249
148
1
+ Addedbrowser-sync@^2.26.7
+ Added@socket.io/component-emitter@3.1.2(transitive)
+ Added@types/cookie@0.4.1(transitive)
+ Added@types/cors@2.8.17(transitive)
+ Added@types/node@22.7.4(transitive)
+ Addedaccepts@1.3.8(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedanymatch@3.1.3(transitive)
+ Addedasync@2.6.4(transitive)
+ Addedasync-each-series@0.1.1(transitive)
+ Addedaxios@0.21.4(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbase64id@2.0.0(transitive)
+ Addedbatch@0.6.1(transitive)
+ Addedbinary-extensions@2.3.0(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedbrowser-sync@2.29.3(transitive)
+ Addedbrowser-sync-client@2.29.3(transitive)
+ Addedbrowser-sync-ui@2.29.3(transitive)
+ Addedbs-recipes@1.3.4(transitive)
+ Addedbytes@3.1.2(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedchokidar@3.6.0(transitive)
+ Addedcliui@7.0.48.0.1(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcommander@2.20.3(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconnect@3.6.6(transitive)
+ Addedconnect-history-api-fallback@1.6.0(transitive)
+ Addedcookie@0.4.2(transitive)
+ Addedcors@2.8.5(transitive)
+ Addeddebug@2.6.94.3.24.3.7(transitive)
+ Addeddepd@1.1.22.0.0(transitive)
+ Addeddestroy@1.0.4(transitive)
+ Addeddev-ip@1.0.1(transitive)
+ Addedeasy-extender@2.3.4(transitive)
+ Addedeazy-logger@4.0.1(transitive)
+ Addedee-first@1.1.1(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedencodeurl@1.0.2(transitive)
+ Addedengine.io@6.6.1(transitive)
+ Addedengine.io-client@6.6.1(transitive)
+ Addedengine.io-parser@5.2.3(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedescape-html@1.0.3(transitive)
+ Addedetag@1.8.1(transitive)
+ Addedeventemitter3@4.0.7(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfinalhandler@1.1.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedfresh@0.5.2(transitive)
+ Addedfs-extra@3.0.1(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhttp-errors@1.6.32.0.0(transitive)
+ Addedhttp-proxy@1.18.1(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedimmutable@3.8.2(transitive)
+ Addedinherits@2.0.32.0.4(transitive)
+ Addedis-binary-path@2.1.0(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedis-number-like@1.0.8(transitive)
+ Addedis-wsl@1.1.0(transitive)
+ Addedjsonfile@3.0.1(transitive)
+ Addedlimiter@1.1.5(transitive)
+ Addedlocaltunnel@2.0.2(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlodash.isfinite@3.3.2(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedmime@1.4.1(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedmitt@1.2.0(transitive)
+ Addedms@2.0.02.1.22.1.3(transitive)
+ Addednegotiator@0.6.3(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedon-finished@2.3.0(transitive)
+ Addedopenurl@1.1.1(transitive)
+ Addedopn@5.3.0(transitive)
+ Addedparseurl@1.3.3(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedportscanner@2.2.0(transitive)
+ Addedrange-parser@1.2.1(transitive)
+ Addedraw-body@2.5.2(transitive)
+ Addedreaddirp@3.6.0(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedrequires-port@1.0.0(transitive)
+ Addedresp-modifier@6.0.2(transitive)
+ Addedrx@4.1.0(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsend@0.16.2(transitive)
+ Addedserve-index@1.9.1(transitive)
+ Addedserve-static@1.13.2(transitive)
+ Addedserver-destroy@1.0.1(transitive)
+ Addedsetprototypeof@1.1.01.2.0(transitive)
+ Addedsocket.io@4.8.0(transitive)
+ Addedsocket.io-adapter@2.5.5(transitive)
+ Addedsocket.io-client@4.8.0(transitive)
+ Addedsocket.io-parser@4.2.4(transitive)
+ Addedstatuses@1.3.11.4.01.5.02.0.1(transitive)
+ Addedstream-throttle@0.1.3(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addedua-parser-js@1.0.39(transitive)
+ Addedundici-types@6.19.8(transitive)
+ Addeduniversalify@0.1.2(transitive)
+ Addedunpipe@1.0.0(transitive)
+ Addedutils-merge@1.0.1(transitive)
+ Addedvary@1.1.2(transitive)
+ Addedwrap-ansi@7.0.0(transitive)
+ Addedws@8.17.1(transitive)
+ Addedxmlhttprequest-ssl@2.1.1(transitive)
+ Addedy18n@5.0.8(transitive)
+ Addedyargs@17.1.117.7.2(transitive)
+ Addedyargs-parser@20.2.921.1.1(transitive)