aurelia-contrib / aurelia-getting-started

Basically a queue of topics and examples to cover
MIT License
20 stars 5 forks source link

Aurelia CLI plugin skeleton + Typescrip 3+ #32

Closed HamedFathi closed 5 years ago

HamedFathi commented 5 years ago

@huochunpeng

May I ask you to share a repository based on your how-to-use-cli-to-develop-plugin with Aurelia CLI 1.0 + Typescript 3+?

You have a repository sample for Javascript but not for Typescript. I tried but many problems occurred.

3cp commented 5 years ago

Sure. Will do.

What are your problems?

3cp commented 5 years ago

https://github.com/huochunpeng/demo-plugin-cli-ts

HamedFathi commented 5 years ago

Thank you so much, my friend, it is so helpful and amazing.

HamedFathi commented 5 years ago

@huochunpeng

I transfer your plugin files to a new project that is made with Aurelia CLI + webpack + ts but I have a problem

This is the repository. AuPluginTest I want to have nested folder for each plugin but I got an error.

image

image

Do you know what is wong?

3cp commented 5 years ago

config.globalResources([PLATFORM.moduleName('./demo/index')]) would not work.

./demo/index is an entry, not an Aurelia resource (element/value-converter/...).

Try

import {FrameworkConfiguration} from 'aurelia-framework';
import {PLATFORM} from 'aurelia-pal';
import demo from './demo/index';

export function configure(config: FrameworkConfiguration) {
  demo.configure(config);
}

I think you did something like this for aurelia-toolbelt.

HamedFathi commented 5 years ago

@huochunpeng

I think you did something like this for aurelia-toolbelt.

Yes, Now your structure is different.

Unfortunately, I tried but the problem exists, so sorry, May I ask you to make PR to the AuPluginTest?

Aurelia-Toolbelt works with Fusebox but I need to use Webpack for their Webpack Bundle Analyzer

Your structure helps me to achieve this.

3cp commented 5 years ago

Ok, I will have a look.

HamedFathi commented 5 years ago

@huochunpeng

Thank you so much for your guide. It works perfectly.

We want to move Aurelia-Toolbelt to this plugin system so do you know can we keep this structure valid for Aurelia vNext or not?

3cp commented 5 years ago

You probably need a fork of the project anyway to support vnext.

The idea should still work, just use gulp-typescript to transpile a folder to dist.

We have not done anything in cli to support vnext yet. It wouldn’t be much change in cli. Vnext is easier for any bundler.

HamedFathi commented 5 years ago

Thanks for your help

I updated the skeleton here

  1. Support SCSS for plugins
  2. Support other build types (System, ES2015, AMD)