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