@sinclair/hammer
Advanced tools
Comparing version 0.17.2 to 0.18.0
@@ -9,5 +9,5 @@ export { folder, file, shell, watch, delay } from './task/global/index'; | ||
private build; | ||
private watch; | ||
private serve; | ||
private run; | ||
private watch; | ||
private monitor; | ||
@@ -14,0 +14,0 @@ private task; |
52
index.js
@@ -79,5 +79,5 @@ "use strict"; | ||
// ------------------------------------------------------------- | ||
// Watch | ||
// Serve | ||
// ------------------------------------------------------------- | ||
async watch(options) { | ||
async serve(options) { | ||
const cache = new index_2.Cache({ | ||
@@ -94,3 +94,3 @@ key: 'sourcePath', | ||
esm: options.esm, | ||
node: options.platform === 'node', | ||
node: false, | ||
bundle: true, | ||
@@ -103,4 +103,11 @@ watch: true, | ||
const watcher = (0, index_5.watch)([...options.sourcePaths, ...assets.map((asset) => asset.sourcePath)]); | ||
const server = (0, index_6.serve)({ | ||
targetDirectory: options.dist, | ||
port: options.port, | ||
cors: options.cors, | ||
sabs: options.sabs, | ||
}); | ||
this.disposables.push(watcher); | ||
this.disposables.push(builder); | ||
this.disposables.push(server); | ||
for await (const _ of watcher) { | ||
@@ -114,5 +121,5 @@ const assets = [...(0, index_4.resolve)(options.sourcePaths, options.dist)]; | ||
// ------------------------------------------------------------- | ||
// Serve | ||
// Run | ||
// ------------------------------------------------------------- | ||
async serve(options) { | ||
async run(options) { | ||
const cache = new index_2.Cache({ | ||
@@ -123,3 +130,3 @@ key: 'sourcePath', | ||
const builder = new index_3.Build({ | ||
platform: 'browser', | ||
platform: 'node', | ||
minify: options.minify, | ||
@@ -130,21 +137,16 @@ sourcemap: options.sourcemap, | ||
esm: options.esm, | ||
node: false, | ||
node: true, | ||
bundle: true, | ||
watch: true, | ||
}); | ||
const assets = [...(0, index_4.resolve)(options.sourcePaths, options.dist)]; | ||
const assets = [...(0, index_4.resolve)([options.sourcePath], options.dist)]; | ||
const actions = cache.update(assets); | ||
await builder.update(actions); | ||
const watcher = (0, index_5.watch)([...options.sourcePaths, ...assets.map((asset) => asset.sourcePath)]); | ||
const server = (0, index_6.serve)({ | ||
targetDirectory: options.dist, | ||
port: options.port, | ||
cors: options.cors, | ||
sabs: options.sabs, | ||
}); | ||
const watcher = (0, index_5.watch)([options.sourcePath, ...assets.map((asset) => asset.sourcePath)]); | ||
const process = (0, index_7.run)(options.entryPath, options.args); | ||
this.disposables.push(watcher); | ||
this.disposables.push(builder); | ||
this.disposables.push(server); | ||
this.disposables.push(process); | ||
for await (const _ of watcher) { | ||
const assets = [...(0, index_4.resolve)(options.sourcePaths, options.dist)]; | ||
const assets = [...(0, index_4.resolve)([options.sourcePath], options.dist)]; | ||
watcher.add(assets.map((asset) => asset.sourcePath)); | ||
@@ -156,5 +158,5 @@ const actions = cache.update(assets); | ||
// ------------------------------------------------------------- | ||
// Run | ||
// Watch | ||
// ------------------------------------------------------------- | ||
async run(options) { | ||
async watch(options) { | ||
const cache = new index_2.Cache({ | ||
@@ -165,3 +167,3 @@ key: 'sourcePath', | ||
const builder = new index_3.Build({ | ||
platform: 'node', | ||
platform: options.platform, | ||
minify: options.minify, | ||
@@ -172,16 +174,14 @@ sourcemap: options.sourcemap, | ||
esm: options.esm, | ||
node: true, | ||
node: options.platform === 'node', | ||
bundle: true, | ||
watch: true, | ||
}); | ||
const assets = [...(0, index_4.resolve)([options.sourcePath], options.dist)]; | ||
const assets = [...(0, index_4.resolve)(options.sourcePaths, options.dist)]; | ||
const actions = cache.update(assets); | ||
await builder.update(actions); | ||
const watcher = (0, index_5.watch)([options.sourcePath, ...assets.map((asset) => asset.sourcePath)]); | ||
const process = (0, index_7.run)(options.entryPath, options.args); | ||
const watcher = (0, index_5.watch)([...options.sourcePaths, ...assets.map((asset) => asset.sourcePath)]); | ||
this.disposables.push(watcher); | ||
this.disposables.push(builder); | ||
this.disposables.push(process); | ||
for await (const _ of watcher) { | ||
const assets = [...(0, index_4.resolve)([options.sourcePath], options.dist)]; | ||
const assets = [...(0, index_4.resolve)(options.sourcePaths, options.dist)]; | ||
watcher.add(assets.map((asset) => asset.sourcePath)); | ||
@@ -188,0 +188,0 @@ const actions = cache.update(assets); |
{ | ||
"name": "@sinclair/hammer", | ||
"version": "0.17.2", | ||
"version": "0.18.0", | ||
"description": "Build Tool for Browser and Node Applications", | ||
@@ -40,4 +40,4 @@ "author": "sinclairzx81", | ||
"dependencies": { | ||
"esbuild": "^0.15.7" | ||
"esbuild": "0.15.7" | ||
} | ||
} |
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
257833
+ Added@esbuild/linux-loong64@0.15.7(transitive)
+ Addedesbuild@0.15.7(transitive)
+ Addedesbuild-android-64@0.15.7(transitive)
+ Addedesbuild-android-arm64@0.15.7(transitive)
+ Addedesbuild-darwin-64@0.15.7(transitive)
+ Addedesbuild-darwin-arm64@0.15.7(transitive)
+ Addedesbuild-freebsd-64@0.15.7(transitive)
+ Addedesbuild-freebsd-arm64@0.15.7(transitive)
+ Addedesbuild-linux-32@0.15.7(transitive)
+ Addedesbuild-linux-64@0.15.7(transitive)
+ Addedesbuild-linux-arm@0.15.7(transitive)
+ Addedesbuild-linux-arm64@0.15.7(transitive)
+ Addedesbuild-linux-mips64le@0.15.7(transitive)
+ Addedesbuild-linux-ppc64le@0.15.7(transitive)
+ Addedesbuild-linux-riscv64@0.15.7(transitive)
+ Addedesbuild-linux-s390x@0.15.7(transitive)
+ Addedesbuild-netbsd-64@0.15.7(transitive)
+ Addedesbuild-openbsd-64@0.15.7(transitive)
+ Addedesbuild-sunos-64@0.15.7(transitive)
+ Addedesbuild-windows-32@0.15.7(transitive)
+ Addedesbuild-windows-64@0.15.7(transitive)
+ Addedesbuild-windows-arm64@0.15.7(transitive)
- Removed@esbuild/android-arm@0.15.18(transitive)
- Removed@esbuild/linux-loong64@0.15.18(transitive)
- Removedesbuild@0.15.18(transitive)
- Removedesbuild-android-64@0.15.18(transitive)
- Removedesbuild-android-arm64@0.15.18(transitive)
- Removedesbuild-darwin-64@0.15.18(transitive)
- Removedesbuild-darwin-arm64@0.15.18(transitive)
- Removedesbuild-freebsd-64@0.15.18(transitive)
- Removedesbuild-freebsd-arm64@0.15.18(transitive)
- Removedesbuild-linux-32@0.15.18(transitive)
- Removedesbuild-linux-64@0.15.18(transitive)
- Removedesbuild-linux-arm@0.15.18(transitive)
- Removedesbuild-linux-arm64@0.15.18(transitive)
- Removedesbuild-linux-mips64le@0.15.18(transitive)
- Removedesbuild-linux-ppc64le@0.15.18(transitive)
- Removedesbuild-linux-riscv64@0.15.18(transitive)
- Removedesbuild-linux-s390x@0.15.18(transitive)
- Removedesbuild-netbsd-64@0.15.18(transitive)
- Removedesbuild-openbsd-64@0.15.18(transitive)
- Removedesbuild-sunos-64@0.15.18(transitive)
- Removedesbuild-windows-32@0.15.18(transitive)
- Removedesbuild-windows-64@0.15.18(transitive)
- Removedesbuild-windows-arm64@0.15.18(transitive)
Updatedesbuild@0.15.7