Skip to content

Commit 7286d8e

Browse files
committed
fix: Removed JS stub discover in favour of real manifest read
1 parent f4130dd commit 7286d8e

1 file changed

Lines changed: 3 additions & 46 deletions

File tree

src/stdio/discover.ts

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Manifest } from '../base/Executor'
2-
import { Transport } from '../base/Transports'
32
import * as path from 'path'
43
import * as os from 'os'
54
import * as fs from 'fs'
@@ -13,11 +12,6 @@ const log = getLogger('executa:serve')
1312
const EXECUTORS_DIR_NAME = 'executors'
1413

1514
export default async function discover(): Promise<Manifest[]> {
16-
// TODO: implement discovery of manifest files from ~/.stencila/executors/ (or similar)
17-
// Should be able to mostly copy and paste from
18-
// https://github.com/stencila/node/blob/24c30d1c89b5f6b6719a0beeda7a55d19401c294/lib/host/Host.js#L654-L666
19-
// See https://github.com/stencila/executa/issues/2
20-
2115
let stencilaHome: string
2216

2317
switch (os.platform()) {
@@ -69,52 +63,15 @@ export default async function discover(): Promise<Manifest[]> {
6963
}
7064

7165
try {
72-
manifests.push(JSON.parse(json) as Manifest)
66+
const manifest = JSON.parse(json) as Manifest
67+
log.info(`Added manifest at ${file}`)
68+
manifests.push(manifest)
7369
} catch (error) {
7470
log.warn(`Warning: error parsing file "${file}": ${error.message}`)
7571
}
7672
}
7773
}
7874

7975
await discoverDir(executorsDir)
80-
81-
manifests.push(js)
8276
return manifests
8377
}
84-
85-
// These are just stubs to be replaced by JSON read in from manifest.json files...
86-
87-
const js: Manifest = {
88-
capabilities: {
89-
execute: {
90-
type: 'object',
91-
required: ['node'],
92-
properties: {
93-
node: {
94-
type: 'object',
95-
required: ['type', 'programmingLanguage'],
96-
properties: {
97-
type: {
98-
enum: ['CodeChunk', 'CodeExpression']
99-
},
100-
programmingLanguage: {
101-
enum: ['javascript']
102-
}
103-
}
104-
}
105-
}
106-
}
107-
},
108-
addresses: {
109-
stdio: {
110-
type: Transport.stdio,
111-
command: 'npx',
112-
args: [
113-
'ts-node',
114-
'/Users/ben/Documents/stencila/schema/ts/interpreter',
115-
'listen'
116-
],
117-
cwd: '/Users/ben/Documents/stencila/schema'
118-
}
119-
}
120-
}

0 commit comments

Comments
 (0)