Skip to content

Commit

Permalink
fix(ori): exported functions name should be identical with previous v…
Browse files Browse the repository at this point in the history
…ersion
  • Loading branch information
Brooooooklyn committed Sep 2, 2022
1 parent 3672839 commit 50d4af9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 23 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion packages/ori/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ crate-type = ["cdylib", "lib"]
[dependencies]
anyhow = "1"
napi = {version = "2", features = ["serde-json"]}
napi-derive = {version = "2", default-features = false}
napi-derive = {version = "2", default-features = false, features = ["type-def"]}
rayon = "1.5.0"
regex = "1"
serde = {version = "1.0", features = ["derive"]}
Expand Down
27 changes: 9 additions & 18 deletions packages/ori/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
/*
Copyright 2022 ByteDance and/or its affiliates.
/* tslint:disable */
/* eslint-disable */

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
/* auto-generated by NAPI-RS */

http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

declare module '@perfsee/ori' {
export function analyseProfile(profilePath: string, bundleMetaPath: string, debugMode?: boolean): Promise<string>
export function generateDocs(): Record<string, string>
}
export function analyseProfile(
profilePath: string,
bundleMetaPath: string,
debugMode?: boolean | undefined | null,
): Promise<string>
export function generateDocs(): Record<string, string>
4 changes: 2 additions & 2 deletions packages/ori/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"main": "./index.node",
"typings": "./index.d.ts",
"scripts": {
"build:rs": "napi build --release",
"debug:rs": "napi build"
"build:rs": "napi build --release --js false",
"debug:rs": "napi build --js false"
},
"devDependencies": {
"@napi-rs/cli": "^2.11.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/ori/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl Task for AnalyzeTask {
}

#[napi(strict)]
pub fn analyse(
pub fn analyse_profile(
profile_path: String,
bundle_meta_path: String,
debug_mode: Option<bool>,
Expand All @@ -116,7 +116,7 @@ pub fn analyse(
}

#[napi]
pub fn gen_docs() -> HashMap<&'static str, &'static str> {
pub fn generate_docs() -> HashMap<&'static str, &'static str> {
let rules = get_all_rules();

rules
Expand Down

0 comments on commit 50d4af9

Please sign in to comment.