Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ jobs:
- name: Checkout core repository
uses: actions/checkout@v4
with:
repository: goanpeca/core
ref: sdk/core-updates
repository: datalayer/core
ref: refact/models
path: datalayer/core

- name: Setup build environment
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dist/
dist-electron/
release/
out/
lib/

# misc
.DS_Store
Expand Down
7,747 changes: 3,932 additions & 3,815 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"build": "npm run type-check && cross-env NODE_OPTIONS=--max-old-space-size=8192 electron-vite build && node scripts/fix-production-bundle.js",
"preview": "electron-vite preview",
"type-check": "tsc --noEmit",
"type-check:watch": "tsc --project tsconfig.lib.json --watch --preserveWatchOutput",
"lint": "eslint src --max-warnings 0",
"lint:fix": "eslint src --fix",
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,json,md}\"",
Expand Down Expand Up @@ -46,7 +47,7 @@
"dist:dev-prod:linux": "cross-env ELECTRON_DEV_PROD=true npm run build && cross-env ELECTRON_DEV_PROD=true electron-builder --linux"
},
"dependencies": {
"@datalayer/core": "^0.0.13",
"@datalayer/core": "^0.0.14",
"@datalayer/jupyter-lexical": "^1.0.6",
"@datalayer/jupyter-react": "^1.1.7",
"@datalayer/lexical-loro": "^0.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/main/services/datalayer-sdk-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import { DatalayerClient } from '@datalayer/core/lib/client/index';
import type { UserJSON } from '@datalayer/core/lib/client/models/User';
import type { UserJSON } from '@datalayer/core/lib/models/UserDTO';
import { safeStorage } from 'electron';
import { existsSync, readFileSync, writeFileSync, unlinkSync } from 'fs';
import { join } from 'path';
Expand Down
4 changes: 2 additions & 2 deletions src/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import type {
NotebookJSON,
SpaceJSON,
LexicalJSON,
} from '@datalayer/core/lib/client/models';
import type { UserJSON } from '@datalayer/core/lib/client/models/User';
} from '@datalayer/core/lib/models';
import type { UserJSON } from '@datalayer/core/lib/models/UserDTO';

/**
* Electron API for system information and menu actions.
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/lexical/LexicalDocument.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import React, { useState, useEffect, useRef } from 'react';
import { Box, Text, Spinner } from '@primer/react';
import type { LexicalJSON } from '@datalayer/core/lib/client/models';
import type { LexicalJSON } from '@datalayer/core/lib/models';
import {
LexicalCollaborationService,
type LexicalCollaborationConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/notebook/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
PaperAirplaneIcon,
} from '@primer/octicons-react';
import { notebookStore2 } from '@datalayer/jupyter-react';
import type { EnvironmentJSON } from '@datalayer/core/lib/client/models';
import type { EnvironmentJSON } from '@datalayer/core/lib/models';
import { RuntimeProgressBar } from '../runtime/RuntimeProgressBar';
import { RuntimeSelector } from '../runtime/RuntimeSelector';
import { useService } from '../../contexts/ServiceContext';
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/runtime/CreateRuntimeDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
Button,
Text,
} from '@primer/react';
import type { EnvironmentJSON } from '@datalayer/core/lib/client/models';
import type { EnvironmentJSON } from '@datalayer/core/lib/models';

export interface CreateRuntimeDialogProps {
isOpen: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/runtime/RuntimeToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
IconButton,
} from '@primer/react';
import { TrashIcon } from '@primer/octicons-react';
import type { EnvironmentJSON } from '@datalayer/core/lib/client/models';
import type { EnvironmentJSON } from '@datalayer/core/lib/models';
import { RuntimeProgressBar } from './RuntimeProgressBar';
import { RuntimeSelector } from './RuntimeSelector';
import { useService } from '../../contexts/ServiceContext';
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Footer from '../components/auth/Footer';
import Version from '../components/auth/Version';
import { LoginFormData, LoginState } from '../../shared/types';
import { validateLoginForm, formatLoginError } from '../utils/login';
// UserJSON type not exported, using Record from '@datalayer/core/lib/client/models';
// UserJSON type not exported, using Record from '@datalayer/core/lib/models';

interface LoginProps {
onUserDataFetched?: (userData: Record<string, unknown>) => void;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/pages/Spaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import React, { useState, useEffect, useRef } from 'react';
import { Box } from '@primer/react';
import { BookIcon, FileIcon } from '@primer/octicons-react';
import type { SpaceJSON, LexicalJSON } from '@datalayer/core/lib/client/models';
import type { SpaceJSON, LexicalJSON } from '@datalayer/core/lib/models';
import {
DocumentsListProps,
SpaceInfo,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/services/interfaces/IRuntimeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { ServiceManager } from '@jupyterlab/services';
import { RuntimeJSON } from '@datalayer/core/lib/client/models';
import { RuntimeJSON } from '@datalayer/core/lib/models';
import { ILifecycle } from './ILifecycle';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/services/lexicalCollaboration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @module renderer/services/lexicalCollaboration
*/

import type { LexicalJSON } from '@datalayer/core/lib/client/models';
import type { LexicalJSON } from '@datalayer/core/lib/models';

/**
* Configuration for lexical document collaboration.
Expand Down
2 changes: 1 addition & 1 deletion src/shared/types/document.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import type { LexicalEditor } from 'lexical';
import type { ServiceManager } from '@jupyterlab/services';
import type { RuntimeJSON } from '@datalayer/core/lib/client/models';
import type { RuntimeJSON } from '@datalayer/core/lib/models';

/**
* Document data structure for Lexical documents.
Expand Down
5 changes: 1 addition & 4 deletions src/shared/types/documents.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
* @module shared/types/documents
*/

import type {
NotebookJSON,
LexicalJSON,
} from '@datalayer/core/lib/client/models';
import type { NotebookJSON, LexicalJSON } from '@datalayer/core/lib/models';

/**
* Represents any document item (notebook or lexical) from the API.
Expand Down
6 changes: 3 additions & 3 deletions src/shared/types/ipc.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export type {
NotebookJSON,
LexicalJSON,
SpaceJSON,
} from '@datalayer/core/lib/client/models';
export type { UserJSON } from '@datalayer/core/lib/client/models/User';
} from '@datalayer/core/lib/models';
export type { UserJSON } from '@datalayer/core/lib/models/UserDTO';

import type { UserJSON } from '@datalayer/core/lib/client/models/User';
import type { UserJSON } from '@datalayer/core/lib/models/UserDTO';

/**
* Authentication state shared between main and renderer processes.
Expand Down
2 changes: 1 addition & 1 deletion src/shared/types/notebook.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import type { ServiceManager } from '@jupyterlab/services';
import { INotebookContent } from '@jupyterlab/nbformat';
import type { RuntimeJSON } from '@datalayer/core/lib/client/models';
import type { RuntimeJSON } from '@datalayer/core/lib/models';
import type { ElectronCollaborationProvider } from '../../renderer/services/electronCollaborationProvider';

/**
Expand Down
36 changes: 17 additions & 19 deletions src/shared/types/window.types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ declare global {
onAuthStateChanged: (
callback: (authState: {
isAuthenticated: boolean;
user: import('@datalayer/core/lib/client/models').UserJSON | null;
user: import('@datalayer/core/lib/models').UserJSON | null;
token: string | null;
runUrl: string;
}) => void
Expand Down Expand Up @@ -164,56 +164,54 @@ declare global {
// Authentication
login: (token: string) => Promise<{
isAuthenticated: boolean;
user: import('@datalayer/core/lib/client/models').UserJSON;
user: import('@datalayer/core/lib/models').UserJSON;
token: string;
runUrl: string;
}>;
logout: () => Promise<void>;
whoami: () => Promise<
import('@datalayer/core/lib/client/models').UserJSON
>;
whoami: () => Promise<import('@datalayer/core/lib/models').UserJSON>;
getAuthState: () => Promise<{
isAuthenticated: boolean;
user: import('@datalayer/core/lib/client/models').UserJSON | null;
user: import('@datalayer/core/lib/models').UserJSON | null;
token: string | null;
runUrl: string;
}>;
getSpacerRunUrl: () => Promise<string>;

// Environments
listEnvironments: () => Promise<
import('@datalayer/core/lib/client/models').EnvironmentJSON[]
import('@datalayer/core/lib/models').EnvironmentJSON[]
>;

// Runtimes
listRuntimes: () => Promise<
import('@datalayer/core/lib/client/models').RuntimeJSON[]
import('@datalayer/core/lib/models').RuntimeJSON[]
>;
getRuntime: (
runtimeId: string
) => Promise<import('@datalayer/core/lib/client/models').RuntimeJSON>;
) => Promise<import('@datalayer/core/lib/models').RuntimeJSON>;
createRuntime: (options: {
environmentName: string;
type?: string;
givenName?: string;
minutesLimit?: number;
}) => Promise<import('@datalayer/core/lib/client/models').RuntimeJSON>;
}) => Promise<import('@datalayer/core/lib/models').RuntimeJSON>;
deleteRuntime: (runtimeId: string) => Promise<void>;
terminateAllRuntimes: () => Promise<PromiseSettledResult<void>[]>;

// Spaces
listSpaces: () => Promise<
import('@datalayer/core/lib/client/models').SpaceJSON[]
import('@datalayer/core/lib/models').SpaceJSON[]
>;
getMySpaces: () => Promise<
import('@datalayer/core/lib/client/models').SpaceJSON[]
import('@datalayer/core/lib/models').SpaceJSON[]
>;
getSpaceItems: (
spaceId: string
) => Promise<
Array<
| import('@datalayer/core/lib/client/models').NotebookJSON
| import('@datalayer/core/lib/client/models').LexicalJSON
| import('@datalayer/core/lib/models').NotebookJSON
| import('@datalayer/core/lib/models').LexicalJSON
>
>;
getContent: (itemId: string) => Promise<unknown>;
Expand All @@ -222,27 +220,27 @@ declare global {
// Notebooks
listNotebooks: (
spaceId: string
) => Promise<import('@datalayer/core/lib/client/models').NotebookJSON[]>;
) => Promise<import('@datalayer/core/lib/models').NotebookJSON[]>;
getNotebook: (
notebookId: string
) => Promise<import('@datalayer/core/lib/client/models').NotebookJSON>;
) => Promise<import('@datalayer/core/lib/models').NotebookJSON>;
createNotebook: (
spaceId: string,
name: string,
description?: string
) => Promise<import('@datalayer/core/lib/client/models').NotebookJSON>;
) => Promise<import('@datalayer/core/lib/models').NotebookJSON>;
updateNotebook: (
notebookId: string,
data: { name?: string; description?: string }
) => Promise<import('@datalayer/core/lib/client/models').NotebookJSON>;
) => Promise<import('@datalayer/core/lib/models').NotebookJSON>;
deleteNotebook: (notebookId: string) => Promise<void>;

// Lexical documents
createLexical: (
spaceId: string,
name: string,
description?: string
) => Promise<import('@datalayer/core/lib/client/models').LexicalJSON>;
) => Promise<import('@datalayer/core/lib/models').LexicalJSON>;
deleteLexical: (lexicalId: string) => Promise<void>;
};
}
Expand Down
26 changes: 26 additions & 0 deletions tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./lib",
"rootDir": "./src",
"declaration": true,
"declarationMap": true,
"declarationDir": "./lib",
"sourceMap": true
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": [
"tests",
"tests/**/*",
"src/tests",
"src/tests/**/*",
"src/**/*.test.ts",
"src/**/*.test.tsx",
"src/**/*.spec.ts",
"src/**/*.spec.tsx",
"src/**/__tests__/**",
"dist",
"dist-electron"
]
}
Loading