Skip to content

Commit

Permalink
Merge pull request #22 from project-kardeshev/alpha
Browse files Browse the repository at this point in the history
fix(docs): update docs fixes
  • Loading branch information
atticusofsparta authored Oct 25, 2024
2 parents bbc2d14 + fc64241 commit 3fd1efb
Show file tree
Hide file tree
Showing 11 changed files with 328 additions and 934 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ node_modules
dist
dist-ssr
*.local
# permaweb deploy output garbage
dist-errors.txt
dist-id.txt
dist-manifest.json
dist-csv.json
dist-manifest.csv

# Editor directories and files
.idea
Expand Down
36 changes: 36 additions & 0 deletions .storybook/YourTheme.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { create } from '@storybook/theming';

export default create({
base: 'dark',
brandTitle: 'AO Wallet Kit',
brandUrl: 'https://ao-wallet-kit_project-kardeshev.arweave.net',
brandImage: 'https://arweave.net/oDSg_8Qmy8nHOgtS_77cxFTq3oytZ7TBbu0ntGv3Xas',
brandTarget: '_self',

//
colorPrimary: '#1CA051',
colorSecondary: '#6CC790',

// UI
appBg: '#1f1f1f',
appContentBg: '#1f1f1f',
appPreviewBg: '#1f1f1f',
appBorderColor: '#585C6D',
appBorderRadius: 4,

// Text colors
textColor: '#1CA051',
textInverseColor: '#6CC790',

// Toolbar default and active colors
barTextColor: '#9E9E9E',
barSelectedColor: '#585C6D',
barHoverColor: '#585C6D',
barBg: '#1f1f1f',

// Form colors
inputBg: '#1f1f1f',
inputBorder: '#6CC790',
inputTextColor: '#6CC790',
inputBorderRadius: 2,
});
12 changes: 7 additions & 5 deletions .storybook/main.cjs → .storybook/main.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module.exports = {
stories: [
'../src/**/*.stories.@(js|jsx|ts|tsx|mdx)',
'../docs/**/*.stories.@(js|jsx|mjs|ts|tsx|mdx|svelte)',
],
export default {
stories: [
"../docs/**/*.mdx",
"../docs/**/*.stories.@(js|jsx|mjs|ts|tsx|svelte)",
"../src/**/*.mdx",
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx|svelte)",
],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
Expand Down
6 changes: 6 additions & 0 deletions .storybook/manager.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { addons } from '@storybook/manager-api';
import { themes } from '@storybook/theming';

addons.setConfig({
theme: themes.dark,
});
4 changes: 4 additions & 0 deletions .storybook/preview.cjs → .storybook/preview.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import YourTheme from "./YourTheme.mjs";
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
docs: {
theme: YourTheme,
},
controls: {
matchers: {
color: /(background|color)$/i,
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [1.0.1](https://github.com/project-kardeshev/ao-wallet-kit/compare/v1.0.0...v1.0.1) (2024-10-25)
## [1.0.1-alpha.1](https://github.com/project-kardeshev/ao-wallet-kit/compare/v1.0.0...v1.0.1-alpha.1) (2024-10-25)


### Bug Fixes
Expand All @@ -7,6 +7,7 @@
* **action:** remove concurrency from publish ([f20c3d4](https://github.com/project-kardeshev/ao-wallet-kit/commit/f20c3d40069a4efe8f9499bb6eede538bedd6a70))
* **actions:** update actions to inherits secrets ([2c1017e](https://github.com/project-kardeshev/ao-wallet-kit/commit/2c1017e14e998c8d045bfae5dea45473b18dfda7))
* **build:** update build config ([12652af](https://github.com/project-kardeshev/ao-wallet-kit/commit/12652af731fe0394b3f5ea812e9f4ab132545fd4))
* **docs:** add tool for deploying docs ([f8561cd](https://github.com/project-kardeshev/ao-wallet-kit/commit/f8561cde8527787ddfeed48fc96d3e83f454524f))
* **node v:** bump node version to 20 ([c41545f](https://github.com/project-kardeshev/ao-wallet-kit/commit/c41545fac14f48cc89597a6a01308c802a490e04))
* **precommit:** update precommit action ([7a654f6](https://github.com/project-kardeshev/ao-wallet-kit/commit/7a654f69da2d46e7ba416cd5d7812ba51f22d033))
* **prettier:** update lint staged prettier command ([f3de73b](https://github.com/project-kardeshev/ao-wallet-kit/commit/f3de73b589d62b86d09c51af154412e2cace8d9b))
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@project-kardeshev/ao-wallet-kit",
"private": false,
"version": "1.0.1",
"version": "1.0.1-alpha.1",
"repository": {
"type": "git",
"url": "git+https://github.com/project-kardeshev/ao-wallet-kit.git"
Expand Down Expand Up @@ -46,8 +46,8 @@
"build": "vite build",
"storybook": "storybook dev -p 6006",
"build-storybook": "yarn build-docs && storybook build",
"build-docs": "typedoc",
"publish-docs": "yarn build-storybook && permaweb-deploy --ant-process $DEPLOY_ANT_PROCESS_ID --undername ao-wallet-kit --deploy-folder storybook-static",
"build-docs": "typedoc && node tools/fix-mdx-readme.mjs",
"publish-docs": "node tools/deploy-docs.mjs",
"serve-docs": "http-server storybook-static --port 8080",
"test": "echo \"Warning: no test specified\"",
"format": "prettier . --write",
Expand Down Expand Up @@ -122,12 +122,13 @@
"lint-staged": "^15.2.10",
"markdown-toc-gen": "^1.0.1",
"node-stdlib-browser": "^1.2.1",
"permaweb-deploy": "1.1.5",
"permaweb-deploy": "^1.1.8",
"prettier": "^2.8.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup-plugin-preserve-directives": "^0.2.0",
"semantic-release": "^21.0.7",
"starknet": "^6.11.0",
"storybook": "^7.0.22",
"typedoc": "0.25.0",
"typescript": "^4.9.3",
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// AUTO GENERATED NO TOUCHY!
export const version = '1.0.1';
export const version = '1.0.1-alpha.1';
36 changes: 36 additions & 0 deletions tools/deploy-docs.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { exec } from 'node:child_process';
import fs from 'node:fs';
import path from 'node:path';

const __dirname = path.dirname(new URL(import.meta.url).pathname);

const wallet =
process.env.DEPLOY_KEY ??
fs.readFileSync(path.join(__dirname, 'wallet.json'), 'utf-8').trim();
const b64EncodedWallet =
process.env.DEPLOY_KEY ?? Buffer.from(wallet).toString('base64');

async function main() {
const deployProcess = exec(
`yarn build-storybook && permaweb-deploy --ant-process $DEPLOY_ANT_PROCESS_ID --undername ao-wallet-kit --deploy-folder $DEPLOY_DIR`,
{
env: {
...process.env,
DEPLOY_KEY: b64EncodedWallet,
DEPLOY_ANT_PROCESS_ID: 'wJVTnZTedI9FIY4r2cB9C4CpAJKImvhu0WjOh0AecjQ',
DEPLOY_DIR: path.join(__dirname, '..', 'storybook-static'),
GITHUB_SHA: process.env.GITHUB_SHA ?? 'local',
},
},
);

deployProcess.stdout.pipe(process.stdout);
deployProcess.stderr.pipe(process.stderr);
deployProcess.on('exit', (code) => {
if (code !== 0) {
process.exit(code);
}
});
}

main().catch(console.error);
31 changes: 31 additions & 0 deletions tools/fix-mdx-readme.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import fs from 'node:fs';
import path from 'node:path';

const __dirname = path.dirname(new URL(import.meta.url).pathname);

/**
* Function to remove content between <!-- toc --> and <!-- tocstop -->
* @param {string} filePath - The path to the file to be modified.
*/
function removeTOC(filePath) {
try {
// Read the file content
const content = fs.readFileSync(filePath, 'utf8');

// Use a regex to remove the content between <!-- toc --> and <!-- tocstop -->
const updatedContent = content.replace(
/<!-- toc -->[\s\S]*?<!-- tocstop -->/g,
'',
);

// Write the updated content back to the file
fs.writeFileSync(filePath, updatedContent, 'utf8');
console.log(`TOC removed from ${filePath}`);
} catch (error) {
console.error(`Error processing the file: ${error.message}`);
}
}

// Example usage
const filePath = path.join(__dirname, '../docs/README.mdx');
removeTOC(filePath);
Loading

0 comments on commit 3fd1efb

Please sign in to comment.