Skip to content

Commit

Permalink
Merge pull request #1 from samuelgja/feat/v3
Browse files Browse the repository at this point in the history
feat: v3 - basically it's new v2 version with simpler api
  • Loading branch information
samuelgja authored Nov 22, 2024
2 parents ceacc8c + a0111df commit efe5101
Show file tree
Hide file tree
Showing 83 changed files with 1,743 additions and 2,159 deletions.
355 changes: 129 additions & 226 deletions README.md

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ async function getAllFiles(dir: string): Promise<string[]> {
return Array.prototype.concat(...files)
}
const execAsync = promisify(exec)
const entry = 'src/index.ts'
const entryDir = 'packages/core'
const entry = path.join(entryDir, 'index.ts')
const outDir = 'lib'
const external = ['react', 'react-native', 'use-sync-external-store/shim/with-selector']
// Ensure output directories
await fs.mkdir(path.join(outDir, 'cjs'), { recursive: true })
await fs.mkdir(path.join(outDir, 'esm'), { recursive: true })
await fs.mkdir(path.join(outDir, 'src'), { recursive: true })
await fs.mkdir(path.join(outDir, entryDir), { recursive: true })

// Copy source files for react-native compatibility
await fs.cp('src', path.join(outDir, 'src'), { recursive: true })
await fs.cp(entryDir, path.join(outDir, 'src'), { recursive: true })

// CommonJS build (single file)
await esbuild.build({
Expand All @@ -44,7 +45,7 @@ await esbuild.build({

// ESM build (files as they are)
await esbuild.build({
entryPoints: await getAllFiles('src'),
entryPoints: await getAllFiles(entryDir),
bundle: false,
format: 'esm',
outdir: path.join(outDir, 'esm'),
Expand All @@ -60,6 +61,11 @@ import packageJson from './package.json'
delete packageJson.scripts
// @ts-ignore
delete packageJson.devDependencies
// @ts-ignore
delete packageJson.private
// @ts-ignore
delete packageJson.workspaces

// Copy package.json and README.md
await fs.writeFile(path.join(outDir, 'package.json'), JSON.stringify(packageJson, null, 2))

Expand All @@ -75,3 +81,5 @@ try {
} catch {
console.log('No .npmrc file found')
}

// Copy all core
Binary file modified bun.lockb
Binary file not shown.
5 changes: 2 additions & 3 deletions eslint.config.base.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const tsConfigPath = path.resolve("./", 'tsconfig.json')
depend.configs['flat/recommended'],
{
ignores: ['**/*.js', '**/api-definitions.ts', '**/.expo/**/*.ts*', "**/dist/**", "**/.storybook/**", "lib/**/*"],
files: ['src/**/*.{ts,tsx}'],
files: ['packages/core/*.{ts,tsx}'],
},
js.configs.recommended,
// prettierRecommended,
Expand Down Expand Up @@ -78,8 +78,7 @@ const tsConfigPath = path.resolve("./", 'tsconfig.json')
'@typescript-eslint/return-await': ['off'],
'@typescript-eslint/prefer-nullish-coalescing': ['off'],
'@typescript-eslint/no-dynamic-delete': ['off'],
// '@typescript-eslint/prefer-optional-chain': ['error'], slow
'@typescript-eslint/ban-types': ['error'],
'@typescript-eslint/prefer-optional-chain': ['error'],
'@typescript-eslint/no-var-requires': ['warn'],
'@typescript-eslint/no-invalid-void-type': ['off'],
'@typescript-eslint/explicit-function-return-type': ['off'],
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const config = [
depend.configs['flat/recommended'],
{
ignores: ['**/*.js', '**/api-definitions.ts', '**/.expo/**/*.ts*', "**/dist/**", "**/.storybook/**", "lib/**/*"],
files: ['src/**/*.{ts,tsx}'],
files: ['packages/core/*.{ts,tsx}'],
},
...tailwind.configs['flat/recommended'],
reactPerfPlugin.configs.flat.recommended,
Expand Down
3 changes: 0 additions & 3 deletions examples/muya-next-app/.eslintrc.json

This file was deleted.

40 changes: 0 additions & 40 deletions examples/muya-next-app/.gitignore

This file was deleted.

36 changes: 0 additions & 36 deletions examples/muya-next-app/README.md

This file was deleted.

Binary file removed examples/muya-next-app/app/favicon.ico
Binary file not shown.
Binary file removed examples/muya-next-app/app/fonts/GeistMonoVF.woff
Binary file not shown.
Binary file removed examples/muya-next-app/app/fonts/GeistVF.woff
Binary file not shown.
42 changes: 0 additions & 42 deletions examples/muya-next-app/app/globals.css

This file was deleted.

31 changes: 0 additions & 31 deletions examples/muya-next-app/app/layout.tsx

This file was deleted.

19 changes: 0 additions & 19 deletions examples/muya-next-app/app/page-client.tsx

This file was deleted.

Loading

0 comments on commit efe5101

Please sign in to comment.