Import framework #854

Closed
ErisDS opened this Issue Sep 21, 2013 · 7 comments

Comments

Projects
None yet
2 participants
@ErisDS
Member

ErisDS commented Sep 21, 2013

We need to come up with a framework for building apps which import data from other blogs.

The first one we should support is WordPress's WXR format, as other blogs such as tumblr already have a way to export to that format.

WXR is an XML format, so this definitely needs to be a plugin as parsing XML will add bloat to Ghost we really don't want.

@jamesbloomer

This comment has been minimized.

Show comment
Hide comment
@jamesbloomer

jamesbloomer Sep 28, 2013

Member

Is there already a WordPress importer at the moment? Thought I heard someone mention it?

Is the thinking that for a plugin like this the flow (server side) would be:

  • create the import module with the standard interface.
  • npm install to get all the dependencies.
  • package up (or not) the entire folder including node_modules.
  • copy to server in the correct place (maybe some more user friendly way of doing this).
  • server can require the module dynamically

?

Member

jamesbloomer commented Sep 28, 2013

Is there already a WordPress importer at the moment? Thought I heard someone mention it?

Is the thinking that for a plugin like this the flow (server side) would be:

  • create the import module with the standard interface.
  • npm install to get all the dependencies.
  • package up (or not) the entire folder including node_modules.
  • copy to server in the correct place (maybe some more user friendly way of doing this).
  • server can require the module dynamically

?

@ErisDS

This comment has been minimized.

Show comment
Hide comment
@ErisDS

ErisDS Sep 29, 2013

Member

There is a Ghost WordPress plugin: http://wordpress.org/plugins/ghost/, which exports WordPress data into the Ghost JSON format. Then we have the standard importer which lives at /ghost/debug/ which can import from that format.

I am a bit lost by the rest of your comment, sorry! What do you mean by 'server side flow' and 'create the import module with the standard interface'.

Some things which need considering:

  • what is the standard plugin template, should it be object style as in https://gist.github.com/jgable/6734267 or the simpler version the old fancyFirstChar plugin used to use: c7a91ff ?
  • how can plugins register their own npm dependencies?
  • how should plugins be allowed to hook into import? Does it require UI or should it just use the existing UI?

With regards to imports themselves, there is a lot of work that needs doing. @sebgie had a proposal for moving them onto the API which would be great, and I think it's also necessary to do a validation run, then spit out any problems / options to solve, and then do the final import.

Member

ErisDS commented Sep 29, 2013

There is a Ghost WordPress plugin: http://wordpress.org/plugins/ghost/, which exports WordPress data into the Ghost JSON format. Then we have the standard importer which lives at /ghost/debug/ which can import from that format.

I am a bit lost by the rest of your comment, sorry! What do you mean by 'server side flow' and 'create the import module with the standard interface'.

Some things which need considering:

  • what is the standard plugin template, should it be object style as in https://gist.github.com/jgable/6734267 or the simpler version the old fancyFirstChar plugin used to use: c7a91ff ?
  • how can plugins register their own npm dependencies?
  • how should plugins be allowed to hook into import? Does it require UI or should it just use the existing UI?

With regards to imports themselves, there is a lot of work that needs doing. @sebgie had a proposal for moving them onto the API which would be great, and I think it's also necessary to do a validation run, then spit out any problems / options to solve, and then do the final import.

ErisDS added a commit to ErisDS/Ghost that referenced this issue Sep 29, 2013

@ErisDS

This comment has been minimized.

Show comment
Hide comment
@ErisDS

ErisDS Sep 29, 2013

Member

I started having a bit of a play with this. It's not finished or quite working, but it kinda points in the right direction I think. Think I need to incorporate #931.. will play some more tomorrow.

Member

ErisDS commented Sep 29, 2013

I started having a bit of a play with this. It's not finished or quite working, but it kinda points in the right direction I think. Think I need to incorporate #931.. will play some more tomorrow.

@jamesbloomer

This comment has been minimized.

Show comment
Hide comment
@jamesbloomer

jamesbloomer Sep 30, 2013

Member

I was trying to figure out what the process would be for creating and using a plugin, I'll try and explain a bit more clearly :-)

With regard to module dependencies I was asking if you imagine a plugin being written independently, npm installed, and then the whole module's folder copied to the server (somehow). If a module has all of its dependencies in node_modules already then a require is enough to use it. The onus would be on the plugin (writer) to include/install the dependencies.

This is the same discussion as using plugins elsewhere really.

Member

jamesbloomer commented Sep 30, 2013

I was trying to figure out what the process would be for creating and using a plugin, I'll try and explain a bit more clearly :-)

With regard to module dependencies I was asking if you imagine a plugin being written independently, npm installed, and then the whole module's folder copied to the server (somehow). If a module has all of its dependencies in node_modules already then a require is enough to use it. The onus would be on the plugin (writer) to include/install the dependencies.

This is the same discussion as using plugins elsewhere really.

@ErisDS ErisDS referenced this issue Sep 30, 2013

Closed

Ghost Importer #950

@ErisDS

This comment has been minimized.

Show comment
Hide comment
@ErisDS

ErisDS Sep 30, 2013

Member

I imagined that after installing a plugin, npm install would be run for it.
For the time being this would be a pretty horrible manual process.

Long term, we will be able to improve this drastically. We want to have our own version of npm which would act as a marketplace for both themes and plugins (and potentially language packs as a 3rd type of thing). Say for example it was called 'gpm', then running 'gpm install import-plugin' from Ghost's root directory would do the necessary, and then we can build a UI which runs this command.

All of that is very, very long term though, and no where near possible until we're public, etc.

Member

ErisDS commented Sep 30, 2013

I imagined that after installing a plugin, npm install would be run for it.
For the time being this would be a pretty horrible manual process.

Long term, we will be able to improve this drastically. We want to have our own version of npm which would act as a marketplace for both themes and plugins (and potentially language packs as a 3rd type of thing). Say for example it was called 'gpm', then running 'gpm install import-plugin' from Ghost's root directory would do the necessary, and then we can build a UI which runs this command.

All of that is very, very long term though, and no where near possible until we're public, etc.

@jamesbloomer

This comment has been minimized.

Show comment
Hide comment
@jamesbloomer

jamesbloomer Oct 1, 2013

Member

Ok. There's always the option that the plugin would have to do the npm install first and you copy the installed dependencies with it. This has the advantage of freezing the versions without having to use something like shrinkwrap.

Member

jamesbloomer commented Oct 1, 2013

Ok. There's always the option that the plugin would have to do the npm install first and you copy the installed dependencies with it. This has the advantage of freezing the versions without having to use something like shrinkwrap.

@ErisDS

This comment has been minimized.

Show comment
Hide comment
@ErisDS

ErisDS Nov 13, 2013

Member

Closing this as it's not really relevant any more - this isn't gonna work how I thought :)

Member

ErisDS commented Nov 13, 2013

Closing this as it's not really relevant any more - this isn't gonna work how I thought :)

@ErisDS ErisDS closed this Nov 13, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment