Package as library using ocap discipline#10
Open
dckc wants to merge 36 commits into
Open
Conversation
mismatch with es6 specs discovered using flow
rather than ambient
Move them closer to other functions that need similar authority.
- import powerful objects only
if (require.main == module), i.e. only when this module
is invoked from the command line
- pass access to files, network, randomness explicitly
rather than using ambient authority
- to makeConfig(), sslOptions(), makeSturdy(), makeApp()
- .flowconfig, jshint declarations
- annotations for exports from caplib, saver
- name interface types in interfaces/types.js
- borrow es6 Proxy declaration from typescript
- adapt misc. node.js API types from typescript
- tweak commandArgs loop in argMap to not mutate
strings to numbers in-place
- tweak copyRecurse isDirectory test to avoid nulls
- tweak asId to make statically evident that
it can't return null
- use single assignment for newContext initialization
- explicitly check target[method] for null since flow
doesn't appreciate that it's surrounded by try/catch
While we're at it, get tool support for consistent style from eslint:
- indent 4 spaces. no tabs. no trailing space
- one true brace style with the single-line exception
- except for makeSaver, where emacs got confused
- double quotes for strings
- for unused args, use _x name style
- prune rawSend dead code
relax some of eslint's defaults:
- console logging is OK
- reduce filesystem access given to makeSaver
- ReadAccess, WriteAccess, SyncAccess give access to a specific path
- just one FileSystem type from node.js
- server.js: factor run() out of main()
- use ReadAccess for capper.config, ./ssl/*
- no need for readFileSync in sslOptions
- refactor reviverToMaker, reviverToUIPath as
as Reviver.toMaker and Reviver.sendUI
- sendUI takes an express Response, which carries authority
to open files by path name
- never mind note about express being nearly powerless
- log errors in showActor
use .done() to raise exceptions
not just the main page
- let ezSaver() convenience routine require anything
- use __dirname in makeReviver() to isolate from
caller's directory
- move io builders (fsReadAccess ,...) to saver.js
- pass saver to run() rather than dbfile
- pass crypto.randomBytes explicitly to makeUnique - use ezSaver convenience routine in tests
consolidate routes using /* and req.params[0]
in flow: Jul 18, 2016: 84a1a24@zacharygolba Add Proxy to core declarations somewhere before node 7.1, the --harmony-proxies option went away; https://github.com/tvcutsem/harmony-reflect says node groks as of 6.0.
goal is to log Error traces
- tighten up static types a bit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I restored the tests to working order. This is starting to feel pretty solid.
I re-organized my finquick application to depend on this package as suggested in #3 and it works well. Features to date:
I wish I could make screenshots or even a screen-cast, but I only have real (sensitive) data at this point. I'll have to do something about that...