lincd-cli 1.2.8 → 1.2.9

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.
Files changed (56) hide show
  1. package/defaults/app-with-backend/.husky/pre-commit +0 -0
  2. package/defaults/app-with-backend/.yarn/releases/yarn-3.6.1.cjs +0 -0
  3. package/lib/cjs/cli-methods.d.ts.map +1 -1
  4. package/lib/cjs/cli-methods.js +55 -10
  5. package/lib/cjs/cli-methods.js.map +1 -1
  6. package/lib/cjs/cli.d.ts.map +1 -1
  7. package/lib/cjs/cli.js +21 -7
  8. package/lib/cjs/cli.js.map +1 -1
  9. package/lib/cjs/package.json +3 -3
  10. package/lib/cjs/utils.d.ts.map +1 -1
  11. package/lib/cjs/utils.js +2 -0
  12. package/lib/cjs/utils.js.map +1 -1
  13. package/lib/esm/cli-methods.d.ts.map +1 -1
  14. package/lib/esm/cli-methods.js +53 -9
  15. package/lib/esm/cli-methods.js.map +1 -1
  16. package/lib/esm/cli.d.ts.map +1 -1
  17. package/lib/esm/cli.js +22 -8
  18. package/lib/esm/cli.js.map +1 -1
  19. package/lib/esm/package.json +3 -3
  20. package/lib/esm/utils.d.ts.map +1 -1
  21. package/lib/esm/utils.js +2 -0
  22. package/lib/esm/utils.js.map +1 -1
  23. package/package.json +4 -4
  24. package/defaults/app-static/src/index-static.tsx +0 -22
  25. package/defaults/app-with-backend/src/App.module.css +0 -17
  26. package/defaults/app-with-backend/src/App.tsx +0 -30
  27. package/defaults/app-with-backend/src/backend.ts +0 -9
  28. package/defaults/app-with-backend/src/components/Error.module.css +0 -9
  29. package/defaults/app-with-backend/src/components/Error.tsx +0 -11
  30. package/defaults/app-with-backend/src/components/Spinner.module.css +0 -17
  31. package/defaults/app-with-backend/src/components/Spinner.tsx +0 -12
  32. package/defaults/app-with-backend/src/config-frontend.ts +0 -17
  33. package/defaults/app-with-backend/src/index.tsx +0 -34
  34. package/defaults/app-with-backend/src/layout/DefaultLayout.module.css +0 -12
  35. package/defaults/app-with-backend/src/layout/DefaultLayout.tsx +0 -12
  36. package/defaults/app-with-backend/src/layout/Header.module.css +0 -25
  37. package/defaults/app-with-backend/src/layout/Header.tsx +0 -27
  38. package/defaults/app-with-backend/src/package.ts +0 -12
  39. package/defaults/app-with-backend/src/pages/Home.module.css +0 -15
  40. package/defaults/app-with-backend/src/pages/Home.tsx +0 -21
  41. package/defaults/app-with-backend/src/pages/Page1.tsx +0 -11
  42. package/defaults/app-with-backend/src/pages/PageNotFound.tsx +0 -12
  43. package/defaults/app-with-backend/src/pages/Signin.tsx +0 -12
  44. package/defaults/app-with-backend/src/routes.tsx +0 -85
  45. package/defaults/app-with-backend/src/theme.css +0 -95
  46. package/defaults/app-with-backend/src/types.ts +0 -14
  47. package/defaults/app-with-backend/src/utils/lazyWithPreload.tsx +0 -42
  48. package/defaults/app-with-backend/src/utils/preloadRoutes.ts +0 -38
  49. package/defaults/app-with-backend/tsconfig.json +0 -24
  50. package/defaults/package/src/backend.ts +0 -2
  51. package/defaults/package/src/data/example-ontology.json +0 -10
  52. package/defaults/package/src/data/example-ontology.json.d.ts +0 -1
  53. package/defaults/package/src/index.ts +0 -8
  54. package/defaults/package/src/ontologies/example-ontology.ts +0 -43
  55. package/defaults/package/src/package.ts +0 -13
  56. package/defaults/package/src/types.ts +0 -4
@@ -1,14 +0,0 @@
1
- declare module '*.css' {
2
- const styles: {
3
- readonly [key: string]: string;
4
- };
5
- // export type ClassName = string;
6
- export default styles;
7
- }
8
- declare module '*.scss' {
9
- const styles: {
10
- readonly [key: string]: string;
11
- };
12
- // export type ClassName = string;
13
- export default styles;
14
- }
@@ -1,42 +0,0 @@
1
- import { ComponentType, lazy } from 'react';
2
-
3
- export interface PreloadableComponent<T extends ComponentType<any>> {
4
- preload: () => Promise<{ default: T }>;
5
- Component: React.LazyExoticComponent<T>;
6
- }
7
-
8
- /**
9
- * Creates a lazy-loaded component with a preload function
10
- * This allows preloading the component before React needs it
11
- *
12
- * @example
13
- * const SigninPage = lazyWithPreload(() => import('./pages/Signin'));
14
- * // Later, before navigation or on server:
15
- * SigninPage.preload();
16
- */
17
- export function lazyWithPreload<T extends ComponentType<any>>(
18
- importFunc: () => Promise<{ default: T }>
19
- ): PreloadableComponent<T> {
20
- let modulePromise: Promise<{ default: T }> | null = null;
21
-
22
- const preload = () => {
23
- if (!modulePromise) {
24
- modulePromise = importFunc();
25
- }
26
- return modulePromise;
27
- };
28
-
29
- const Component = lazy(() => {
30
- // If preload was called, reuse the same promise
31
- // This ensures React uses the already-loaded module
32
- if (!modulePromise) {
33
- modulePromise = importFunc();
34
- }
35
- return modulePromise;
36
- });
37
-
38
- return {
39
- preload,
40
- Component,
41
- };
42
- }
@@ -1,38 +0,0 @@
1
- /**
2
- * Client-side script to preload lazy routes before hydration
3
- * This should be called BEFORE React's hydrateRoot()
4
- */
5
-
6
- // This will be populated by the server with the routes that need preloading
7
- declare global {
8
- interface Window {
9
- __PRELOAD_ROUTES__?: string[];
10
- }
11
- }
12
-
13
- export async function preloadMatchedRoute() {
14
- // Get the list of routes to preload from the server
15
- const routesToPreload = window.__PRELOAD_ROUTES__ || [];
16
-
17
- if (routesToPreload.length === 0) {
18
- return;
19
- }
20
-
21
- // Dynamically import the routes module to access PRELOADABLE_ROUTES
22
- const routesModule = await import('../routes');
23
- const { PRELOADABLE_ROUTES } = routesModule;
24
-
25
- // Preload each route
26
- const preloadPromises = routesToPreload
27
- .map((routeKey) => {
28
- const preloadableRoute = PRELOADABLE_ROUTES[routeKey];
29
- if (preloadableRoute && preloadableRoute.preload) {
30
- return preloadableRoute.preload();
31
- }
32
- return null;
33
- })
34
- .filter(Boolean);
35
-
36
- // Wait for all preloads to complete
37
- await Promise.all(preloadPromises);
38
- }
@@ -1,24 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "esnext",
4
- "moduleResolution": "node",
5
- "sourceMap": true,
6
- "target": "es2018",
7
- "resolveJsonModule": true,
8
- "declaration": false,
9
- "experimentalDecorators": true,
10
- "emitDecoratorMetadata": true,
11
- "esModuleInterop": true,
12
- "resolveJsonModule": true,
13
- "jsx": "react-jsx",
14
- "types": ["node", "react", "react-dom"],
15
- "plugins": [
16
- {
17
- "name": "typescript-plugin-css-modules"
18
- }
19
- ],
20
- "pretty": true
21
- },
22
- "files": ["./src/index.tsx", "./src/types.ts"],
23
- "include": ["./src/backend.ts"]
24
- }
@@ -1,2 +0,0 @@
1
- //export all your providers from this package here
2
- //Format: export * from './shapes/SomeShapeProvider.js';
@@ -1,10 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export var json: string;
@@ -1,8 +0,0 @@
1
- import './types';
2
- import './ontologies/${hyphen_name}.js';
3
-
4
- //SHAPES FIRST
5
- // import './shapes/YourShape';
6
-
7
- //THEN COMPONENTS
8
- // import './components/YourComponent';
@@ -1,43 +0,0 @@
1
- import {NamedNode} from 'lincd/models';
2
- import {JSONLD} from 'lincd-jsonld/utils/JSONLD';
3
- import {createNameSpace} from 'lincd/utils/NameSpace';
4
- import {linkedOntology} from '../package.js';
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}.js';
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
- if (typeof module !== 'undefined' && typeof exports !== 'undefined') {
13
- // CommonJS import
14
- return import('../data/${hyphen_name}.json').then((data) => JSONLD.parse(data));
15
- } else {
16
- // ESM import
17
- //@ts-ignore
18
- return import('../data/${hyphen_name}.json',{ with: { type: "json" } }).then((data) => JSONLD.parse(data.defauilt));
19
- }
20
- };
21
-
22
- /**
23
- * The namespace of this ontology, which can be used to create NamedNodes with URI's not listed in this file
24
- */
25
- export var ns = createNameSpace('${uri_base}');
26
-
27
- /**
28
- * The NamedNode of the ontology itself
29
- */
30
- export var _self: NamedNode = ns('');
31
-
32
- //A list of all the entities (Classes & Properties) of this ontology, each exported as a NamedNode
33
- // export var ExampleClass: NamedNode = ns('ExampleClass');
34
- // export var exampleProperty: NamedNode = ns('exampleProperty');
35
-
36
- //An extra grouping object so all the entities can be accessed from the prefix/name
37
- export const ${camel_name} = {
38
- // ExampleClass,
39
- // exampleProperty,
40
- };
41
-
42
- //Registers this ontology to LINCD.JS, so that data loading can be automated amongst other things
43
- linkedOntology(_this, ns, '${hyphen_name}', loadData, '../data/${hyphen_name}.json');
@@ -1,13 +0,0 @@
1
- import {linkedPackage} from 'lincd/utils/Package';
2
-
3
- export const {
4
- linkedComponent,
5
- linkedShape,
6
- linkedUtil,
7
- linkedOntology,
8
- registerPackageExport,
9
- packageExports,
10
- packageName,
11
- getPackageShape
12
-
13
- } = linkedPackage('${package_name}');
@@ -1,4 +0,0 @@
1
- declare module '*.module.css' {
2
- const classes: {[key: string]: string};
3
- export default classes;
4
- }