lincd-cli 0.1.13 → 0.1.14
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/defaults/app/src/App.scss +3 -0
- package/defaults/app/src/App.tsx +5 -0
- package/defaults/app/src/index.tsx +10 -0
- package/defaults/app/tsconfig.json +18 -0
- package/defaults/app2/backend/src/server.js +152 -0
- package/defaults/app2/backend/src/server.js.map +1 -0
- package/defaults/app2/backend/src/server.tsx +137 -0
- package/defaults/app2/frontend/src/App.js +52 -0
- package/defaults/app2/frontend/src/App.js.map +1 -0
- package/defaults/app2/frontend/src/App.tsx +35 -0
- package/defaults/app2/frontend/src/Html.js +12 -0
- package/defaults/app2/frontend/src/Html.js.map +0 -0
- package/defaults/app2/frontend/src/Html.tsx +29 -0
- package/defaults/app2/frontend/src/Layout.js +153 -0
- package/defaults/app2/frontend/src/Layout.js.map +1 -0
- package/defaults/app2/frontend/src/Layout.tsx +5 -0
- package/defaults/app2/frontend/src/Spinner.js +9 -0
- package/defaults/app2/frontend/src/Spinner.js.map +0 -0
- package/defaults/app2/frontend/src/Spinner.scss +17 -0
- package/defaults/app2/frontend/src/Spinner.tsx +10 -0
- package/defaults/app2/frontend/src/index.js +14 -0
- package/defaults/app2/frontend/src/index.js.map +0 -0
- package/defaults/app2/frontend/src/index.tsx +16 -0
- package/defaults/app2/tsconfig.json +17 -0
- package/defaults/app3/frontend/src/App.tsx +72 -0
- package/defaults/app3/frontend/src/Header.tsx +16 -0
- package/defaults/app3/frontend/src/Html.tsx +29 -0
- package/defaults/app3/frontend/src/Layout.tsx +11 -0
- package/defaults/app3/frontend/src/_tailwind.scss +3 -0
- package/defaults/app3/frontend/src/components/Spinner.scss +17 -0
- package/defaults/app3/frontend/src/components/Spinner.tsx +10 -0
- package/defaults/app3/frontend/src/index.tsx +20 -0
- package/defaults/app3/frontend/src/pages/Home.tsx +15 -0
- package/defaults/app3/frontend/src/pages/Page1.scss +3 -0
- package/defaults/app3/frontend/src/pages/Page1.scss.json +1 -0
- package/defaults/app3/frontend/src/pages/Page1.tsx +15 -0
- package/defaults/app3/frontend/src/pages/Page2.scss +16 -0
- package/defaults/app3/frontend/src/pages/Page2.scss.json +1 -0
- package/defaults/app3/frontend/src/pages/Page2.tsx +21 -0
- package/defaults/app3/tsconfig.json +17 -0
- package/defaults/module/Gruntfile.js +16 -0
- package/defaults/module/src/components/ExampleComponent.tsx +20 -0
- package/defaults/module/src/data/example-ontology.json +20 -0
- package/defaults/module/src/data/example-ontology.json.d.ts +1 -0
- package/defaults/module/src/index.ts +7 -0
- package/defaults/module/src/module.ts +4 -0
- package/defaults/module/src/ontologies/example-ontology.ts +36 -0
- package/defaults/module/src/shapes/ExampleShapeClass.ts +29 -0
- package/defaults/module/tsconfig-es5.json +18 -0
- package/defaults/module/tsconfig.json +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Layout.js","sourceRoot":"","sources":["Layout.tsx"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAC9B,iCAA+C;AAC/C,wDAAgC;AAChC,wDAAgC;AAChC,uDAAmD;AACnD,yDAAoD;AACpD,+CAA+C;AAC/C,8DAAyD;AACzD,yDAAoD;AACpD,+DAA0D;AAC1D,qDAAqD;AACrD,+DAA6C;AAC7C,kDAA6C;AAC7C,kEAA6D;AAC7D,4DAAuD;AACvD,wEAAmE;AACnE,sDAAiD;AACjD,4DAAuD;AACvD,kDAA0B;AAI1B,MAAM,UAAU;CAGf;AAED,SAAwB,MAAM,CAAC,EAAC,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAC;IACxE,0DAA0D;IAC1D,IAAI,iBAAiB,GAAG,GAAG,GAAG,CAAC,CAAC;IAEhC,IAAI,gCAAgC,GAAG,UACrC,KAAK,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;QAErE,OAAO,OAAO,KAAK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AW,YAAY,2BAAY,EAAE;gBACvC,UAAU,GAAG,UAAU,CAAC;aACzB;iBAAM,IAAI,WAAW,YAAY,qBAAS,EAAE;gBAC3C,UAAU,GAAG,WAAW,CAAC;aAC1B;iBAAM,IAAI,WAAW,YAAY,eAAM,EAAE;gBACxC,UAAU,GAAG,QAAQ,CAAC;aACvB;YAED,MAAM,CAAC,QAAQ,GAAG,GAAG,EAAE;gBACrB,0EAA0E;gBAC1E,8CAA8C;gBAC9C,QAAQ,CAAC,YAAY,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC3D,CAAC,CAAC;YAEF,MAAM,CAAC,KAAK,GAAG,GAAG,UAAU,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACjD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
require("./Spinner.scss");
|
|
5
|
+
function Spinner({ active = true }) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: ['spinner', active && 'spinner--active'].join(' '), role: "progressbar", "aria-busy": active ? 'true' : 'false' }));
|
|
7
|
+
}
|
|
8
|
+
exports.default = Spinner;
|
|
9
|
+
//# sourceMappingURL=Spinner.js.map
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
.spinner.spinner--active {
|
|
3
|
+
border: 4px solid #474545;
|
|
4
|
+
border-top: 4px solid lightblue;
|
|
5
|
+
border-radius: 50%;
|
|
6
|
+
width: 24px;
|
|
7
|
+
height: 24px;
|
|
8
|
+
animation: spin 1s linear infinite;
|
|
9
|
+
}
|
|
10
|
+
@keyframes spin {
|
|
11
|
+
0% {
|
|
12
|
+
transform: rotate(0deg);
|
|
13
|
+
}
|
|
14
|
+
100% {
|
|
15
|
+
transform: rotate(360deg);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const client_1 = require("react-dom/client");
|
|
8
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
9
|
+
const App_1 = __importDefault(require("./App"));
|
|
10
|
+
const react_1 = __importDefault(require("react")); //we mostly use scss files, but we support tailwind as well for some components
|
|
11
|
+
// import './scss/_tailwind.scss';
|
|
12
|
+
require("./scss/main.scss");
|
|
13
|
+
(0, client_1.hydrateRoot)(document, (0, jsx_runtime_1.jsx)(react_1.default.StrictMode, { children: (0, jsx_runtime_1.jsx)(react_router_dom_1.BrowserRouter, { children: (0, jsx_runtime_1.jsx)(App_1.default, { assets: window['assetManifest'] }) }) }));
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {hydrateRoot} from 'react-dom/client';
|
|
2
|
+
import {BrowserRouter} from 'react-router-dom';
|
|
3
|
+
import App from './App';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
//uncomment if you want to use tailwind
|
|
7
|
+
// import './scss/_tailwind.scss';
|
|
8
|
+
|
|
9
|
+
hydrateRoot(
|
|
10
|
+
document,
|
|
11
|
+
<React.StrictMode>
|
|
12
|
+
<BrowserRouter>
|
|
13
|
+
<App assets={window['assetManifest']} />
|
|
14
|
+
</BrowserRouter>
|
|
15
|
+
</React.StrictMode>,
|
|
16
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"moduleResolution": "node",
|
|
5
|
+
"sourceMap": true,
|
|
6
|
+
"target": "es2019",
|
|
7
|
+
"declaration": false,
|
|
8
|
+
"experimentalDecorators": true,
|
|
9
|
+
"emitDecoratorMetadata": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"jsx": "react-jsx",
|
|
13
|
+
"types": ["node", "react", "react-dom"],
|
|
14
|
+
"pretty": true
|
|
15
|
+
},
|
|
16
|
+
"files": ["./frontend/src/index.tsx", "./backend/src/server.ts"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {lazy, Suspense} from 'react';
|
|
2
|
+
import {ErrorBoundary} from 'react-error-boundary';
|
|
3
|
+
import Html from './Html';
|
|
4
|
+
import Spinner from './components/Spinner';
|
|
5
|
+
import Layout from './Layout';
|
|
6
|
+
import {Route, Routes} from 'react-router-dom';
|
|
7
|
+
import {Storage} from 'lincd/lib/utils/Storage';
|
|
8
|
+
import {FrontendFileStore} from 'lincd-server/lib/shapes/FrontendFileStore';
|
|
9
|
+
|
|
10
|
+
const Home = lazy(() => import('./pages/Home' /* webpackPrefetch: true */));
|
|
11
|
+
const Page1 = lazy(() => import('./pages/Page1' /* webpackPrefetch: true */));
|
|
12
|
+
const Page2 = lazy(() => import('./pages/Page2' /* webpackPrefetch: true */));
|
|
13
|
+
|
|
14
|
+
let store = new FrontendFileStore('main');
|
|
15
|
+
Storage.setDefaultStore(store);
|
|
16
|
+
|
|
17
|
+
declare var window;
|
|
18
|
+
export default function App({assets = typeof window !== 'undefined' ? window['assetManifest'] : {}}) {
|
|
19
|
+
return (
|
|
20
|
+
<Html assets={assets} title="${name} - LINCD App">
|
|
21
|
+
<Suspense fallback={<Spinner />}>
|
|
22
|
+
<ErrorBoundary FallbackComponent={Error}>
|
|
23
|
+
<Content />
|
|
24
|
+
</ErrorBoundary>
|
|
25
|
+
</Suspense>
|
|
26
|
+
</Html>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function Content() {
|
|
31
|
+
return (
|
|
32
|
+
<Layout>
|
|
33
|
+
<div className="p-4 w-2/3 m-auto bg-gray-100 shadow-gray-300 shadow">
|
|
34
|
+
<Routes>
|
|
35
|
+
<Route
|
|
36
|
+
path="/"
|
|
37
|
+
element={
|
|
38
|
+
<Suspense fallback={<Spinner />}>
|
|
39
|
+
<Home />
|
|
40
|
+
</Suspense>
|
|
41
|
+
}
|
|
42
|
+
/>
|
|
43
|
+
<Route
|
|
44
|
+
path="/page1"
|
|
45
|
+
element={
|
|
46
|
+
<Suspense fallback={<Spinner />}>
|
|
47
|
+
<Page1 />
|
|
48
|
+
</Suspense>
|
|
49
|
+
}
|
|
50
|
+
/>
|
|
51
|
+
<Route
|
|
52
|
+
path="/page2"
|
|
53
|
+
element={
|
|
54
|
+
<Suspense fallback={<Spinner />}>
|
|
55
|
+
<Page2 />
|
|
56
|
+
</Suspense>
|
|
57
|
+
}
|
|
58
|
+
/>
|
|
59
|
+
</Routes>
|
|
60
|
+
</div>
|
|
61
|
+
</Layout>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function Error({error}) {
|
|
66
|
+
return (
|
|
67
|
+
<div style={{color: 'white', margin: '2rem'}}>
|
|
68
|
+
<h1>Application Error</h1>
|
|
69
|
+
<pre style={{whiteSpace: 'pre-wrap', padding: '1rem'}}>{error.stack}</pre>
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {Link} from 'react-router-dom';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
export function Header()
|
|
5
|
+
{
|
|
6
|
+
return (
|
|
7
|
+
<header className="w-2/3 m-auto">
|
|
8
|
+
<h1 className="font-xl font-bold">${name}</h1>
|
|
9
|
+
<nav className="my-4 grid grid-cols-6 gap-4">
|
|
10
|
+
<Link to="/">Home</Link>
|
|
11
|
+
<Link to="/page1">Page 1</Link>
|
|
12
|
+
<Link to="/page2">Page 2</Link>
|
|
13
|
+
</nav>
|
|
14
|
+
</header>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export default function Html({assets, children, title}) {
|
|
2
|
+
return (
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charSet="utf-8" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
<link rel="shortcut icon" href="/static/favicon.ico" />
|
|
8
|
+
<link rel="stylesheet" href={assets['main.css']} />
|
|
9
|
+
{assets['tailwind-cdn'] && (
|
|
10
|
+
<script src={assets['tailwind-cdn']}></script>
|
|
11
|
+
)}
|
|
12
|
+
<title>{title}</title>
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<noscript
|
|
16
|
+
dangerouslySetInnerHTML={{
|
|
17
|
+
__html: `<b>Enable JavaScript to run this app.</b>`,
|
|
18
|
+
}}
|
|
19
|
+
/>
|
|
20
|
+
{children}
|
|
21
|
+
<script
|
|
22
|
+
dangerouslySetInnerHTML={{
|
|
23
|
+
__html: `assetManifest = ${JSON.stringify(assets)};`,
|
|
24
|
+
}}
|
|
25
|
+
/>
|
|
26
|
+
</body>
|
|
27
|
+
</html>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
.spinner.spinner--active {
|
|
3
|
+
border: 4px solid #474545;
|
|
4
|
+
border-top: 4px solid lightblue;
|
|
5
|
+
border-radius: 50%;
|
|
6
|
+
width: 24px;
|
|
7
|
+
height: 24px;
|
|
8
|
+
animation: spin 1s linear infinite;
|
|
9
|
+
}
|
|
10
|
+
@keyframes spin {
|
|
11
|
+
0% {
|
|
12
|
+
transform: rotate(0deg);
|
|
13
|
+
}
|
|
14
|
+
100% {
|
|
15
|
+
transform: rotate(360deg);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
window['$RefreshReg$'] = () => {};
|
|
2
|
+
window['$RefreshSig$'] = () => () => {};
|
|
3
|
+
|
|
4
|
+
import {hydrateRoot} from 'react-dom/client';
|
|
5
|
+
import {BrowserRouter} from 'react-router-dom';
|
|
6
|
+
import App from './App';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
//comment out if you don't want to use tailwind
|
|
10
|
+
import './_tailwind.scss';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
hydrateRoot(
|
|
14
|
+
document,
|
|
15
|
+
<React.StrictMode>
|
|
16
|
+
<BrowserRouter>
|
|
17
|
+
<App assets={window['assetManifest']} />
|
|
18
|
+
</BrowserRouter>
|
|
19
|
+
</React.StrictMode>,
|
|
20
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function Home() {
|
|
2
|
+
return (
|
|
3
|
+
<div>
|
|
4
|
+
<h1 className="my-2 text-xl font-bold">${name}</h1>
|
|
5
|
+
<h2 className="my-2 text-lg font-bold">Get started</h2>
|
|
6
|
+
<p>
|
|
7
|
+
Your LINCD App is ready to go!<br />
|
|
8
|
+
To edit this file, open:
|
|
9
|
+
</p>
|
|
10
|
+
<code className="font-mono my-2 bg-blue-100 p-2 block">
|
|
11
|
+
<pre>/frontend/src/pages/Home.tsx</pre>
|
|
12
|
+
</code>
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"page1":"test_app_123_Page1_page1"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./Page1.scss";
|
|
2
|
+
export default function Page1() {
|
|
3
|
+
return (
|
|
4
|
+
<div className="page1">
|
|
5
|
+
This page is styled with SASS. Simply import the relevant .scss file in your code to include it in the bundle.
|
|
6
|
+
Using this setup, class names will have a global scope.<br />
|
|
7
|
+
<br />
|
|
8
|
+
See:
|
|
9
|
+
<code className="font-mono my-2 bg-blue-100 p-2 block">
|
|
10
|
+
<pre>/frontend/src/pages/Page1.tsx</pre>
|
|
11
|
+
</code>
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"page2":"test_app_123_Page2_page2"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "./Page2.scss";
|
|
2
|
+
import * as style from "./Page2.scss.json";
|
|
3
|
+
export default function Page2() {
|
|
4
|
+
return (
|
|
5
|
+
<div className={style.page2}>
|
|
6
|
+
<h1>Example page using SASS + CSS Modules</h1>
|
|
7
|
+
This page is styled with SASS + CSS Modules. It imports the relevant .scss file{' '}
|
|
8
|
+
<span>and the generated .scss.json file</span>.<br />
|
|
9
|
+
<br />
|
|
10
|
+
Using this setup your class names will be scoped to the file(s)
|
|
11
|
+
where you use them. The typescript compiler will also auto complete class names and warn you if you're using class
|
|
12
|
+
names that don't exists.
|
|
13
|
+
<br />
|
|
14
|
+
<br />
|
|
15
|
+
See:
|
|
16
|
+
<code>
|
|
17
|
+
<pre>/frontend/src/pages/Page2.tsx</pre>
|
|
18
|
+
</code>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"moduleResolution": "node",
|
|
5
|
+
"sourceMap": true,
|
|
6
|
+
"target": "es2019",
|
|
7
|
+
"declaration": false,
|
|
8
|
+
"experimentalDecorators": true,
|
|
9
|
+
"emitDecoratorMetadata": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"jsx": "react-jsx",
|
|
13
|
+
"types": ["node", "react", "react-dom"],
|
|
14
|
+
"pretty": true
|
|
15
|
+
},
|
|
16
|
+
"files": ["./frontend/src/index.tsx"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var buildTools = require('lincd-cli');
|
|
2
|
+
module.exports = buildTools.generateGruntConfig('${module_name}', {
|
|
3
|
+
externals: {
|
|
4
|
+
react: 'React',
|
|
5
|
+
'react-dom': 'ReactDOM',
|
|
6
|
+
}, //list of non lincd modules that are already loaded and made globally available by one of the dependencies of this module
|
|
7
|
+
//internals: [],//list of lincd modules that you want to INCLUDE in the bundle (as opposed to the module its own bundle being a dependency)
|
|
8
|
+
//alias:{},//webpack alias -> maps on type of npm path to another
|
|
9
|
+
//target:"es5"|"es6",
|
|
10
|
+
//environment:"server"|"frontend",
|
|
11
|
+
//outputPath:string,
|
|
12
|
+
//es5Server:boolean
|
|
13
|
+
//es5:{},//es5 specific config, use same properties as above
|
|
14
|
+
//es6:{},//es6 specific config, use same properties as above
|
|
15
|
+
//debug:false,//debug the build process
|
|
16
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {ExampleShapeClass} from "../shapes/ExampleShapeClass";
|
|
3
|
+
import {linkedComponentClass,linkedComponent} from '../module';
|
|
4
|
+
import {LinkedComponentClass} from 'lincd/lib/utils/LinkedComponentClass';
|
|
5
|
+
|
|
6
|
+
export const ExampleComponent = linkedComponent<ExampleShapeClass>(ExampleShapeClass, ({source, sourceShape}) => {
|
|
7
|
+
//note that typescript knows that person has the type of the Shape you provided
|
|
8
|
+
return <div></div>;
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
//alternatively, use a Class component if you prefer:
|
|
12
|
+
/*@linkedComponentClass(ExampleShapeClass)
|
|
13
|
+
export class ExampleComponent extends LinkedComponentClass<ExampleShapeClass> {
|
|
14
|
+
render() {
|
|
15
|
+
let exampleInstance = this.sourceShape;
|
|
16
|
+
|
|
17
|
+
//get the name of this item from the graph
|
|
18
|
+
return <h1>Hello {exampleInstance.name}!</h1>;
|
|
19
|
+
}
|
|
20
|
+
}*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": {
|
|
3
|
+
"dc": "http://purl.org/dc/elements/1.1/",
|
|
4
|
+
"owl": "http://www.w3.org/2002/07/owl#",
|
|
5
|
+
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
|
6
|
+
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
|
|
7
|
+
"${hyphen_name}": "${uri_base}"
|
|
8
|
+
},
|
|
9
|
+
"@graph": [
|
|
10
|
+
{
|
|
11
|
+
"@id": "${hyphen_name}:ExampleClass",
|
|
12
|
+
"@type": "rdfs:Class",
|
|
13
|
+
"rdfs:comment": "This is an example class. You can remove or rename it",
|
|
14
|
+
"rdfs:isDefinedBy": {
|
|
15
|
+
"@id": "${hyphen_name}:"
|
|
16
|
+
},
|
|
17
|
+
"rdfs:label": "Example Class"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var json: string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {NamedNode} from 'lincd/lib/models';
|
|
2
|
+
import {JSONLD} from 'lincd-jsonld/lib/utils/JSONLD';
|
|
3
|
+
import {createNameSpace} from 'lincd/lib/utils/NameSpace';
|
|
4
|
+
import {linkedOntology} from '../module';
|
|
5
|
+
//import all the exports of this file as one variable called _this (we need this at the end)
|
|
6
|
+
import * as _this from './${hyphen_name}';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Load the data of this ontology into memory, thus adding the properties of the entities of this ontology to the local graph.
|
|
10
|
+
*/
|
|
11
|
+
export var loadData = () => {
|
|
12
|
+
return import('../data/${hyphen_name}.json').then((data) => JSONLD.parse(data));
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The namespace of this ontology, which can be used to create NamedNodes with URI's not listed in this file
|
|
17
|
+
*/
|
|
18
|
+
export var ns = createNameSpace('${uri_base}');
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The NamedNode of the ontology itself
|
|
22
|
+
*/
|
|
23
|
+
export var _self: NamedNode = ns('');
|
|
24
|
+
|
|
25
|
+
//A list of all the entities (Classes & Properties) of this ontology, each exported as a NamedNode
|
|
26
|
+
export var ExampleClass: NamedNode = ns('ExampleClass');
|
|
27
|
+
export var exampleProperty: NamedNode = ns('exampleProperty');
|
|
28
|
+
|
|
29
|
+
//An extra grouping object so all the entities can be accessed from the prefix/name
|
|
30
|
+
export const ${camel_name} = {
|
|
31
|
+
ExampleClass,
|
|
32
|
+
exampleProperty,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
//Registers this ontology to LINCD.JS, so that data loading can be automated amongst other things
|
|
36
|
+
linkedOntology(_this, ns, '${hyphen_name}', loadData, '../data/${hyphen_name}.json');
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {Shape} from 'lincd/lib/shapes/Shape';
|
|
2
|
+
import {Literal, NamedNode} from 'lincd/lib/models';
|
|
3
|
+
import {linkedShape} from '../module';
|
|
4
|
+
import {literalProperty} from 'lincd/lib/utils/ShapeDecorators';
|
|
5
|
+
import {${camel_name}} from '../ontologies/${hyphen_name}';
|
|
6
|
+
|
|
7
|
+
@linkedShape
|
|
8
|
+
export class ExampleShapeClass extends Shape {
|
|
9
|
+
/**
|
|
10
|
+
* indicates that instances of this shape need to have this rdf.type
|
|
11
|
+
*/
|
|
12
|
+
static targetClass: NamedNode = ${camel_name}.ExampleClass;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* instances of this shape need to have exactly one value defined for the given property
|
|
16
|
+
*/
|
|
17
|
+
@literalProperty({
|
|
18
|
+
path: ${camel_name}.exampleProperty,
|
|
19
|
+
required: true,
|
|
20
|
+
maxCount: 1,
|
|
21
|
+
})
|
|
22
|
+
get name() {
|
|
23
|
+
return this.getValue(${camel_name}.exampleProperty);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
set name(val: string) {
|
|
27
|
+
this.overwrite(${camel_name}.exampleProperty, new Literal(val));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"sourceMap": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "lib",
|
|
7
|
+
"declaration": false,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"downlevelIteration": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"jsx": "react",
|
|
14
|
+
"baseUrl": "./",
|
|
15
|
+
"rootDir": "src"
|
|
16
|
+
},
|
|
17
|
+
"files": ["./src/index.ts"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"sourceMap": true,
|
|
5
|
+
"target": "es6",
|
|
6
|
+
"outDir": "lib",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"downlevelIteration": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"jsx": "react",
|
|
14
|
+
"baseUrl": "./",
|
|
15
|
+
"rootDir": "src"
|
|
16
|
+
},
|
|
17
|
+
"files": ["./src/index.ts"]
|
|
18
|
+
}
|