Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Npm package #598

Merged
merged 27 commits into from
Nov 30, 2016
Merged

Npm package #598

merged 27 commits into from
Nov 30, 2016

Conversation

joshuafcole
Copy link
Contributor

@joshuafcole joshuafcole commented Nov 23, 2016

There's still work to be done here, but we should be at the point now where the missing features are features we haven't had yet. Namely, the editor can't really work in external projects just yet, and multiple workspaces aren't supported in the UI.

Outstanding issues:

Blocking

  • Need a permissions pass to serve files from global installation.
  • support editor on currently loaded external file
  • load workspace for external projects
  • don't crash on invalid doc urls
  • actually initialize in all the weird combinations of local/global/internal/external/url

Non-Blocking

Maintenance

@@ -0,0 +1,53 @@
#!/usr/bin/env node
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to go sideways on ubuntu because it's nodejs and not node

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this probably doesn't matter since everything else makes this assumption though



var browser = !argv["server"];
var port = process.env.PORT || argv["port"] || 8080;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argv should overide env


var browser = !argv["server"];
var port = process.env.PORT || argv["port"] || 8080;
var filepath = argv["_"][0]; // @FIXME: This should really be the first positional argument, not the first of any argument. (undefined if a user flags first).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't seem correct when using flags, need to guard against this

let base = dep.split("/").pop();
console.log("COPYING", dep);
console.log("NM", fs.readdirSync("node_modules"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oooooooooooooooooooo

@@ -272,10 +274,20 @@ export class EveClient {
browser.init(data.code);
}
if(this.showIDE) {
// Ensure the URL bar is in sync with the server.
// @FIXME: This back and forth of control over where we are
// is an Escherian nightmare.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth looking into this only being a client message so that the logic is localized and we don't have all the scary back and forth.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's turn this into issue to track

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// @FIXME: I think this is vestigial, but need to confirm this.
// if(documentId.indexOf("/examples/") === -1) {
// url = `${location.pathname}#/examples/${documentId}`;
// }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can go

let path = "/" + location.hash.split('?')[0].split("#/")[1];
console.log("PATH", path, location.hash);
if(path) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because of the "/" above, this will never be false

response.end(packaged);
});

app.get("/assets/*", handleStatic);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we check to make sure this works?

class SocketRuntimeClient extends RuntimeClient {
socket: WebSocket;

constructor(socket:WebSocket, withIDE = true) {
constructor(socket:WebSocket, inEditor:boolean) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since withIDE is used on the client, let's be consistent

@joshuafcole
Copy link
Contributor Author

@ibdknox please do a follow-up review when you have a second, but I believe this is ready to go.

let path = "/" + location.hash.split('?')[0].split("#/")[1];
if(path) {
let path = location.hash && location.hash.split('?')[0].split("#/")[1];
if(path && path.length > 2) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why > 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to be remotely valid it needs to contain at least a character and a slash. Honestly it should be 3, since all files must at least be /

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably worth putting a comment in or maybe a regex or something?

@ibdknox ibdknox merged commit 984db81 into app-loading Nov 30, 2016
@ibdknox ibdknox deleted the npm-package branch November 30, 2016 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants