Skip to content

Commit

Permalink
Publishing v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
d0rianb committed Sep 16, 2024
1 parent 4102d24 commit 50e0d2f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "rtf-parser"
description = "A Rust RTF parser & lexer library designed for speed and memory efficiency."
repository = "https://github.com/d0rianb/rtf-parser"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
license = "MIT"
keywords = ["rtf", "rich", "text", "format", "parser"]
Expand Down
2 changes: 2 additions & 0 deletions build_wasm.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/bin/bash

#cargo build --target web -- --features serde
wasm-pack build --release --target web -- --features serde
26 changes: 26 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# Check if Cargo.toml exist in this directory
if [ ! -f Cargo.toml ]; then
echo "Cargo.toml doesn't exist in this directory"
exit 1
fi

version=$(grep '^version =' Cargo.toml | cut -d '"' -f 2)

echo "Publishing rtf-parser v$version"
echo "Build WASM released module"
./build_wasm.sh

#echo "Commiting the last changes"
git add .
git commit -m "Publishing v$version"
git push origin master

echo "Publish to NPM"
# Rename from 'rtf-parser' to 'rtf-parser-wasm' for NPM
sed -i '' 's/"name": "[^"]*"/"name": "rtf-parser-wasm"/' pkg/package.json
wasm-pack publish

echo "Publish to Cargo"
cargo publish
4 changes: 2 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::collections::HashMap;
use std::{fmt, mem};

use derivative::Derivative;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
#[cfg(target_arch = "wasm32")]

use derivative::Derivative;
use wasm_bindgen::prelude::wasm_bindgen;

use crate::document::RtfDocument;
Expand Down

0 comments on commit 50e0d2f

Please sign in to comment.