Skip to content
Merged
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
7 changes: 6 additions & 1 deletion .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ jobs:
- run: yarn workspace logisheets-web build
- run: yarn run run-scripts && yarn run wasm
- run: yarn build
- run: yarn test

- name: Build and test logisheets-node
run: |
yarn workspace logisheets run link
yarn workspace logisheets build
yarn workspace logisheets test
11 changes: 7 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ edition = "2018"
[workspace.dependencies]
chrono = "0.4"
futures = "0.3"
gents = "1.1"
gents_derives = "1.1"
gents = "1.3"
gents_derives = "1.3"
getrandom = "0.2"
imbl = "2.0"
lazy_static = "1.4"
Expand Down
27 changes: 15 additions & 12 deletions crafts/markdown-table-extractor/src/actions.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import {
Payload,
CellInputBuilder,
SetCellFontBuilder,
CellStyleUpdateBuilder,
StyleUpdateTypeBuilder,
getFirstCell,
} from 'logisheets-web'
import type {
Payload,
Selection,
Transaction,
} from 'logisheets-web'

export function buildTransaction(payloads: Payload[]): Transaction {
return new Transaction(payloads, true)
return {payloads, undoable: true, temp: false}
}

export function generatePayloads(
Expand All @@ -21,39 +24,39 @@ export function generatePayloads(
const sheetIdx = selection.sheetIdx
const payloads: Payload[] = []
for (let i = 0; i < headers.length; i++) {
const input = {
const input: Payload = {
type: 'cellInput',
value: new CellInputBuilder()
.sheetIdx(sheetIdx)
.row(firstCell.y)
.col(firstCell.x + i)
.content(headers[i])
.build(),
} as Payload
const font = {
type: 'setCellFont',
value: new SetCellFontBuilder()
}
const font: Payload = {
type: 'cellStyleUpdate',
value: new CellStyleUpdateBuilder()
.sheetIdx(sheetIdx)
.row(firstCell.y)
.col(firstCell.x + i)
.bold(true)
.ty(new StyleUpdateTypeBuilder().setFontBold(true).build())
.build(),
} as Payload
}
payloads.push(input)
payloads.push(font)
}

for (let i = 0; i < rows.length; i++) {
for (let j = 0; j < rows[i].length; j++) {
const input = {
const input: Payload = {
type: 'cellInput',
value: new CellInputBuilder()
.sheetIdx(sheetIdx)
.row(firstCell.y + i + 1)
.col(firstCell.x + j)
.content(rows[i][j])
.build(),
} as Payload
}
payloads.push(input)
}
}
Expand Down
10 changes: 6 additions & 4 deletions crafts/what-if-calculator/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import {
Transaction,
getFirstCell,
CellInputBuilder,
isErrorMessage,
toA1notation,
} from 'logisheets-web'
import type {
Transaction,
Payload,
Client,
Value,
isErrorMessage,
Selection,
toA1notation,
} from 'logisheets-web'

export interface ValueChange {
Expand Down Expand Up @@ -59,7 +61,7 @@ export function generateTransaction(
.build(),
}
})
return new Transaction(payloads, true)
return {payloads, undoable: true, temp: false}
}

export async function getTrendsThroughTempTransaction(
Expand Down
1 change: 1 addition & 0 deletions crates/buildtools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ gents = { workspace = true }

logisheets-rs = { workspace = true }
logisheets_sequencer = { path = "../sequencer" }
logisheets_wasm_server = { path = "../wasms/server" }

[[bin]]
name = "generate"
Expand Down
25 changes: 5 additions & 20 deletions crates/buildtools/src/generate.rs
Original file line number Diff line number Diff line change
@@ -1,36 +1,21 @@
use gents::FileGroup;
use logisheets_rs::{
ActionEffect, AppData, AppendixWithCell, AsyncFuncResult, BlockField, CellCoordinateWithSheet,
CellInfo, CellPosition, DisplayWindowRequest, DisplayWindowWithStartPoint, EditAction,
ErrorMessage, FormulaDisplayInfo, SaveFileResult, ShadowCellInfo, SheetDimension, SheetInfo,
AsyncFuncResult, DisplayWindowRequest,
};

fn main() {
let path = "packages/web/src/bindings";
let mut file_group = FileGroup::new();
file_group.add::<DisplayWindowRequest>();
file_group.add::<CellCoordinateWithSheet>();
file_group.add::<CellPosition>();
file_group.add::<DisplayWindowWithStartPoint>();
file_group.add::<EditAction>();
file_group.add::<SheetInfo>();
file_group.add::<ActionEffect>();
file_group.add::<AsyncFuncResult>();
file_group.add::<SheetDimension>();
file_group.add::<AppendixWithCell>();
file_group.add::<SaveFileResult>();

file_group.add::<FormulaDisplayInfo>();
file_group.add::<AppData>();

file_group.add::<CellInfo>();
file_group.add::<BlockField>();
file_group.add::<ErrorMessage>();
file_group.add::<ShadowCellInfo>();

use logisheets_sequencer::{SequencerMessage, UserMessage};
file_group.add::<SequencerMessage>();
file_group.add::<UserMessage>();

// RPC types - params and interface
use logisheets_wasm_server::rpc::WorkbookMethods;
file_group.add_rpc::<WorkbookMethods>();

file_group.gen_files(path, true);
}
3 changes: 3 additions & 0 deletions crates/wasms/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ logisheets-rs = { workspace = true }

xmlserde = { workspace = true }

gents = { workspace = true }
gents_derives = { workspace = true }

[dev-dependencies]
wasm-bindgen-test = "0.3.30"

Expand Down
Loading