Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit 9e2dd39

Browse files
authored
feat(marine-js): Switch MarineJS package From CJS to ESM format (#265)
1 parent 62b7068 commit 9e2dd39

File tree

11 files changed

+5618
-12452
lines changed

11 files changed

+5618
-12452
lines changed

.github/workflows/snapshot.yml

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -55,68 +55,68 @@ jobs:
5555
with:
5656
id: ${{ steps.version.outputs.id }}
5757

58-
# publish-marine-js:
59-
# name: "Publish @fluencelabs/marine-js snapshot"
60-
# runs-on: builder
61-
# timemout-minutes: 60
62-
63-
# outputs:
64-
# version: "${{ steps.snapshot.outputs.version }}"
65-
66-
# permissions:
67-
# contents: read
68-
# id-token: write
69-
70-
# steps:
71-
# - name: Checkout Marine
72-
# uses: actions/checkout@v3
73-
# with:
74-
# repository: fluencelabs/marine
75-
76-
# - name: Import secrets
77-
# uses: hashicorp/[email protected]
78-
# with:
79-
# url: https://vault.fluence.dev
80-
# path: jwt/github
81-
# role: ci
82-
# method: jwt
83-
# jwtGithubAudience: "https://github.com/fluencelabs"
84-
# jwtTtl: 300
85-
# exportToken: false
86-
# secrets: |
87-
# kv/npm-registry/basicauth/ci token | NODE_AUTH_TOKEN
88-
89-
# - name: Setup Rust toolchain
90-
# uses: actions-rust-lang/setup-rust-toolchain@v1
91-
92-
# - name: Setup wasm-pack
93-
# uses: jetli/[email protected]
94-
95-
# - name: Setup node with self-hosted npm registry
96-
# uses: actions/setup-node@v3
97-
# with:
98-
# node-version: "16"
99-
# registry-url: "https://npm.fluence.dev"
100-
101-
# - name: Build with wasm-pack
102-
# run: ./build.sh
103-
# working-directory: marine-js
104-
105-
# - name: Run npm install
106-
# working-directory: marine-js/npm-package
107-
# run: npm i
108-
109-
# - name: Run npm build
110-
# working-directory: marine-js/npm-package
111-
# run: npm run build
112-
113-
# - name: Generate snapshot version
114-
# id: version
115-
# uses: fluencelabs/github-actions/generate-snapshot-id@main
116-
117-
# - name: Publish snapshot
118-
# id: snapshot
119-
# uses: fluencelabs/github-actions/npm-publish-snapshot@main
120-
# with:
121-
# working-directory: marine-js/npm-package
122-
# id: ${{ steps.version.outputs.id }}
58+
publish-marine-js:
59+
name: "Publish marine-js snapshot"
60+
runs-on: builder
61+
timeout-minutes: 60
62+
63+
outputs:
64+
version: "${{ steps.snapshot.outputs.version }}"
65+
66+
permissions:
67+
contents: read
68+
id-token: write
69+
70+
steps:
71+
- name: Checkout Marine
72+
uses: actions/checkout@v3
73+
with:
74+
repository: fluencelabs/marine
75+
76+
- name: Import secrets
77+
uses: hashicorp/[email protected]
78+
with:
79+
url: https://vault.fluence.dev
80+
path: jwt/github
81+
role: ci
82+
method: jwt
83+
jwtGithubAudience: "https://github.com/fluencelabs"
84+
jwtTtl: 300
85+
exportToken: false
86+
secrets: |
87+
kv/npm-registry/basicauth/ci token | NODE_AUTH_TOKEN
88+
89+
- name: Setup Rust toolchain
90+
uses: actions-rust-lang/setup-rust-toolchain@v1
91+
92+
- name: Setup wasm-pack
93+
uses: jetli/[email protected]
94+
95+
- name: Setup node with self-hosted npm registry
96+
uses: actions/setup-node@v3
97+
with:
98+
node-version: "16"
99+
registry-url: "https://npm.fluence.dev"
100+
101+
- name: Build with wasm-pack
102+
run: ./build.sh
103+
working-directory: marine-js
104+
105+
- name: Run npm install
106+
working-directory: marine-js/npm-package
107+
run: npm i
108+
109+
- name: Run npm build
110+
working-directory: marine-js/npm-package
111+
run: npm run build
112+
113+
- name: Generate snapshot version
114+
id: version
115+
uses: fluencelabs/github-actions/generate-snapshot-id@main
116+
117+
- name: Publish snapshot
118+
id: snapshot
119+
uses: fluencelabs/github-actions/npm-publish-snapshot@main
120+
with:
121+
working-directory: marine-js/npm-package
122+
id: ${{ steps.version.outputs.id }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
extensionsToTreatAsEsm: ['.ts'],
4+
moduleNameMapper: {
5+
'^(\\.{1,2}/.*)\\.js$': '$1',
6+
},
7+
testPathIgnorePatterns: ['dist'],
8+
transform: {
9+
'^.+\\.tsx?$': [
10+
'ts-jest',
11+
{
12+
useESM: true,
13+
},
14+
],
15+
},
16+
};

marine-js/npm-package/jest.config.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)