Skip to content

Commit

Permalink
Added initial pilets
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianRappl committed Jul 3, 2024
1 parent aaccfb6 commit 116c8bf
Show file tree
Hide file tree
Showing 24 changed files with 24,031 additions and 0 deletions.
7,877 changes: 7,877 additions & 0 deletions mfs/ng1-v16/package-lock.json

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions mfs/ng1-v16/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "ng1-v16",
"version": "0.1.0",
"description": "First Angular pilet - for Angular 16",
"keywords": [
"pilet"
],
"importmap": {
"imports": {
"@angular/core": "@angular/core",
"@angular/common": "@angular/common",
"@angular/compiler": "@angular/compiler",
"@angular/platform-browser": "@angular/platform-browser",
"@angular/platform-browser-dynamic": "@angular/platform-browser-dynamic",
"@angular/router": "@angular/router",
"piral-ng-common": "piral-ng-common"
},
"inherit": [
"spa-app"
]
},
"dependencies": {
"@angular/common": "^16",
"@angular/compiler": "^16",
"@angular/core": "^16",
"@angular/router": "^16",
"@angular/platform-browser": "^16",
"@angular/platform-browser-dynamic": "^16",
"piral-ng": "1.5.6",
"piral-ng-common": "^16"
},
"devDependencies": {
"@angular/compiler-cli": "^16",
"@ngtools/webpack": "^16",
"copy-webpack-plugin": "^10",
"html-loader": "^3",
"to-string-loader": "^1",
"piral-cli": "1.5.6",
"piral-cli-webpack5": "1.5.6"
},
"scripts": {
"start": "pilet debug",
"build": "pilet build",
"deploy": "pilet publish --fresh --url https://feed.piral.cloud/api/v1/pilet/dwx24-demo --interactive"
},
"main": "dist/index.js",
"files": [
"dist"
]
}
10 changes: 10 additions & 0 deletions mfs/ng1-v16/pilet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"schemaVersion": "v2",
"$schema": "https://docs.piral.io/schemas/pilet-v0.json",
"piralInstances": {
"spa-app": {
"selected": true,
"url": "https://dwx24.samples.piral.cloud/emulator/emulator.json"
}
}
}
32 changes: 32 additions & 0 deletions mfs/ng1-v16/src/Tile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Component, Inject, VERSION } from "@angular/core";

@Component({
template: `
<div class="teaser">
<h3>v16 (1): {{ counter }}</h3>
<p>
<button (click)="increment()">Increment</button>&nbsp;
<button (click)="decrement()">Decrement</button>
</p>
<p>
<small>{{version}}</small>
</p>
</div>
`,
})
export class Tile {
public counter = 0;
public version = VERSION.full;

constructor(@Inject('piral') piral: any) {
console.log('Tile rendered', piral.meta);
}

increment() {
this.counter += 1;
}

decrement() {
this.counter -= 1;
}
}
Empty file added mfs/ng1-v16/src/assets/.gitkeep
Empty file.
10 changes: 10 additions & 0 deletions mfs/ng1-v16/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { PiletApi } from "spa-app";
import { fromNg } from "piral-ng/convert";
import { Tile } from "./Tile";

export function setup(app: PiletApi) {
app.registerTile(fromNg(Tile), {
initialColumns: 4,
initialRows: 2,
});
}
25 changes: 25 additions & 0 deletions mfs/ng1-v16/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"declaration": true,
"noImplicitAny": false,
"removeComments": false,
"noLib": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"sourceMap": true,
"outDir": "./dist",
"skipLibCheck": true,
"lib": ["dom", "es2018"],
"moduleResolution": "node",
"module": "esnext",
"jsx": "react",
"importHelpers": true
},
"include": [
"./src"
],
"exclude": [
"node_modules"
]
}
9 changes: 9 additions & 0 deletions mfs/ng1-v16/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const extendWebpack = require('piral-ng/extend-webpack');

module.exports = (config) => {
return extendWebpack({
ngOptions: {
jitMode: true,
},
})(config);
};
Loading

0 comments on commit 116c8bf

Please sign in to comment.