Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: remove redux-bundler, full typescript #448

Merged
merged 52 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
83582cd
feat: convert to typescript and remove redux-bundler
SgtPooki Sep 24, 2024
f4c26a4
feat: fetching is working
SgtPooki Sep 24, 2024
3bf260b
fix: build is working
SgtPooki Sep 24, 2024
42922f1
test: fix findLinkPath tests
SgtPooki Sep 25, 2024
0e9f910
test: fixing unit tests
SgtPooki Sep 25, 2024
0c9fb92
fix: navigating through a dag works again
SgtPooki Sep 25, 2024
f639227
chore: remove tests that will come from #449
SgtPooki Sep 25, 2024
500b95b
Merge branch 'master' into feat/overhaul
SgtPooki Sep 25, 2024
4aa2c13
fix: builds and passes tests
SgtPooki Sep 25, 2024
a4c1aee
fix: storybook and types
SgtPooki Sep 25, 2024
7799826
fix: deep-link to an explore view
SgtPooki Sep 25, 2024
27e6a34
chore: pin storybook, remove viteFinal config
SgtPooki Sep 25, 2024
f0bfe42
chore: add package-lock.json to attempt to fix CI
SgtPooki Sep 26, 2024
faec1df
test: typed storybook default exports
SgtPooki Sep 26, 2024
44c1628
chore: update storybook
SgtPooki Sep 26, 2024
836725f
chore: migrate storybook stories to tsx
SgtPooki Sep 26, 2024
4a33dad
chore: update aegir
SgtPooki Sep 26, 2024
3e50d9d
fix: cid stories and rendering shortest cids
SgtPooki Oct 10, 2024
efbbe38
fix: storybook dev auto-reload
SgtPooki Oct 10, 2024
9492f93
fix: graphcrumb stories
SgtPooki Oct 10, 2024
add7eb8
fix: aegir build is consumable by explore.ipld.io
SgtPooki Oct 11, 2024
4a16c14
feat: importable by explore.ipld.io
SgtPooki Oct 16, 2024
63ebc63
chore: externalizing more deps
SgtPooki Oct 16, 2024
9ce7c45
chore: remove unnecessary build plugins
SgtPooki Oct 16, 2024
c186de4
chore: update and move react-helmet to deps
SgtPooki Oct 16, 2024
4cdf5a6
chore: cleanup unused storybook deps
SgtPooki Oct 16, 2024
8952a9e
chore: remove rollup direct dev dependency
SgtPooki Oct 16, 2024
0c81590
chore: remove babel
SgtPooki Oct 16, 2024
e894539
chore: add react-hooks eslint plugin
SgtPooki Oct 16, 2024
0d3f6b2
chore: update Helia deps
SgtPooki Oct 16, 2024
561c2b9
chore: update eslint plugins
SgtPooki Oct 16, 2024
01a8fe7
chore: update aegir
SgtPooki Oct 16, 2024
ab4f11e
chore: update @types deps
SgtPooki Oct 16, 2024
db8e184
chore: update filesize
SgtPooki Oct 16, 2024
86c2e1f
chore: update ipld libs
SgtPooki Oct 16, 2024
8bfa5c7
chore: update multiformats
SgtPooki Oct 16, 2024
bdeede6
chore: update vite
SgtPooki Oct 16, 2024
6f06956
chore: update storybook deps
SgtPooki Oct 16, 2024
c1bb610
chore: remove @rollup/plugin-node-resolve
SgtPooki Oct 16, 2024
b85dfd7
chore: update testing deps and react
SgtPooki Oct 16, 2024
9a9159b
chore: update react peer deps
SgtPooki Oct 16, 2024
8b8af56
chore: update the last of the deps
SgtPooki Oct 16, 2024
b251394
feat: new links-table without react-virtualized
SgtPooki Oct 17, 2024
86bfcc0
fix: fixing up some issues with new links table
SgtPooki Oct 17, 2024
6f03e3a
fix: links-table uses grid instead of flex
SgtPooki Oct 17, 2024
e48314f
feat: new links table
SgtPooki Oct 17, 2024
f693869
docs: update user guide instructions
SgtPooki Oct 17, 2024
ebf898b
test: vitest runs again
SgtPooki Oct 17, 2024
7a87682
fix: breadcrumb link clicking
SgtPooki Oct 17, 2024
d4102a8
chore: convert tests to typescript
SgtPooki Oct 17, 2024
8483a6d
chore: fix import path
SgtPooki Oct 17, 2024
222caa7
chore: update package-lock.json
SgtPooki Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 79 additions & 15 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,82 @@
// import copy from 'esbuild-plugin-copy'
import fs from 'node:fs'
import path from 'node:path'

const copyPlugin = ({ext}) => {
return {
name: `copy-${ext}`,
setup(build) {
const srcDir = 'src'
const destDir = 'dist/src'
build.onEnd(() => {
const copyFile = (src, dest) => {
fs.mkdirSync(path.dirname(dest), { recursive: true })
fs.copyFileSync(src, dest)
}

const walkDir = (dir, callback) => {
fs.readdirSync(dir).forEach(f => {
const dirPath = path.join(dir, f)
const isDirectory = fs.statSync(dirPath).isDirectory()
isDirectory ? walkDir(dirPath, callback) : callback(path.join(dir, f))
})
}

walkDir(srcDir, (filePath) => {
if (filePath.endsWith(`.${ext}`)) {
const relativePath = path.relative(srcDir, filePath)
const destPath = path.join(destDir, relativePath)
copyFile(filePath, destPath)
}
})
})
}
}
}
/** @type {import('aegir').PartialOptions} */
module.exports = {
export default {
// TODO: fix build and test with aegir
// test: {
// build: false,
// files: [
// 'dist/test/**/*.spec.{js,ts, jsx, tsx}',
// ],
// },
build: {
config: {
inject: [
'./src/lib/browser-shims.js'
],
bundle: true,
loader: {
'.js': 'jsx',
'.ts': 'ts',
'.tsx': 'tsx',
'.jsx': 'jsx',
'.svg': 'text',
// '.css': 'css'
'.woff': 'file',
'.woff2': 'file',
'.eot': 'file',
'.otf': 'file',
},
platform: 'browser',
target: 'es2022',
format: 'esm',
metafile: true,
plugins: [
copyPlugin({ext: 'css'}),
copyPlugin({ext: 'svg'}),
],
}
},
lint: {
files: [
// '!node_modules/**',
'src/**/*.{js,jsx,ts,tsx}',
'test/**/*.{js,jsx,ts,tsx}',
// 'src/**/*.tsx',
// 'src/**/*.js',
// 'src/**/*.jsx',
'dev/**/*.{js,jsx,ts,tsx}',
// TODO: re-enable linting of stories.
'!src/**/*.stories.*',
]
},
dependencyCheck: {
Expand All @@ -19,28 +87,24 @@ module.exports = {
'filesize',
'react-inspector',
'react-joyride',
'react-helmet',

// storybook deps
'@chromatic-com/storybook',
'@storybook/addon-actions',
'@storybook/addon-coverage',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-links',
'@storybook/channels',
'@storybook/core-common',
'@storybook/core-events',
'@storybook/csf-plugin',
'@storybook/csf-tools',
'@storybook/docs-tools',
'@storybook/node-logger',
'@storybook/react-dom-shim',
'@storybook/types',

// problem with deps
'@typescript-eslint/eslint-plugin',

// scripts
'wait-on',

// vite stuff
'rollup-plugin-node-polyfills',
],
productionIgnorePatterns: [
'.aegir.js',
Expand All @@ -49,7 +113,7 @@ module.exports = {
'vitest.config.js',
'/test',
'.storybook',
'dist-vite'
'**/*.stories.*',
]
}
}
26 changes: 0 additions & 26 deletions .babelrc

This file was deleted.

16 changes: 0 additions & 16 deletions .editorconfig

This file was deleted.

27 changes: 18 additions & 9 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,32 @@ import { mergeConfig } from 'vite';
import viteConfig from '../vite.config';

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],

addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-coverage'
'@storybook/addon-coverage',
'@chromatic-com/storybook'
],

framework: {
name: '@storybook/react-vite',
options: {},
},
docs: {
autodocs: 'tag',
},
async viteFinal(config) {
// Merge custom configuration into the default config
return mergeConfig(config, viteConfig);

// async viteFinal(config) {
// // Merge custom configuration into the default config
// return mergeConfig(config, viteConfig);
// },
typescript: {
// reactDocgen: 'react-docgen-typescript'
reactDocgen: false
// reactDocgenTypescriptOptions: {

// }
},

// docs: {}
};
export default config;
15 changes: 3 additions & 12 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@ globalThis.Buffer = Buffer

// import CSS files
import 'ipfs-css'
import 'react-virtualized/styles.css'
import 'tachyons'
import '../src/components/loader/Loader.css'
import '../src/components/object-info/LinksTable.css'
import '../src/components/loader/loader.css'
import '../src/components/object-info/links-table.css'

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
// tags: ['autodocs']
};

export default preview;
Loading
Loading