diff --git a/.github/workflows/bindings_ci.yml b/.github/workflows/bindings_ci.yml index 658142e17..140bb10b7 100644 --- a/.github/workflows/bindings_ci.yml +++ b/.github/workflows/bindings_ci.yml @@ -113,6 +113,8 @@ jobs: - name: Install Node.js uses: actions/setup-node@v3 + with: + node-version: 18.0 - name: Install NPM dependencies working-directory: ${{ env.MATRIX_SDK_CRYPTO_JS_PATH }} diff --git a/bindings/matrix-sdk-crypto-js/Cargo.toml b/bindings/matrix-sdk-crypto-js/Cargo.toml index 2b91685a9..171dd99ef 100644 --- a/bindings/matrix-sdk-crypto-js/Cargo.toml +++ b/bindings/matrix-sdk-crypto-js/Cargo.toml @@ -1,15 +1,15 @@ [package] -authors = ["Ivan Enderlin "] +name = "matrix-sdk-crypto-js" description = "Matrix encryption library, for JavaScript" +authors = ["Ivan Enderlin "] edition = "2021" homepage = "https://github.com/matrix-org/matrix-rust-sdk" keywords = ["matrix", "chat", "messaging", "ruma", "nio"] license = "Apache-2.0" -name = "matrix-sdk-crypto-js" readme = "README.md" repository = "https://github.com/matrix-org/matrix-rust-sdk" rust-version = "1.60" -version = "0.5.0" +version = "0.1.0-alpha.0" [package.metadata.docs.rs] features = ["docsrs"] diff --git a/bindings/matrix-sdk-crypto-js/cliff.toml b/bindings/matrix-sdk-crypto-js/cliff.toml new file mode 100644 index 000000000..26f33b838 --- /dev/null +++ b/bindings/matrix-sdk-crypto-js/cliff.toml @@ -0,0 +1,61 @@ +# configuration file for git-cliff (0.1.0) + +[changelog] +# changelog header +header = """ +# Matrix SDK Crypto JavaScript Changelog\n +All notable changes to this project will be documented in this file.\n +""" +# template for the changelog body +# https://tera.netlify.app/docs/#introduction +body = """ +{% if version %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ + ## [unreleased] +{% endif %}\ +{% for group, commits in commits | filter(attribute="scope", value="crypto-js") | group_by(attribute="group") %} + ### {{ group | upper_first }} + {% for commit in commits %} + - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\ + {% endfor %} +{% endfor %}\n +""" +# remove the leading and trailing whitespace from the template +trim = true +# changelog footer +footer = """ +""" + +[git] +# parse the commits based on https://www.conventionalcommits.org +conventional_commits = true +# filter out the commits that are not conventional +filter_unconventional = true +# regex for preprocessing the commit messages +commit_preprocessors = [ + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/matrix-org/matrix-rust-sdk/issues/${2}))"}, +] +# regex for parsing and grouping commits +commit_parsers = [ + { message = "^feat", group = "Features"}, + { message = "^fix", group = "Bug Fixes"}, + { message = "^test", group = "Testing"}, + { message = "^doc", group = "Documentation"}, + { message = "^refactor", group = "Refactoring"}, + { message = "^ci", group = "Continuous Integration"}, + { message = "^chore", group = "Miscellaneous Tasks"}, + { body = ".*security", group = "Security"}, +] +# filter out the commits that are not matched by commit parsers +filter_commits = false +# glob pattern for matching git tags +tag_pattern = "v[0-9]*" +# regex for skipping tags +skip_tags = "" +# regex for ignoring tags +ignore_tags = "" +# sort the tags chronologically +date_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "oldest" diff --git a/bindings/matrix-sdk-crypto-js/package.json b/bindings/matrix-sdk-crypto-js/package.json index 45e7d85d2..9fdc08f7d 100644 --- a/bindings/matrix-sdk-crypto-js/package.json +++ b/bindings/matrix-sdk-crypto-js/package.json @@ -1,6 +1,6 @@ { "name": "@matrix-org/matrix-sdk-crypto-js", - "version": "0.5.0", + "version": "0.1.0-alpha.0", "homepage": "https://github.com/matrix-org/matrix-rust-sdk", "description": "Matrix encryption library, for JavaScript", "license": "Apache-2.0", @@ -35,7 +35,7 @@ "node": ">= 10" }, "scripts": { - "build": "cross-env RUSTFLAGS='-C opt-level=z' wasm-pack build --release --target nodejs --out-name matrix_sdk_crypto --out-dir ./pkg", + "build": "cross-env RUSTFLAGS='-C opt-level=z' wasm-pack build --release --target nodejs --scope matrix-org --out-dir ./pkg", "test": "jest --verbose", "doc": "typedoc --tsconfig ." } diff --git a/bindings/matrix-sdk-crypto-js/tests/encryption.test.js b/bindings/matrix-sdk-crypto-js/tests/encryption.test.js index 75374822b..4307deaf3 100644 --- a/bindings/matrix-sdk-crypto-js/tests/encryption.test.js +++ b/bindings/matrix-sdk-crypto-js/tests/encryption.test.js @@ -1,4 +1,4 @@ -const { EncryptionAlgorithm, EncryptionSettings, HistoryVisibility, VerificationState } = require('../pkg/matrix_sdk_crypto'); +const { EncryptionAlgorithm, EncryptionSettings, HistoryVisibility, VerificationState } = require('../pkg/matrix_sdk_crypto_js'); describe('EncryptionAlgorithm', () => { test('has the correct variant values', () => { diff --git a/bindings/matrix-sdk-crypto-js/tests/events.test.js b/bindings/matrix-sdk-crypto-js/tests/events.test.js index b478e5158..75ed2b610 100644 --- a/bindings/matrix-sdk-crypto-js/tests/events.test.js +++ b/bindings/matrix-sdk-crypto-js/tests/events.test.js @@ -1,4 +1,4 @@ -const { HistoryVisibility } = require('../pkg/matrix_sdk_crypto'); +const { HistoryVisibility } = require('../pkg/matrix_sdk_crypto_js'); describe('HistoryVisibility', () => { test('has the correct variant values', () => { diff --git a/bindings/matrix-sdk-crypto-js/tests/identifiers.test.js b/bindings/matrix-sdk-crypto-js/tests/identifiers.test.js index 3c4668f5d..3b72da2ff 100644 --- a/bindings/matrix-sdk-crypto-js/tests/identifiers.test.js +++ b/bindings/matrix-sdk-crypto-js/tests/identifiers.test.js @@ -1,4 +1,4 @@ -const { UserId, DeviceId, RoomId, ServerName } = require('../pkg/matrix_sdk_crypto'); +const { UserId, DeviceId, RoomId, ServerName } = require('../pkg/matrix_sdk_crypto_js'); describe(UserId.name, () => { test('cannot be invalid', () => { diff --git a/bindings/matrix-sdk-crypto-js/tests/machine.test.js b/bindings/matrix-sdk-crypto-js/tests/machine.test.js index dd759f1b8..d4e35641a 100644 --- a/bindings/matrix-sdk-crypto-js/tests/machine.test.js +++ b/bindings/matrix-sdk-crypto-js/tests/machine.test.js @@ -1,4 +1,4 @@ -const { OlmMachine, UserId, DeviceId, RoomId, DeviceLists, RequestType, KeysUploadRequest, KeysQueryRequest, KeysClaimRequest, EncryptionSettings, DecryptedRoomEvent, VerificationState } = require('../pkg/matrix_sdk_crypto'); +const { OlmMachine, UserId, DeviceId, RoomId, DeviceLists, RequestType, KeysUploadRequest, KeysQueryRequest, KeysClaimRequest, EncryptionSettings, DecryptedRoomEvent, VerificationState } = require('../pkg/matrix_sdk_crypto_js'); describe(OlmMachine.name, () => { test('can be instantiated with the async initializer', async () => { diff --git a/bindings/matrix-sdk-crypto-js/tests/requests.test.js b/bindings/matrix-sdk-crypto-js/tests/requests.test.js index b23a2d31e..eb595ccc8 100644 --- a/bindings/matrix-sdk-crypto-js/tests/requests.test.js +++ b/bindings/matrix-sdk-crypto-js/tests/requests.test.js @@ -1,4 +1,4 @@ -const { RequestType, KeysUploadRequest, KeysQueryRequest, KeysClaimRequest, ToDeviceRequest, SignatureUploadRequest, RoomMessageRequest, KeysBackupRequest } = require('../pkg/matrix_sdk_crypto'); +const { RequestType, KeysUploadRequest, KeysQueryRequest, KeysClaimRequest, ToDeviceRequest, SignatureUploadRequest, RoomMessageRequest, KeysBackupRequest } = require('../pkg/matrix_sdk_crypto_js'); describe('RequestType', () => { test('has the correct variant values', () => { diff --git a/bindings/matrix-sdk-crypto-js/tests/sync_events.test.js b/bindings/matrix-sdk-crypto-js/tests/sync_events.test.js index 0322d1317..305d22556 100644 --- a/bindings/matrix-sdk-crypto-js/tests/sync_events.test.js +++ b/bindings/matrix-sdk-crypto-js/tests/sync_events.test.js @@ -1,4 +1,4 @@ -const { DeviceLists, UserId } = require('../pkg/matrix_sdk_crypto'); +const { DeviceLists, UserId } = require('../pkg/matrix_sdk_crypto_js'); describe(DeviceLists.name, () => { test('can be empty', () => { diff --git a/bindings/matrix-sdk-crypto-js/tests/tracing.test.js b/bindings/matrix-sdk-crypto-js/tests/tracing.test.js index bf27431ee..ecb7276f9 100644 --- a/bindings/matrix-sdk-crypto-js/tests/tracing.test.js +++ b/bindings/matrix-sdk-crypto-js/tests/tracing.test.js @@ -1,4 +1,4 @@ -const { Tracing, LoggerLevel, OlmMachine, UserId, DeviceId } = require('../pkg/matrix_sdk_crypto'); +const { Tracing, LoggerLevel, OlmMachine, UserId, DeviceId } = require('../pkg/matrix_sdk_crypto_js'); describe('LoggerLevel', () => { test('has the correct variant values', () => { diff --git a/bindings/matrix-sdk-crypto-js/tsconfig.json b/bindings/matrix-sdk-crypto-js/tsconfig.json index 0f9ea102a..cca9bfa19 100644 --- a/bindings/matrix-sdk-crypto-js/tsconfig.json +++ b/bindings/matrix-sdk-crypto-js/tsconfig.json @@ -3,7 +3,7 @@ "strict": true }, "typedocOptions": { - "entryPoints": ["pkg/matrix_sdk_crypto.d.ts"], + "entryPoints": ["pkg/matrix_sdk_crypto_js.d.ts"], "out": "docs", "readme": "README.md", } diff --git a/bindings/matrix-sdk-crypto-nodejs/cliff.toml b/bindings/matrix-sdk-crypto-nodejs/cliff.toml index e9fb2cf3b..f2c005219 100644 --- a/bindings/matrix-sdk-crypto-nodejs/cliff.toml +++ b/bindings/matrix-sdk-crypto-nodejs/cliff.toml @@ -40,9 +40,11 @@ commit_preprocessors = [ commit_parsers = [ { message = "^feat", group = "Features"}, { message = "^fix", group = "Bug Fixes"}, - { message = "^doc", group = "Documentation"}, - { message = "^perf", group = "Performance"}, { message = "^test", group = "Testing"}, + { message = "^doc", group = "Documentation"}, + { message = "^refactor", group = "Refactoring"}, + { message = "^ci", group = "Continuous Integration"}, + { message = "^chore", group = "Miscellaneous Tasks"}, { body = ".*security", group = "Security"}, ] # filter out the commits that are not matched by commit parsers