Skip to content

Commit

Permalink
ci: rename render and built-in component
Browse files Browse the repository at this point in the history
  • Loading branch information
Linkontoask committed Feb 17, 2023
1 parent b536acd commit 2ec705d
Show file tree
Hide file tree
Showing 31 changed files with 776 additions and 754 deletions.
6 changes: 3 additions & 3 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ function test(files) {
)
const other = Object.entries(packages)
.filter(([key]) => key !== 'babel-plugin-jsx')
.map(([_, v]) => v)
.map(([_, file]) => file).flat(Infinity)

return [
plugin.length
? `jest --config packages/${plugin[0][0]}/jest.config.js ${plugin[0][1].join(
? `jest --showConfig --config packages/${plugin[0][0]}/jest.config.js ${plugin[0][1].join(
' '
)}`
: null,
other.length
? `jest --config jest.config.js --colors ${other.join(' ')}`
? `jest --showConfig --config jest.config.js --colors ${other.join(' ')}`
: null,
].filter(Boolean)
}
Expand Down
4 changes: 2 additions & 2 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

# Gyron

` Gyron` is a simple zero-dependency responsive framework . Core code size: <img alt="npm bundle size (scoped)" src="https://img.shields.io/bundlephobia/minzip/@gyron/runtime?style=flat-square">。
`Gyron` is a simple zero-dependency responsive framework . Core code size: <img alt="npm bundle size (scoped)" src="https://img.shields.io/bundlephobia/minzip/@gyron/runtime?style=flat-square">。

It also has a very good performance performance, details of which can be found in [js-framework-benchmark](https://krausest.github.io/js-framework-benchmark/current.html#eyJmcmFtZXdvcmtzIjpbImtleWVkL2FuZ3VsYXIiLCJrZXllZC9neXJvbiIsImtleWVkL3JlYWN0Iiwibm9uLWtleWVkL2d5cm9uIiwibm9uLWtleWVkL3JlYWN0Il0sImJlbmNobWFya3MiOlsiMDFfcnVuMWsiLCIwMl9yZXBsYWNlMWsiLCIwM191cGRhdGUxMHRoMWtfeDE2IiwiMDRfc2VsZWN0MWsiLCIwNV9zd2FwMWsiLCIwNl9yZW1vdmUtb25lLTFrIiwiMDdfY3JlYXRlMTBrIiwiMDhfY3JlYXRlMWstYWZ0ZXIxa194MiIsIjA5X2NsZWFyMWtfeDgiLCIyMV9yZWFkeS1tZW1vcnkiLCIyMl9ydW4tbWVtb3J5IiwiMjNfdXBkYXRlNS1tZW1vcnkiLCIyNV9ydW4tY2xlYXItbWVtb3J5IiwiMjZfcnVuLTEway1tZW1vcnkiLCIzMV9zdGFydHVwLWNpIiwiMzRfc3RhcnR1cC10b3RhbGJ5dGVzIl0sImRpc3BsYXlNb2RlIjoxLCJjYXRlZ29yaWVzIjpbMSwyLDMsNF19) 提供的结果。
It also has a very good performance performance, details of which can be found in [js-framework-benchmark](https://krausest.github.io/js-framework-benchmark/current.html#eyJmcmFtZXdvcmtzIjpbImtleWVkL2FuZ3VsYXIiLCJrZXllZC9neXJvbiIsImtleWVkL3JlYWN0Iiwibm9uLWtleWVkL2d5cm9uIiwibm9uLWtleWVkL3JlYWN0Il0sImJlbmNobWFya3MiOlsiMDFfcnVuMWsiLCIwMl9yZXBsYWNlMWsiLCIwM191cGRhdGUxMHRoMWtfeDE2IiwiMDRfc2VsZWN0MWsiLCIwNV9zd2FwMWsiLCIwNl9yZW1vdmUtb25lLTFrIiwiMDdfY3JlYXRlMTBrIiwiMDhfY3JlYXRlMWstYWZ0ZXIxa194MiIsIjA5X2NsZWFyMWtfeDgiLCIyMV9yZWFkeS1tZW1vcnkiLCIyMl9ydW4tbWVtb3J5IiwiMjNfdXBkYXRlNS1tZW1vcnkiLCIyNV9ydW4tY2xlYXItbWVtb3J5IiwiMjZfcnVuLTEway1tZW1vcnkiLCIzMV9zdGFydHVwLWNpIiwiMzRfc3RhcnR1cC10b3RhbGJ5dGVzIl0sImRpc3BsYXlNb2RlIjoxLCJjYXRlZ29yaWVzIjpbMSwyLDMsNF19)

- Readme
- [中文](./README.md)
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
: [`${process.cwd()}/tests/**/(*.)+(spec|test).[jt]s?(x)`],
testEnvironment: 'jsdom',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>../../',
prefix: process.env.PACKAGES ? '<rootDir>../../' : '<rootDir>',
}),
collectCoverageFrom: [`./src/**/*.ts`],
globals: {
Expand Down
2 changes: 1 addition & 1 deletion packages/dom-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build:esm": "esbuild src/index.ts --bundle --sourcemap --minify --outfile=dist/esm/index.js --format=esm --platform=node --external:@gyron/* --define:__DEV__=false --define:__WARN__=true",
"build:cjs": "esbuild src/index.ts --bundle --sourcemap --minify --outfile=dist/cjs/index.js --format=cjs --platform=node --external:@gyron/* --define:__DEV__=false --define:__WARN__=true",
"build:dts": "rollup -c ../../rollup.config.js",
"test": "jest --config=../../jest.config.js"
"test": "cross-env PACKAGES=dom-client jest --config=../../jest.config.js"
},
"devDependencies": {
"@gyron/shared": "^0.0.29"
Expand Down
2 changes: 1 addition & 1 deletion packages/dom-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build:esm": "esbuild src/index.ts --bundle --sourcemap --minify --outfile=dist/esm/index.js --format=esm --platform=node --external:@gyron/* --define:__DEV__=false --define:__WARN__=true",
"build:cjs": "esbuild src/index.ts --bundle --sourcemap --minify --outfile=dist/cjs/index.js --format=cjs --platform=node --external:@gyron/* --define:__DEV__=false --define:__WARN__=true",
"build:dts": "rollup -c ../../rollup.config.js",
"test": "jest --config=../../jest.config.js"
"test": "cross-env PACKAGES=dom-server jest --config=../../jest.config.js"
},
"devDependencies": {
"@gyron/shared": "^0.0.29"
Expand Down
2 changes: 1 addition & 1 deletion packages/jsx-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build:esm": "esbuild src/index.ts --bundle --sourcemap --minify --outfile=dist/esm/index.js --format=esm --platform=node --external:@gyron/* --define:__DEV__=false --define:__WARN__=true",
"build:cjs": "esbuild src/index.ts --bundle --sourcemap --minify --outfile=dist/cjs/index.js --format=cjs --platform=node --external:@gyron/* --define:__DEV__=false --define:__WARN__=true",
"build:dts": "rollup -c ../../rollup.config.js",
"test": "jest --config=../../jest.config.js"
"test": "cross-env PACKAGES=jsx-runtime jest --config=../../jest.config.js"
},
"dependencies": {
"@gyron/runtime": "^0.0.29",
Expand Down
2 changes: 1 addition & 1 deletion packages/reactivity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build:esm": "esbuild src/index.ts --bundle --sourcemap --minify --outfile=dist/esm/index.js --format=esm --platform=node --external:@gyron/*",
"build:cjs": "esbuild src/index.ts --bundle --sourcemap --minify --outfile=dist/cjs/index.js --format=cjs --platform=node --external:@gyron/*",
"build:dts": "rollup -c ../../rollup.config.js",
"test": "jest --config=../../jest.config.js"
"test": "cross-env PACKAGES=reactivity jest --config=../../jest.config.js"
},
"dependencies": {
"@gyron/shared": "^0.0.29"
Expand Down
2 changes: 1 addition & 1 deletion packages/redux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build:esm": "esbuild src/index.ts --bundle --sourcemap --minify --outfile=dist/esm/index.js --format=esm --platform=node --external:@gyron/* --external:@reduxjs/toolkit",
"build:cjs": "esbuild src/index.ts --bundle --sourcemap --minify --outfile=dist/cjs/index.js --format=cjs --platform=node --external:@gyron/* --external:@reduxjs/toolkit",
"build:dts": "rollup -c ../../rollup.config.js",
"test": "jest --config=../../jest.config.js"
"test": "cross-env PACKAGES=redux jest --config=../../jest.config.js"
},
"dependencies": {
"@gyron/runtime": "^0.0.29",
Expand Down
2 changes: 1 addition & 1 deletion packages/router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"build:cjs": "esbuild src/index.ts --bundle --sourcemap --minify --outfile=dist/cjs/index.js --format=cjs --platform=node --external:@gyron/* --external:history --external:path-to-regexp --define:__DEV__=false --define:__WARN__=true",
"build:browser": "esbuild src/index.ts --bundle --sourcemap --outfile=dist/browser/index.js --format=esm --platform=browser --define:__DEV__=false --define:__WARN__=true",
"build:dts": "rollup -c ../../rollup.config.js",
"test": "jest --config=../../jest.config.js"
"test": "cross-env PACKAGES=router jest --config=../../jest.config.js"
},
"dependencies": {
"@gyron/runtime": "^0.0.29",
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build:esm": "esbuild src/index.ts --bundle --sourcemap --outfile=dist/esm/index.js --format=esm --platform=node",
"build:cjs": "esbuild src/index.ts --bundle --sourcemap --outfile=dist/cjs/index.js --format=cjs --platform=node",
"build:dts": "cross-env RESPECT_EXTERNAL=runtime rollup -c ../../rollup.config.js",
"test": "jest --config=../../jest.config.js"
"test": "cross-env PACKAGES=runtime jest --config=../../jest.config.js"
},
"devDependencies": {
"@gyron/dom-client": "^0.0.29",
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/src/assert.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from './component'
import { getErrorBoundaryCtx } from './ErrorBoundary'
import { getErrorBoundaryCtx } from './internal'
import { ErrorType, WarnType, BoundariesHandler } from './boundaries'

export enum InnerCode {
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/src/boundaries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, getCurrentComponent } from './component'
import { getErrorBoundaryCtx } from './ErrorBoundary'
import { getErrorBoundaryCtx } from './internal'

export type BoundariesHandlerParamsType = 'Error' | 'Warn'
export type BoundariesHandlerParams = Partial<{
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/src/hydrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
normalizeChildrenVNode,
normalizeVNodeWithLink,
} from './vnode'
import { mountComponent, patch } from './render'
import { mountComponent, patch } from './renderer'
import { setRef } from './ref'

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export {
isResponsive,
toRaw,
} from '@gyron/reactivity'
export { ErrorBoundary } from './ErrorBoundary'
export { Transition } from './Transition'
export { Transition, ErrorBoundary } from './internal'
export {
useWatch,
createComponentInstance,
Expand All @@ -29,6 +28,7 @@ export {
FC,
} from './component'
export { createInstance, render, createContext } from './instance'
export { createInstance as createGyron } from './instance'
export {
createVNode,
createVNodeComment,
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/src/instance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RenderElement, VNode } from './vnode'
import { patch, unmount } from './render'
import { patch, unmount } from './renderer'
import { hydrate } from './hydrate'
import { getUserContainer } from './shared'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useReactive } from '@gyron/reactivity'
import { isFunction } from '@gyron/shared'
import { Component, FC } from './component'
import { VNode } from './vnode'
import { h } from './h'
import { inject, useProvide } from './context'
import { BoundariesHandler, BoundariesHandlerParams } from './boundaries'
import { Component, FC } from '../component'
import { VNode } from '../vnode'
import { h } from '../h'
import { inject, useProvide } from '../context'
import { BoundariesHandler, BoundariesHandlerParams } from '../boundaries'

export interface ErrorBoundaryProps {
fallback: VNode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { VNode } from './vnode'
import { FC } from './component'
import { RenderElement, VNode } from '../vnode'
import { FC } from '../component'
import { isFunction, isNumber, shouldValue } from '@gyron/shared'
import { isVNode, isVNodeComment, RenderElement, warn } from '.'
import { Noop } from '@gyron/shared'
import { InnerCode } from './assert'
import { InnerCode, warn } from '../assert'
import { isVNode, isVNodeComment } from '../shared'

interface TransitionPropsNormalize {
cls: {
Expand Down
2 changes: 2 additions & 0 deletions packages/runtime/src/internal/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { TransitionHooks, whenTransitionEnd, Transition } from './Transition'
export { getErrorBoundaryCtx, ErrorBoundary } from './ErrorBoundary'
Loading

0 comments on commit 2ec705d

Please sign in to comment.