Skip to content

Commit

Permalink
Add CJS compatibility (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsmedley authored Jan 2, 2024
1 parent aa17d9d commit f83a351
Show file tree
Hide file tree
Showing 11 changed files with 3,800 additions and 3,234 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:

- name: Install and Build 🔧
run: |
npm ci
npm run doc
yarn install --frozen-lockfile
yarn run doc
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn install --frozen-lockfile
- run: yarn run build
- name: Publish package on NPM 📦
run: npm publish --access=public
env:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '20.x'
- run: npm ci
- run: yarn install --frozen-lockfile
- run: yarn run build
- run: node --test --test-concurrency 1
env:
TEST_KEY: ${{ secrets.TEST_S3_KEY }}
Expand Down
3,221 changes: 0 additions & 3,221 deletions package-lock.json

This file was deleted.

17 changes: 14 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
{
"name": "@filebase/sdk",
"version": "1.0.1",
"version": "1.0.2",
"description": "SDK for Interacting with Filebase Services [S3(Buckets, Objects), IPFS(Gateways, Pins) IPNS(Names)]",
"repository": {
"type": "git",
"url": "git+https://github.com/filebase/filebase-sdk.git"
},
"license": "MIT",
"type": "module",
"main": "src/index.js",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"files": [
"dist"
],
"engines": {
"node": ">=16.0.0",
"npm": ">=8.0.0"
},
"scripts": {
"build": "unbuild",
"test": "node --test",
"doc": "jsdoc -c jsdoc.json"
},
Expand All @@ -30,7 +39,9 @@
"devDependencies": {
"clean-jsdoc-theme": "4.2.17",
"jsdoc": "4.0.2",
"prettier": "3.1.0"
"prettier": "3.1.0",
"typescript": "5.3.3",
"unbuild": "2.0.0"
},
"dependencies": {
"@aws-sdk/client-s3": "3.478.0",
Expand Down
3 changes: 1 addition & 2 deletions test/bucketManager.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import test from "node:test";
import assert from "node:assert/strict";
import BucketManager from "../src/bucketManager.js";
import GatewayManager from "../src/gatewayManager.js";
import { BucketManager } from "../dist/index.mjs";

const TEST_PREFIX = Date.now();

Expand Down
2 changes: 1 addition & 1 deletion test/gatewayManager.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test } from "node:test";
import assert from "node:assert/strict";
import GatewayManager from "../src/gatewayManager.js";
import { GatewayManager } from "../dist/index.mjs";

const TEST_PREFIX = Date.now();

Expand Down
2 changes: 1 addition & 1 deletion test/nameManager.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test } from "node:test";
import assert from "node:assert/strict";
import NameManager from "../src/nameManager.js";
import { NameManager } from "../dist/index.mjs";

const TEST_CID = process.env.TEST_NAME_CID,
TEST_PRIVATE_KEY = process.env.TEST_NAME_PRIVATE_KEY,
Expand Down
3 changes: 1 addition & 2 deletions test/objectManager.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { test } from "node:test";
import assert from "node:assert/strict";
import ObjectManager from "../src/objectManager.js";
import BucketManager from "../src/bucketManager.js";
import { ObjectManager, BucketManager } from "../dist/index.mjs";
import * as Path from "node:path";
import { writeFile } from "node:fs/promises";
import { v4 as uuidv4 } from "uuid";
Expand Down
2 changes: 1 addition & 1 deletion test/pinManager.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { v4 as uuidv4 } from "uuid";
import Path from "node:path";
import os from "node:os";
import { writeFile } from "node:fs/promises";
import BucketManager from "../src/bucketManager.js";
import { BucketManager } from "../dist/index.mjs";

const TEST_CID_1 = "QmSEu6zGwKgkQA3ZKaDnvkrwre1kkQa7eRFCbQi7waNwTT",
TEST_CID_2 = "QmNXcMdXadLRTxLpHJMsGnaeKz26d2F6NgUDVWScp54EfC",
Expand Down
Loading

0 comments on commit f83a351

Please sign in to comment.