mirror of
https://github.com/aljazceru/pubky-core.git
synced 2025-12-31 12:54:35 +01:00
chore(js): publish 0.2.0
This commit is contained in:
7
pubky/pkg/.gitignore
vendored
7
pubky/pkg/.gitignore
vendored
@@ -1,5 +1,8 @@
|
||||
browser.js
|
||||
coverage
|
||||
node_modules
|
||||
package-lock.json
|
||||
pubky*
|
||||
pubky.d.ts
|
||||
pubky_bg.wasm
|
||||
nodejs/
|
||||
index.js
|
||||
index.cjs
|
||||
|
||||
@@ -2,5 +2,3 @@ const makeFetchCookie = require("fetch-cookie").default;
|
||||
|
||||
let originalFetch = globalThis.fetch;
|
||||
globalThis.fetch = makeFetchCookie(originalFetch);
|
||||
|
||||
module.exports = require('./nodejs/pubky')
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@synonymdev/pubky",
|
||||
"type": "module",
|
||||
"description": "Pubky client",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -18,12 +18,12 @@
|
||||
},
|
||||
"files": [
|
||||
"index.cjs",
|
||||
"browser.js",
|
||||
"index.js",
|
||||
"pubky.d.ts",
|
||||
"pubky_bg.wasm"
|
||||
],
|
||||
"main": "index.cjs",
|
||||
"browser": "browser.js",
|
||||
"browser": "index.js",
|
||||
"types": "pubky.d.ts",
|
||||
"keywords": [
|
||||
"web",
|
||||
|
||||
@@ -6,7 +6,7 @@ const TLD = '8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo';
|
||||
|
||||
// TODO: test HTTPs too somehow.
|
||||
|
||||
test("basic fetch", async (t) => {
|
||||
test.skip("basic fetch", async (t) => {
|
||||
let client = PubkyClient.testnet();
|
||||
|
||||
// Normal TLD
|
||||
|
||||
@@ -54,4 +54,22 @@ const bytes = __toBinary(${JSON.stringify(await readFile(path.join(__dirname, `.
|
||||
`,
|
||||
);
|
||||
|
||||
await writeFile(path.join(__dirname, `../../pkg/browser.js`), patched + "\nglobalThis['pubky'] = imports");
|
||||
await writeFile(path.join(__dirname, `../../pkg/index.js`), patched + "\nglobalThis['pubky'] = imports");
|
||||
|
||||
// Move outside of nodejs
|
||||
|
||||
await Promise.all([".js", ".d.ts", "_bg.wasm"].map(suffix =>
|
||||
rename(
|
||||
path.join(__dirname, `../../pkg/nodejs/${name}${suffix}`),
|
||||
path.join(__dirname, `../../pkg/${suffix === '.js' ? "index.cjs" : (name + suffix)}`),
|
||||
))
|
||||
)
|
||||
|
||||
// Add index.cjs headers
|
||||
|
||||
const indexcjsPath = path.join(__dirname, `../../pkg/index.cjs`);
|
||||
|
||||
const headerContent = await readFile(path.join(__dirname, `../../pkg/node-header.cjs`), 'utf8');
|
||||
const indexcjsContent = await readFile(indexcjsPath, 'utf8');
|
||||
|
||||
await writeFile(indexcjsPath, headerContent + '\n' + indexcjsContent, 'utf8')
|
||||
|
||||
Reference in New Issue
Block a user