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

Hook for Plugins to add commands to Amagaki #69

Open
Zoramite opened this issue Apr 26, 2021 · 1 comment
Open

Hook for Plugins to add commands to Amagaki #69

Zoramite opened this issue Apr 26, 2021 · 1 comment
Milestone

Comments

@Zoramite
Copy link
Member

Zoramite commented Apr 26, 2021

Would be handy to allow plugins to add custom commands for things that are 'outside' of the normal workflow.

For a translation plugin. You would not want a separate translation request every time a site is build, but being able to manually kick off a translation request would be helpful.

Something like amagaki translate request. Would allow a plugin to process any untranslated strings into a translation request file for the user, store the information in the amagaki cache, etc.

We can use a 'namespace' like amagaki plugin so that it does not restrict the future ability for amagaki to create built-in commands that may conflict with the amagki plugin ecosystem. But it a low probably to need to conflict with a plugin so it was decided to allow plugins use any unused built-in commands. In the future if amagaki wants to expand out commands the plugins will need to update their usage to let amagaki take over the command.

@jeremydw jeremydw added this to the 1.0.0 milestone Apr 30, 2021
@jeremydw
Copy link
Member

After some discovery, I think we should likely abandon this feature until we have a more concrete need. It's very easy to use gulp to accomplish a very similar feature – the ability for projects to add custom commands (e.g. to transform data, perform some sort of integration, or simply to use the Amagaki object model/API to work with the website data).

Here's an example:

// gulpfile.ts
import {KintaroPlugin} from '@amagaki/amagaki-plugin-kintaro';
import {Pod} from '@amagaki/amagaki';
import gulp from 'gulp';

const pod = new Pod('.');

gulp.task('kintaro', async cb => {
  // Do stuff with Kintaro plugin and `pod` object.
  cb();
});

gulp.task('kintaro', gulp.series('kintaro'));

Then:

npx gulp kintaro

runs the kintaro gulp task, that uses the Amagaki Kintaro plugin (and API).

Gulp tasks could be written to customize things like Sheets downloads, CMS downloads, etc. and can be integrated into projects with npm tasks (or incorporated via hooks to the build or dev server lifecycles as usual).

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

2 participants