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

Tools for project related task #36

Closed
9 tasks
Reinmar opened this issue Oct 21, 2015 · 12 comments
Closed
9 tasks

Tools for project related task #36

Reinmar opened this issue Oct 21, 2015 · 12 comments
Assignees
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Oct 21, 2015

  • Creating a new plugin (I've just spent 20 minutes creating a new plugin because it requires so many operations).
    • This should have an option to install it in the ckeditor5 repo.
    • Don't forget about running npm link and installing githooks.
  • Updating all repositories.
  • Doing operations like git st or printing informations which the git prompt provides for all repositories. The latter should be well formatted (in a table/list probably, with colours preferably).
  • Installing a new plugin (clone, npm link globally, and npm link to install in CKE5, add to package.json).
  • Quick jump to a ckeditor5, core, or a specific plugin directory. We can either use pushd or keep this task in every ckeditor5 related repo, so in every single one you'd be able to do grunt cd core, grunt cd plugin-foo.
  • Fetching changes from the boilerplate in all repositories at once (I spent on this a lot of time too).
  • npm update which does not break npm links.
  • Checking out the whole projects to some other configuration. If it's possible to specify branch names in package.json's dependencies, then we're home – in ckeditor5 one will create a branch for her/his configuration (kept in package.json and our tool will check out all the stuff to the correct branches and update them).
  • Updating copy right notes in every file in every repo and committing this.

I'm now working on 4 repositories and I honestly spent so much time on trying to figure out the state of each of it that it started to be irritating and blocking. I wasted 4 hours today doing the maintenance ;/

@pjasiun
Copy link

pjasiun commented Oct 22, 2015

Quick jump to a ckeditor5, core, or a specific plugin directory. We can either use pushd or keep this task in every ckeditor5 related repo, so in every single one you'd be able to do grunt cd core, grunt cd plugin-foo.

I'm not sure it is doable. Both bash and fish do not let you change your context in the script, because they run scripts in separate context. I was trying to do it and I was not able to find a solution. But I found CDPATH very useful. It works very well in both bash and fish.

@Reinmar
Copy link
Member Author

Reinmar commented Oct 22, 2015

I'm not sure it is doable.

I'm not sure why it wouldn't be doable. If this command is just about quickly changing the directory, then it's just a pushd call. But I'm not sure that such task would be of any help as the only thing it would do would be to change this:

> pushd ../ckeditor5-plugin-creator-classic

to:

> grunt cd creator-classic

or (when going to the ckeditor5-core/ckeditor5):

> grunt cd root

plus you lose autocompletion... So it's an idea I had, but I'm not sure that it will be of any value. I just know that I've been tired of jumping between these directories all the time, but when we'll have the other problems resolved, perhaps I won't need to do that any more.

@szymonkups
Copy link
Contributor

I've pushed branch with prototype of grunt task that creates and initializes new CKEditor5 plugin: t/36.
Task can be run by typing grunt plugin:create. It will:

  1. Ask for plugin name.
  2. Ask for repository location on disk (defaults to one directory above current working directory).
  3. Ask for GitHub URL of the plugin (defaults to ckeditor/<plugin name>).
  4. Initialize new git repository in provided location.
  5. Fetch ckeditor-boilerplate and merge ckeditor5 branch into plugin's master.
  6. Update plugin's package.json - add name and version.
  7. Updates CKEditor5 package.json - add plugin's GitHub URL in dependencies.
  8. Link plugin into CKeditor5 using npm link - this require privileged call with sudo.

Can you think of any other tasks required when creating new plugin?

@szymonkups szymonkups self-assigned this Oct 27, 2015
@szymonkups
Copy link
Contributor

Added new grunt task grunt plugin:install, and pushed changes to t/36. Task's steps:

  1. Ask for plugin name.
  2. Ask for repository location on disk (defaults to one directory above current working directory).
  3. Ask for GitHub URL of the plugin (defaults to ckeditor/<plugin name>).
  4. Clones plugin repository to provided location.
  5. Link plugin into CKeditor5 using npm link - this require privileged call with sudo.
  6. Updates CKEditor5 package.json - add plugin's GitHub URL in dependencies.

@szymonkups
Copy link
Contributor

Created pull request #37 that adds grunt dev:init task. It tries to partially resolve this issue:

Checking out the whole projects to some other configuration. If it's possible to specify branch names in package.json's dependencies, then we're home – in ckeditor5 one will create a branch for her/his configuration (kept in package.json and our tool will check out all the stuff to the correct branches and update them).

For now it creates innitial configuration from package.json file - checks out repositories provided in dependencies object. Easy switching between configurations is not implemented yet.

@szymonkups
Copy link
Contributor

I've added new commit to pull request #37. It adds grunt option, called workspaceRoot - a relative path to the location where all development repositories will be stored. Defaults to one level above CKEditor5 repository location. Also added grunt dev:status task, that will print Git status for all development repositories. For now it uses git status --porcelain -sb. Later on we can use same output as nodeprompt, but it requires some modifications in order to incorporate it with grunt tasks.

@szymonkups
Copy link
Contributor

Created new pull request #40.

@luzfcb
Copy link

luzfcb commented Nov 22, 2015

ckeditor has or will have a recommended project template to construct a new plugin?
I would be very happy if ckeditor provide me the "correct" way to start a new plugin project.

Having said that, I liked the project templates built with cookiecutter.

cookiecutter the operation is pretty simple.

to create a project template, simply define your template variables in a cookiecutter.json file and put this file in a root folder of the repository of the project. this cookiecutter.json is a real use example used in cookiecutter-django

This is a javascript es6 project template created with cookiecutter:

https://github.com/agconti/cookiecutter-es6-boilerplate

to test, install cookiecutter.

and run

cookiecutter https://github.com/agconti/cookiecutter-es6-boilerplate

@Reinmar
Copy link
Member Author

Reinmar commented Nov 23, 2015

ckeditor has or will have a recommended project template to construct a new plugin?

Yes. We're creating a scaffolder, so you'll just have to clone this repository (i.e. ckeditor5) and run a task which will scaffold your new plugin. Does it sound good?

git clone https://github.com/ckeditor/ckeditor5.git
cd ckeditor5
npm install
grunt dev-plugin-init

< the task will ask you a couple of questions and done... >

@luzfcb
Copy link

luzfcb commented Nov 23, 2015

@Reinmar yes, it sound good.

let me know when this scaffolder are ready to test, I would try to create a version of it, but using cookiecutter. ( point me the repository, if it already exists )

another question: I am totally new to the node.js ecosystem. Is normal npm take 20 minutes to download dependencies in clean machine?

@Reinmar
Copy link
Member Author

Reinmar commented Nov 24, 2015

let me know when this scaffolder are ready to test, I would try to create a version of it, but using cookiecutter. ( point me the repository, if it already exists )

I'm not sure it makes sense to use cookiecutter for it, because there are many other tasks related to scaffolding, such as linking the repositories, installing git hooks, etc. Plus, Python would become another dependency.

another question: I am totally new to the node.js ecosystem. Is normal npm take 20 minutes to download dependencies in clean machine?

Depends on how many dependencies you are installing, your internet connection speed and your machine. However, I've never seen it taking 20 minutes. 2-5 minutes tops. However, I've heard something that the new version of npm (Node package manager) has some performance issues – e.g. npm/npm#10380

@Reinmar
Copy link
Member Author

Reinmar commented Nov 30, 2015

Closed by #40.

Followups: #41, #42, #43, #44.

@Reinmar Reinmar closed this as completed Nov 30, 2015
@Reinmar Reinmar modified the milestone: 0.1.0 Mar 4, 2016
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

No branches or pull requests

4 participants