Skip to content

Commit

Permalink
refactor(src): cut down on size
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenybai committed May 20, 2022
1 parent 518c6e4 commit ee28b23
Show file tree
Hide file tree
Showing 71 changed files with 468 additions and 559 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Prettify code
uses: creyD/prettier_action@v4.2
with:
prettier_options: --write packages
prettier_options: --write src
only_changed: True
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ git stage pnpm-lock.yaml

info "Checking for errors..."

if [ -n "$(git status packages --porcelain)" ]; then
if [ -n "$(git status src --porcelain)" ]; then
npx --no-install lint-staged --quiet || exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { patch } from 'packages/million';
import { patch } from 'src/million';

const adjectives = [
'pretty',
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-nocheck

import { createElement, patch, render } from 'packages/million';
import { createElement, patch, render } from 'src/million';
import Chart from 'chart.js/auto';
import confetti from 'canvas-confetti';
import { camelCase } from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/suites/appendManyRowsToLargeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @ts-nocheck

import * as hundred from 'hundred';
import { createElement } from 'packages/million';
import { createElement } from 'src/million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as virtual_dom from 'virtual-dom';
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/suites/clearRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @ts-nocheck

import * as hundred from 'hundred';
import { createElement } from 'packages/million';
import { createElement } from 'src/million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as virtual_dom from 'virtual-dom';
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/suites/createManyRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @ts-nocheck

import * as hundred from 'hundred';
import { createElement } from 'packages/million';
import { createElement } from 'src/million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as virtual_dom from 'virtual-dom';
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/suites/createRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @ts-nocheck

import * as hundred from 'hundred';
import { createElement } from 'packages/million';
import { createElement } from 'src/million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as virtual_dom from 'virtual-dom';
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/suites/partialUpdate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @ts-nocheck

import * as hundred from 'hundred';
import { createElement } from 'packages/million';
import { createElement } from 'src/million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as virtual_dom from 'virtual-dom';
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/suites/removeRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @ts-nocheck

import * as hundred from 'hundred';
import { createElement, Deltas } from 'packages/million';
import { createElement, Deltas } from 'src/million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as virtual_dom from 'virtual-dom';
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/suites/replaceAllRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @ts-nocheck

import * as hundred from 'hundred';
import { createElement } from 'packages/million';
import { createElement } from 'src/million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as virtual_dom from 'virtual-dom';
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/suites/selectRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @ts-nocheck

import * as hundred from 'hundred';
import { createElement } from 'packages/million';
import { createElement } from 'src/million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as virtual_dom from 'virtual-dom';
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/suites/swapRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @ts-nocheck

import * as hundred from 'hundred';
import { createElement, Deltas } from 'packages/million';
import { createElement, Deltas } from 'src/million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as virtual_dom from 'virtual-dom';
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ export default defineConfig({
root: 'benchmarks',
resolve: {
alias: {
packages: resolve(__dirname, '../packages'),
src: resolve(__dirname, '../src'),
},
},
esbuild: {
jsxFactory: 'h',
jsxFragment: 'Fragment',
jsxInject: `import { h, Fragment } from 'packages/jsx-runtime';`,
jsxInject: `import { h, Fragment } from 'src/jsx-runtime';`,
},
plugins: [
legacy({
Expand Down
17 changes: 8 additions & 9 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ import { defineBuildConfig } from 'unbuild';

export default defineBuildConfig({
entries: [
'./packages/million',
'./packages/jsx-runtime',
'./packages/ssr',
'./packages/shared',
'./packages/block',
'./packages/router',
'./packages/html',
'./packages/morph',
'./packages/vite-plugin-million',
'./src/million',
'./src/jsx-runtime',
'./src/ssr',
'./src/utils',
'./src/router',
'./src/html',
'./src/morph',
'./src/vite-plugin-million',
],
declaration: true,
clean: true,
Expand Down
21 changes: 8 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"scripts": {
"dev": "zx scripts/dev.mjs",
"build": "zx scripts/build.mjs",
"lint": "eslint packages/**",
"cleanup": "prettier --write packages",
"lint": "eslint src/**",
"cleanup": "prettier --write src",
"test": "vitest --coverage",
"bench": "vite --config benchmarks/vite.config.ts",
"release": "zx scripts/release.mjs",
Expand Down Expand Up @@ -43,11 +43,6 @@
"require": "./dist/ssr.cjs",
"types": "./ssr.d.ts"
},
"./block": {
"import": "./dist/block.mjs",
"require": "./dist/block.cjs",
"types": "./block.d.ts"
},
"./router": {
"import": "./dist/router.mjs",
"require": "./dist/router.cjs",
Expand All @@ -68,10 +63,10 @@
"require": "./dist/vite-plugin-million.cjs",
"types": "./vite-plugin-million.d.ts"
},
"./shared": {
"import": "./dist/shared.mjs",
"require": "./dist/shared.cjs",
"types": "./shared.d.ts"
"./utils": {
"import": "./dist/utils.mjs",
"require": "./dist/utils.cjs",
"types": "./utils.d.ts"
}
},
"sideEffects": false,
Expand Down Expand Up @@ -121,7 +116,7 @@
"@typescript-eslint/eslint-plugin": "^5.25.0",
"@typescript-eslint/parser": "^5.25.0",
"@vitejs/plugin-legacy": "^1.8.2",
"@vitest/ui": "^0.12.6",
"@vitest/ui": "^0.12.7",
"benchmark": "^2.1.4",
"c8": "^7.11.3",
"canvas-confetti": "^1.5.1",
Expand Down Expand Up @@ -151,7 +146,7 @@
"unbuild": "^0.7.4",
"virtual-dom": "^2.1.1",
"vite": "^2.9.9",
"vitest": "^0.12.6",
"vitest": "^0.12.7",
"zx": "^6.1.0"
}
}
7 changes: 0 additions & 7 deletions packages/block/README.md

This file was deleted.

25 changes: 0 additions & 25 deletions packages/block/block.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/block/index.ts

This file was deleted.

117 changes: 0 additions & 117 deletions packages/million/drivers/useNode.ts

This file was deleted.

0 comments on commit ee28b23

Please sign in to comment.