Is anyone useing aurelia-form,aurelia-api,aurelia-orm from spoonx?

Okay, it basically working. I have found a nice plugin skeleton here, GitHub - Vheissu/aurelia2-plugin-starter: A starting base for an Aurelia 2 plugin written in TypeScript, built using Rollup..

1 Like

So here it is : GitHub - jvkassi/aurelia-api: A simple convenience wrapper around aurelia-fetch-client

1 Like

@bigopon if you have time, please if my plugin is clean. I want to be sure to get it right

1 Like

Ive just noticed that you havent modified package.json with your info.

Additionally you might want Config to implement IConfig and not having the Interface extend a class aurelia-api/config.ts at master · jvkassi/aurelia-api · GitHub

You might also want to allow passing in a HttpClient as param instead of creating always a new instance. aurelia-api/config.ts at master · jvkassi/aurelia-api · GitHub
The reason could be that there are already existing instances the User might want to reuse. Or to simplify unit testing by allowing to pass in mocked clients

2 Likes

Hello,

Thanks guy ! You guys are my heroes :smiley:
Okay i have fixed implement and updated package.json

I am not sure how to pass httpclient as a param.
Endpoint are registered at startup

  .register(
    AureliaAPIConfiguration.customize((config) => {
      // config.
      config.defaultBaseUrl = '/api';
      config.registerEndpoint('api', '/mypath');

      return config;
    })
  )
1 Like

Next on my list is GitHub - jvkassi/aurelia-view-manager: A view manager for aurelia plugins. Add support for overriding views, and multiple frameworks.
How do port this class
aurelia-view-manager/resolved-view-strategy.js at master · jvkassi/aurelia-view-manager · GitHub
I couldn’t find the v2 version of this “viewStrategy”

1 Like

Perhaps this helps vNext - The Aurelia Discourse

1 Like

yeah, i’m digging.
I didn’t find anything yet that talk about this viewStrategy in v2.
This is seems to be very specific. Maybe this way of doing things is obselete in v2

1 Like

@mib4fun when I add your aurelia-api module via npm add -S "aurelia-api@github:jvkassi/aurelia-api" I am getting a message that there are no type definitions.

I’m trying to replace this:

import {Endpoint, Rest} from 'aurelia-api';
import {AuthService} from 'aurelia-authentication';
import {inject} from 'aurelia-framework';

@inject(Endpoint.of('auth'), Endpoint.of('api'), AuthService)
export class AppState {
  authService?: AuthService;

  constructor(_authHttp: Rest, _apiHttp: Rest, authService: AuthService) {
    this.authService = authService;
  }
}

Hello,

wow someone using my package :sweat_smile:
I converted this package from plain JS to typescript.
I still have to add types definitions.

If you can make a pull request that would be fantastic !