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 Task Running Bundler #470

Closed
FlorianRappl opened this issue Jan 21, 2022 · 1 comment
Closed

Add Task Running Bundler #470

FlorianRappl opened this issue Jan 21, 2022 · 1 comment
Assignees
Labels
cli Concerns the piral-cli application. enhancement New feature or request
Milestone

Comments

@FlorianRappl
Copy link
Contributor

New Feature Proposal

For more information, see the CONTRIBUTING guide.

Description

There are scenarios where using the piral-cli tools is unnecessary cumbersome. If a framework already comes with a pre-defined build process (and capabilities) then using Piral with it may be problematic. After all - you now have two conflicting tools. In many cases that conflict is resolved by a common bundler (mostly Webpack), but in some cases this is difficult (up to "impossible").

A suitable solution would be to have a "task runner" as bundler, which would just call a task from the package.json:

{
  //...
  "scripts": {
    "start": "pilet start",
    "build": "pilet build",
    "int:debug": "my-custom-tool debug src",
    "int:build": "my-custom-tool build src"
  },
  "pilet:debug": {
    "command": "npm run int:debug",
    "url": "http://localhost:6242"
  },
  "pilet:build": {
    "command": "npm run int:build",
    "outputDir": "lib",
    "mainFile": "index.js"
  }
}

Right now the exact options for the pilet:debug and pilet:build sections are unclear. Maybe they are the same after all - such that debug does not need to create another dev server. Instead, in debug a file system watcher is monitoring the same output.

Nevertheless, this command wrapper would expect some kind of file(s) there - which would then be converted / called to have the right format (in case of a pilet).

Background

Users of Angular could then just stay on the Angular CLI and use that. For instance, a pilet would just be an Angular library, which could be built and watched with Angular. The piral-cli would then do the rest. The same applies to other frameworks (most notably things like Ember or Blazor) where the tooling is quite opaque and not easy to integrate.

Discussion

Is this a useful one? What options would need to be respected for this to be good? Where does this "bundler" end and where does the custom tooling start? My personal feeling is that the task running bundler ends at setting some ENV variables (e.g., shared deps) which may then be used by the custom tooling. The bundler then would only apply certain things such as the right pilet envelope / wrapper.

@FlorianRappl FlorianRappl added enhancement New feature or request cli Concerns the piral-cli application. in-review The item is currently being reviewed. labels Jan 21, 2022
@FlorianRappl FlorianRappl added this to the 0.15.0 milestone Jan 21, 2022
@FlorianRappl FlorianRappl added in-implementation The item is currently being implemented. and removed in-review The item is currently being reviewed. labels Jan 25, 2022
@FlorianRappl FlorianRappl modified the milestones: 0.15.0, 0.14.17 Mar 11, 2022
@FlorianRappl FlorianRappl self-assigned this Mar 11, 2022
@FlorianRappl
Copy link
Contributor Author

This will be finished / tracked further in the dedicated repository:
https://github.com/smapiot/piral-cli-xbuild

@FlorianRappl FlorianRappl removed the in-implementation The item is currently being implemented. label May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Concerns the piral-cli application. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant