@milaboratories/milaboratories.pool-explorer.model 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@milaboratories/milaboratories.pool-explorer.model",
3
+ "version": "1.0.25",
4
+ "description": "Block model",
5
+ "type": "module",
6
+ "main": "dist/index.cjs",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "dependencies": {
10
+ "@platforma-sdk/model": "1.28.4"
11
+ },
12
+ "devDependencies": {
13
+ "typescript": "~5.5.4",
14
+ "vite": "^5.4.11",
15
+ "tsup": "~8.3.5",
16
+ "@platforma-sdk/block-tools": "2.5.35"
17
+ },
18
+ "tsup": {
19
+ "entry": [
20
+ "src/index.ts"
21
+ ],
22
+ "splitting": false,
23
+ "treeshake": true,
24
+ "clean": true,
25
+ "format": [
26
+ "cjs",
27
+ "esm"
28
+ ],
29
+ "dts": true,
30
+ "minify": false,
31
+ "sourcemap": true
32
+ },
33
+ "scripts": {
34
+ "build": "tsup && vite build && block-tools build-model"
35
+ }
36
+ }
package/src/index.ts ADDED
@@ -0,0 +1,22 @@
1
+ import { BlockModel, InferHrefType, InferOutputsType } from '@platforma-sdk/model';
2
+
3
+ export type BlockArgs = {
4
+ titleArg: string;
5
+ };
6
+
7
+ export const platforma = BlockModel.create('Heavy')
8
+
9
+ .withArgs<BlockArgs>({ titleArg: 'The title' })
10
+
11
+ .output('allSpecs', (ctx) => ctx.resultPool.getSpecs())
12
+
13
+ .sections((ctx) => {
14
+ return [{ type: 'link', href: '/', label: 'Main' }];
15
+ })
16
+
17
+ .title((ctx) => 'Pool explorer')
18
+
19
+ .done();
20
+
21
+ export type BlockOutputs = InferOutputsType<typeof platforma>;
22
+ export type Href = InferHrefType<typeof platforma>;
package/tsconfig.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2022",
4
+ "module": "commonjs",
5
+ "moduleResolution": "node",
6
+ "esModuleInterop": true,
7
+ "strict": true,
8
+ "outDir": "./dist",
9
+ "rootDir": "./src",
10
+ "sourceMap": true,
11
+ "declaration": true,
12
+ "declarationMap": true
13
+ },
14
+ "types": [],
15
+ "include": ["src/**/*"],
16
+ "exclude": ["node_modules", "dist"]
17
+ }
@@ -0,0 +1,20 @@
1
+ import { defineConfig } from 'vite';
2
+
3
+ export default defineConfig({
4
+ build: {
5
+ emptyOutDir: false,
6
+ lib: {
7
+ entry: 'src/index.ts',
8
+ name: 'model',
9
+ fileName: (format) => `my-lib.${format}.js`
10
+ },
11
+ minify: false,
12
+ sourcemap: true,
13
+ rollupOptions: {
14
+ output: {
15
+ format: 'iife',
16
+ entryFileNames: 'bundle.js'
17
+ }
18
+ }
19
+ }
20
+ });