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

Add new npm / glup tasks: clone:default_plugins, build:dev_plugins, watch:plugins #309

Merged
merged 18 commits into from
Mar 7, 2023

Conversation

Raruto
Copy link
Collaborator

@Raruto Raruto commented Jan 18, 2023

Supersedes: #301 and #262


What's changes:

  1. Add new task gulp clone:default_plugins,

    in order to make sure that core client plugins are there before starting develop:

  2. Add new task gulp build:dev_plugins,

    in order to maker sure that core and custom client bundles are up-to-date before starting the npm run dev server
    (NB: for performance reasons this script just build all plugins once, for watching them all see next point)

  3. Add new script npm run watch:plugins,

    in order to avoid performing the gulp watch task on each plugin located in the local src/plugins/* directory

  4. Update README.md plugin development instructions

    How to develop

    You can start the built-in development servers by using the following:

    npm run docker:up      # backend server (g3w-admin)
    npm run dev            # frontend server (g3w-client)
    + npm run watch:plugins  # watch built-in plugins + any custom plugin (eg. base, eleprofile, sidebar)
  5. Remove useful gulp tasks

    definitely deprecated (and undocumented), the following tasks crash if run manually because their dependent tasks were never implemented:

    • gulp.task('g3w-admin-client:static', ['build:static']);
    • gulp.task('g3w-admin-client:template', ['build:templates']);
    • gulp.task('g3w-admin:static', ['build:static']);
    • gulp.task('g3w-admin:templates', ['build:templates']);

Advantages of this type of solution

  1. no headaches with git submodules yet which would require additional documentation on how to clone and update submodules (ref: Include default client plugins (editing, qplotly, qtimeseries) as git submodules #301)
  2. starts sort of automating the import of core plugins in anticipation of converting them to npm modules (ref: Replace assets vendors folder with npm packages #290)

Drawbacks

  1. The following files are not yet generated automatically (to do this you still need to manually run the build:plugins task):

     src/plugins/editing/plugin.js
     src/plugins/qplotly/plugin.js
     src/plugins/qtimeseries/plugin.js
    
  2. The version of the cloned repositories is not fixed to a specific release (ie. to a specific branch or commit), so an unsuspecting user could clone a version of the client plugins not immediately compatible with the current version of g3w-client

  3. each developer has to worry about keeping various plugin repositories up-to-date locally

Add the aforementioned task in order to make sure that core client plugins are there before starting develop:

- [submodule "src/plugins/qplotly"]     <-- https://github.com/g3w-suite/g3w-client-plugin-qplotly.git
- [submodule "src/plugins/qtimeseries"] <-- https://github.com/g3w-suite/g3w-client-plugin-qtimeseries.git
- [submodule "src/plugins/editing"]     <-- https://github.com/g3w-suite/g3w-client-plugin-editing.git
@Raruto Raruto added the config Anything related to configuration files label Jan 18, 2023
@Raruto Raruto added this to the v3.8 milestone Jan 18, 2023
gulpfile.js Outdated Show resolved Hide resolved
gulpfile.js Outdated Show resolved Hide resolved
@volterra79
Copy link
Member

@Raruto it could be useful add a way here:

'clone:default_plugins',

to add a task to use plugin in development too

@Raruto Raruto added the docs Improvements or additions to documentation label Jan 31, 2023
@Raruto Raruto changed the title Add new gulp task clone:default_plugins Add new npm / glup tasks: gulp clone:default_plugins, gulp build:dev_plugins, npm run watch:plugins Jan 31, 2023
@Raruto Raruto changed the title Add new npm / glup tasks: gulp clone:default_plugins, gulp build:dev_plugins, npm run watch:plugins Add new npm / glup tasks: gulp clone:default_plugins, gulp build:dev_plugins, npm run watch:plugins Jan 31, 2023
@Raruto Raruto changed the title Add new npm / glup tasks: gulp clone:default_plugins, gulp build:dev_plugins, npm run watch:plugins Add new npm / glup tasks: clone:default_plugins, build:dev_plugins, watch:plugins Jan 31, 2023
@Raruto Raruto marked this pull request as ready for review January 31, 2023 09:55
gulpfile.js Outdated Show resolved Hide resolved
@Raruto
Copy link
Collaborator Author

Raruto commented Mar 7, 2023

@volterra79 are we ready to merge this?, otherwise we will never test it enough before the next release..

Copy link
Member

@volterra79 volterra79 left a comment

Choose a reason for hiding this comment

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

@Raruto let's do it

@volterra79 volterra79 merged commit 8b41041 into dev Mar 7, 2023
@volterra79 volterra79 deleted the clone-default-plugins branch March 7, 2023 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Anything related to configuration files docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants