class Post extends Model {
static attributes (attr) {
attr('title', 'string')
attr('description', 'string')
}
function sum(a, b) { | |
return a + b; | |
} | |
test('adds 1 + 2 to equal 3', () => { | |
expect(sum(1, 2)).toBe(3); | |
}); | |
it('should add 1 + 2 and return 3', () => { | |
expect(sum(1, 2)).toBe(3); |
'use strict'; | |
class AppScaffold { | |
/* | |
Method used to register a plugin function that will be run in the constructor | |
Plugins can be used to | |
* register middleware | |
* add functions to the startup queue | |
* add functions to the shutdown queue | |
* register metrics streams to be consumed |
The following lays out roughly, a proposed way to sharing dependencies across podlets.
The idea is that, through a cli tool, it will be possible to manage which libraries are available across the organisation. Here we are using react (and react-dom) as a global cross podlet dependency to illustrate the proposed workflow.
First, we publish a global version of react at a specific version. The cli tool, downloads react, converts it to esm and uploads it to the CDN at a convention based URL.
asset-pipe global publish --org finn react@16.8.6
All commands rely on the existance of an .assets.json
file which will can be
in the users home directory and/or the root of the project directory with a file
in the project directory taking precedence over a file in the home directory.
The .assets.json
file must define as a minimum the following fields when performing global publish
, alias
amd import-map
commands:
{
- eik package
- calculates hashes of a local build and compares with what is available on the server
- if hashes are the same, abort
- calculates the next version number to publish
- for a patch 1.0.1 goes to 1.0.2
- calculates hashes of a local build and compares with what is available on the server
- for a minor 1.0.1 goes to 1.1.0
I’ve done a little digging. I think we have some challenges to solve regarding supporting both Eik and Asset pipe in the manifest file.
- in the manifest file must have the legacy field populated with asset pipe hash and the new js and css arrays must be populated with Eik absolute URLs
- the first time
podlet.js
orpodlet.css
is called, the legacy field is populated, subsequent calls do not reset the legacy field so it is important that the asset pipe stuff is done before the Eik stuff - Even when
podlet.js
andpodlet.css
are called in the correct order, the legacy field is added to the array of modern fields
The issue
-
Typescript converts to a js version with jsx files This is just Lars' build step that outputs to a /lib folder
-
I add a rollup build to convert out the jsx so its pure js with esm
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';