typescript model

This commit is contained in:
2025-10-16 20:39:26 +02:00
parent cdba66dae0
commit 3783540e12
10 changed files with 121 additions and 8 deletions

15
.gitignore vendored
View File

@@ -1,7 +1,8 @@
/plantuml/
/sql/
/src/
/pom_jpa.xml
/TelosysTools/downloads
/TelosysTools/templates
!/TelosysTools/templates/infinimotion
./plantuml
./sql
./src
./angular
./pom_jpa.xml
./TelosysTools/downloads
./TelosysTools/templates
!./TelosysTools/templates/infinimotion

6
.idea/jsLibraryMappings.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="file://$PROJECT_DIR$" libraries="{Node.js Core}" />
</component>
</project>

1
.idea/model.iml generated
View File

@@ -16,6 +16,7 @@
<excludeFolder url="file://$MODULE_DIR$/plantuml" />
<excludeFolder url="file://$MODULE_DIR$/sql" />
<excludeFolder url="file://$MODULE_DIR$/src" />
<excludeFolder url="file://$MODULE_DIR$/TelosysTools/templates/infinimotion/angular" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />

View File

@@ -0,0 +1 @@
@InfiniMotion:registry=https://npm.pkg.github.com

View File

@@ -0,0 +1,6 @@
#set( $env.language = 'TypeScript' )
export default interface $entity.name {
#foreach( $attribute in $entity.attributes )
${attribute.name}: ${attribute.type};
#end
}

View File

@@ -0,0 +1,9 @@
#foreach( $entity in $model.allEntities )
import $entity.name from "./${entity.name}";
#end
export type {
#foreach( $entity in $model.allEntities )
$entity.name,
#end
}

View File

@@ -0,0 +1,27 @@
{
"name": "@InfiniMotion/model-frontend",
"version": "0.0.0",
"description": "InfiniMotion Model for Frontend",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsup",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Lennart Heinrich",
"license": "ISC",
"devDependencies": {
"@types/node": "^24.8.0",
"ts-node": "^10.9.2",
"tsup": "^8.5.0",
"typescript": "^5.9.3"
},
"repository": "https://github.com/InfiniMotion/model.git",
"publishConfig": {
"registry": "https://npm.pkg.github.com"
}
}

View File

@@ -0,0 +1,44 @@
{
// Visit https://aka.ms/tsconfig to read more about this file
"compilerOptions": {
// File Layout
// "rootDir": "./src",
"outDir": "./dist",
// Environment Settings
// See also https://aka.ms/tsconfig/module
"module": "nodenext",
"target": "esnext",
"types": ["node"],
// For nodejs:
// "lib": ["esnext"],
// "types": ["node"],
// and npm install -D @types/node
// Other Outputs
"sourceMap": true,
"declaration": true,
"declarationMap": true,
// Stricter Typechecking Options
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
// Style Options
// "noImplicitReturns": true,
// "noImplicitOverride": true,
// "noUnusedLocals": true,
// "noUnusedParameters": true,
// "noFallthroughCasesInSwitch": true,
// "noPropertyAccessFromIndexSignature": true,
// Recommended Options
"strict": true,
"jsx": "react-jsx",
"verbatimModuleSyntax": false,
"isolatedModules": true,
"noUncheckedSideEffectImports": true,
"moduleDetection": "force",
"skipLibCheck": true,
}
}

View File

@@ -0,0 +1,10 @@
import { defineConfig } from "tsup";
export default defineConfig({
entry: ["index.ts"],
format: ["cjs", "esm"], // Build for commonJS and ESmodules
dts: true, // Generate declaration file (.d.ts)
splitting: false,
sourcemap: true,
clean: true,
});

View File

@@ -32,3 +32,11 @@ Tests : database init ; DatabaseInit.java ; ${TEST_SRC}/${ROOT_PKG}/enti
Tests : entity tests ; ${BEANNAME}JpaTest.java ; ${TEST_SRC}/${ROOT_PKG}/entities ; test-java/XxxJpaTest_java.vm ; *
#--- src/test/resources
Tests : persistence.xml ; persistence.xml ; ${TEST_RES}/META-INF ; test-resources/persistence_xml.vm ; 1
# Angular
.npmrc ; .npmrc ; angular ; angular/.npmrc.vm ; 1
package.json ; package.json ; angular ; angular/package_json.vm ; 1
tsconfig.json ; tsconfig.json ; angular ; angular/tsconfig_json.vm ; 1
tsup.config.ts ; tsup.config.ts ; angular ; angular/tsup.config_ts.vm ; 1
index.ts ; index.ts ; angular ; angular/index_ts.vm ; 1
TypeScript Models ; ${BEANNAME}.ts ; angular ; angular/Xmodel_ts.vm