Merge branch 'fix-publish' into 'development'
Attempted fix for publishing See merge request GeneralProtocols/xo/stack!12
This commit is contained in:
+7
-11
@@ -1,6 +1,7 @@
|
||||
image: node:22
|
||||
|
||||
stages:
|
||||
- test
|
||||
- publish
|
||||
|
||||
cache:
|
||||
@@ -18,29 +19,24 @@ before_script:
|
||||
- npm install
|
||||
- npm run build
|
||||
|
||||
.publish_to_npm:
|
||||
# Configure which stage in the pipeline this part should be run in.
|
||||
stage: publish
|
||||
|
||||
test:
|
||||
stage: test
|
||||
script:
|
||||
- npm config set //registry.npmjs.org/:_authToken ${NPM_AUTH_TOKEN}
|
||||
- npx lerna publish from-package --no-private --yes --registry https://registry.npmjs.org/ --tag ${NPM_TAG}
|
||||
- npm run test
|
||||
|
||||
publish:development:
|
||||
# Configure what tag to use for this publication.
|
||||
variables:
|
||||
NPM_TAG: 'development'
|
||||
|
||||
script:
|
||||
# add the NPM_TAG to the version field in the package file during this script
|
||||
- sed -i -r "/version/s/([0-9\.]+)/\1-${NPM_TAG}.${CI_JOB_ID}/g" packages/primitives/package.json
|
||||
|
||||
# set our npm token and then use lerna to publish all packages that are not marked as "private".
|
||||
- npm config set //registry.npmjs.org/:_authToken ${NPM_AUTH_TOKEN}
|
||||
- npx lerna publish from-package --no-private --yes --registry https://registry.npmjs.org/ --tag ${NPM_TAG}
|
||||
only:
|
||||
- development
|
||||
|
||||
# Use the common template to publish the library.
|
||||
extends: .publish_to_npm
|
||||
|
||||
# Publish the documentation to GitLab Pages (for now).
|
||||
pages:
|
||||
stage: publish
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
{
|
||||
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
|
||||
"packages": [
|
||||
"packages/*"
|
||||
],
|
||||
"packages": ["packages/*"],
|
||||
"version": "0.0.1"
|
||||
}
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
</script>
|
||||
|
||||
<!-- Resume Markdown parsing -->
|
||||
|
||||
TODO: Once we have other tools, we might want to turn this into a page like that on Quick Start that presents a "box" of each Tool Group.
|
||||
|
||||
@@ -24,6 +24,7 @@ import {
|
||||
# Primitive Tools
|
||||
|
||||
## Address
|
||||
|
||||
<div class="tool">
|
||||
<p>A Utility tool for converting between different address formats.</p>
|
||||
|
||||
@@ -31,9 +32,11 @@ import {
|
||||
:fromFunctions="address.from"
|
||||
:toFunctions="address.to"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
## Block Header
|
||||
|
||||
<div class="tool">
|
||||
<p>A utility tool for converting between different byte representations.</p>
|
||||
|
||||
@@ -41,9 +44,11 @@ import {
|
||||
:fromFunctions="blockHeader.from"
|
||||
:toFunctions="blockHeader.to"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
## Bytes
|
||||
|
||||
<div class="tool">
|
||||
<p>A utility tool for converting between different byte representations.</p>
|
||||
|
||||
@@ -54,6 +59,7 @@ import {
|
||||
</div>
|
||||
|
||||
## Hasher
|
||||
|
||||
<div class="tool">
|
||||
<p>A utility tool for computing various cryptographic hashes commonly used in Bitcoin Cash.</p>
|
||||
|
||||
@@ -61,9 +67,11 @@ import {
|
||||
:fromFunctions="hasher.from"
|
||||
:toFunctions="hasher.to"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
## HD Private Node
|
||||
|
||||
<div class="tool">
|
||||
<p>A utility tool for generating and manipulating HD Private Nodes.</p>
|
||||
|
||||
@@ -71,9 +79,11 @@ import {
|
||||
:fromFunctions="hdPrivateNode.from"
|
||||
:toFunctions="hdPrivateNode.to"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
## HD Public Node
|
||||
|
||||
<div class="tool">
|
||||
<p>A utility tool for generating and manipulating HD Public Nodes.</p>
|
||||
|
||||
@@ -81,9 +91,11 @@ import {
|
||||
:fromFunctions="hdPublicNode.from"
|
||||
:toFunctions="hdPublicNode.to"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
## Mnemonic
|
||||
|
||||
<div class="tool">
|
||||
<p>A utility tool for generating and validating BIP39 Mnemonics. Note that mnemonics will be normalized by removing redundant whitespace and will also be validated against the BIP39 English Word List (other word-lists can be specified via the API)</p>
|
||||
|
||||
@@ -91,9 +103,11 @@ import {
|
||||
:fromFunctions="mnemonic.from"
|
||||
:toFunctions="mnemonic.to"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
## Private Key
|
||||
|
||||
<div class="tool">
|
||||
<p>A utility tool for generating and manipulating Private Keys.</p>
|
||||
|
||||
@@ -102,9 +116,11 @@ import {
|
||||
:toFunctions="privateKey.to"
|
||||
:methods="privateKey.methods"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
## Public Key
|
||||
|
||||
<div class="tool">
|
||||
<p>A utility tool for generating and manipulating Public Keys.</p>
|
||||
|
||||
@@ -113,9 +129,11 @@ import {
|
||||
:toFunctions="publicKey.to"
|
||||
:methods="publicKey.methods"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
## Satoshis
|
||||
|
||||
<div class="tool">
|
||||
<p>A utility tool for converting between Bitcoin Cash value units.</p>
|
||||
|
||||
@@ -123,9 +141,11 @@ import {
|
||||
:fromFunctions="satoshis.from"
|
||||
:toFunctions="satoshis.to"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
## Script
|
||||
|
||||
<div class="tool">
|
||||
<p>A utility tool for generating and manipulating Script objects.</p>
|
||||
|
||||
@@ -133,9 +153,11 @@ import {
|
||||
:fromFunctions="script.from"
|
||||
:toFunctions="script.to"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
## Transaction
|
||||
|
||||
<div class="tool">
|
||||
<p>A utility tool for generating and manipulating Transaction objects.</p>
|
||||
|
||||
@@ -143,4 +165,5 @@ import {
|
||||
:fromFunctions="transaction.from"
|
||||
:toFunctions="transaction.to"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
# Utils
|
||||
|
||||
## Encryption
|
||||
|
||||
<div class="tool">
|
||||
<p>A Utility tool for converting between different address formats.</p>
|
||||
|
||||
@@ -20,4 +21,5 @@ import {
|
||||
:toFunctions="encryption.to"
|
||||
:methods="encryption.methods"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
"scripts": {
|
||||
"build": "tsc --build --clean && tsc --build",
|
||||
"prepublishOnly": "npm run build",
|
||||
"test": "vitest",
|
||||
"test": "vitest --run",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"test:watch": "vitest",
|
||||
"watch": "tsc --watch"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
"license": "ISC",
|
||||
"gitHead": "2d550cef4b179b17110363512ee0fde54a5da79a"
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
export type MnemonicRaw = {
|
||||
words: string[];
|
||||
passphrase?: string;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Class representing a BIP39 Mnemonic phrase.
|
||||
@@ -32,7 +32,10 @@ export class Mnemonic {
|
||||
* @throws {Error} If mnemonic could not be generated.
|
||||
* @returns Instance of Mnemonic.
|
||||
*/
|
||||
public static from(phraseOrWords: string | Array<string>, wordList: Array<string> = bip39WordListEnglish) {
|
||||
public static from(
|
||||
phraseOrWords: string | Array<string>,
|
||||
wordList: Array<string> = bip39WordListEnglish,
|
||||
) {
|
||||
// If this is a list of words...
|
||||
if (Array.isArray(phraseOrWords)) {
|
||||
return this.fromWords(phraseOrWords, wordList);
|
||||
@@ -49,7 +52,10 @@ export class Mnemonic {
|
||||
* @throws {Error} If mnemonic could not be generated.
|
||||
* @returns Instance of Mnemonic.
|
||||
*/
|
||||
public static fromString(phrase: string, wordList: Array<string> = bip39WordListEnglish) {
|
||||
public static fromString(
|
||||
phrase: string,
|
||||
wordList: Array<string> = bip39WordListEnglish,
|
||||
) {
|
||||
// Split into words and remove any whitespace.
|
||||
const allWords = phrase
|
||||
.trim()
|
||||
@@ -67,7 +73,10 @@ export class Mnemonic {
|
||||
* @throws {Error} If mnemonic could not be generated.
|
||||
* @returns Instance of Mnemonic.
|
||||
*/
|
||||
public static fromWords(words: Array<string>, wordList: Array<string> = bip39WordListEnglish) {
|
||||
public static fromWords(
|
||||
words: Array<string>,
|
||||
wordList: Array<string> = bip39WordListEnglish,
|
||||
) {
|
||||
// Check if last word is a passphrase by looking at total count
|
||||
const hasPassphrase =
|
||||
words.length === 13 ||
|
||||
@@ -79,10 +88,10 @@ export class Mnemonic {
|
||||
// Parse words and optional passphrase
|
||||
const mnemonicRaw: MnemonicRaw = {
|
||||
words: hasPassphrase ? words.slice(0, -1) : words,
|
||||
}
|
||||
};
|
||||
|
||||
if (hasPassphrase) {
|
||||
mnemonicRaw.passphrase = words[words.length - 1]
|
||||
mnemonicRaw.passphrase = words[words.length - 1];
|
||||
}
|
||||
|
||||
// Validate word count
|
||||
|
||||
@@ -4,16 +4,9 @@
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"paths": {
|
||||
"~/*": [
|
||||
"./*"
|
||||
]
|
||||
"~/*": ["./*"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
||||
@@ -24,8 +24,9 @@
|
||||
"bench": "vitest bench",
|
||||
"build": "tsc --build --clean && tsc --build",
|
||||
"prepublishOnly": "npm run build",
|
||||
"test": "vitest",
|
||||
"test": "vitest --run",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"test:watch": "vitest",
|
||||
"watch": "tsc --watch"
|
||||
},
|
||||
"author": "",
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { BaseStorage, BaseStore, StorageOpts } from './base-store.js';
|
||||
import { StoreInMemorySynced } from './store-inmemory-synced.js';
|
||||
|
||||
import {
|
||||
Encryption,
|
||||
} from '../utils';
|
||||
import { Encryption } from '../utils';
|
||||
|
||||
import {
|
||||
encodeExtendedJsonObject,
|
||||
|
||||
@@ -4,19 +4,10 @@
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"paths": {
|
||||
"~/*": [
|
||||
"./*"
|
||||
]
|
||||
"~/*": ["./*"]
|
||||
},
|
||||
"lib": [
|
||||
"dom"
|
||||
]
|
||||
"lib": ["dom"]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user