Compare commits
2 Commits
48f2503807
...
02220d88ae
Author | SHA1 | Date |
---|---|---|
|
02220d88ae | |
|
a60907aaf4 |
|
@ -1415,6 +1415,11 @@
|
|||
"rollup": "^2.34.0"
|
||||
}
|
||||
},
|
||||
"snowpack-plugin-selective-import-to-require": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/snowpack-plugin-selective-import-to-require/-/snowpack-plugin-selective-import-to-require-0.1.1.tgz",
|
||||
"integrity": "sha512-E6HctZX9zAgM2Yjr5R4HKMoSDdxMpglRs1ubvFZKXc9EgnbiqcW7Rx11k6U5aG6V4NaQeiQ4E/2x4i+iGEYRSg=="
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.7.3",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
"wait-on": "^5.2.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"snowpack-plugin-selective-import-to-require": "^0.1.1",
|
||||
"svelte": "^3.32.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,9 @@ module.exports = {
|
|||
/* ... */
|
||||
'@snowpack/plugin-svelte',
|
||||
'@snowpack/plugin-typescript',
|
||||
['snowpack-plugin-selective-import-to-require', {
|
||||
"modules": builtinModules,
|
||||
}],
|
||||
],
|
||||
routes: [
|
||||
/* Enable an SPA Fallback in development: */
|
||||
|
@ -24,7 +27,6 @@ module.exports = {
|
|||
},
|
||||
packageOptions: {
|
||||
/* ... */
|
||||
external: [...builtinModules.filter((external) => external !== 'process'), 'electron'],
|
||||
},
|
||||
devOptions: {
|
||||
/* ... */
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
let { TransformOptions, Transform, Readable, Writable } = require('stream')
|
||||
//import { TransformOptions, Transform, Readable, Writable } from 'stream'
|
||||
import { TransformOptions, Transform, Readable, Writable } from 'stream'
|
||||
|
||||
class JSONReader extends Transform {
|
||||
constructor(options: typeof TransformOptions) {
|
||||
constructor(options: TransformOptions) {
|
||||
super(options)
|
||||
}
|
||||
_transform(data: string, encoding: string, cb: (chunk:any, err?:any) => void) {
|
||||
|
@ -16,15 +15,15 @@ class JSONReader extends Transform {
|
|||
|
||||
export class ServiceBroker {
|
||||
|
||||
protected jsonWriter: typeof Transform = new Transform({
|
||||
protected jsonWriter: Transform = new Transform({
|
||||
objectMode: true,
|
||||
})
|
||||
protected errorReader: typeof Transform = new Transform({ })
|
||||
protected errorReader: Transform = new Transform({ })
|
||||
protected jsonReader: JSONReader = new JSONReader({
|
||||
objectMode: true,
|
||||
})
|
||||
|
||||
constructor(input: typeof Readable, output: typeof Writable, error: typeof Readable) {
|
||||
constructor(input: Readable, output: Writable, error: Readable) {
|
||||
// Set up our reader callback.
|
||||
this.jsonReader.on("data", (json: any) => {
|
||||
// TODO: Something with our object
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
let { spawn } = require('child_process')
|
||||
let os = require('os')
|
||||
/*import { spawn } from 'child_process'
|
||||
import os from 'os'*/
|
||||
//import path from 'path'
|
||||
let path = require('path')
|
||||
import { spawn } from 'child_process'
|
||||
import os from 'os'
|
||||
import { ServiceBroker } from './ServiceBroker'
|
||||
|
||||
export async function createServiceBroker(exe = "service" + (os.platform()==='win32'?'.exe':'')): Promise<ServiceBroker> {
|
||||
|
|
Loading…
Reference in New Issue