Skip to content

Commit

Permalink
Merge pull request #81 from AllenShintani/master
Browse files Browse the repository at this point in the history
Adjustment of CI
  • Loading branch information
AllenShintani authored Mar 17, 2024
2 parents f75d289 + e7e9e5d commit 5da0a93
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 25 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup Node.js

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: latest
- run: npm install
- run: npm run lint
- run: npm run type-check

- name: Install dependencies
run: npm install

- name: Run lint
run: npm run lint

- name: Run tests
run: npm test

- name: Modify package.json and Reinstall dependencies
if: success()
run: |
node modifyPackageJson.cjs
rm -rf package-lock.json node_modules
npm install
- name: Run type-check
run: npm run type-check
Empty file added devPackageJson.cjs
Empty file.
24 changes: 24 additions & 0 deletions modifyPackageJson.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const fs = require('fs')

const packageJsonPath = './package.json'
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))

delete packageJson.devDependencies.vite
delete packageJson.devDependencies['@vitejs/plugin-react']
delete packageJson.devDependencies['@typescript-eslint/parser']
delete packageJson.devDependencies['@typescript-eslint/eslint-plugin']
delete packageJson.devDependencies['@vitest/coverage-v8']
delete packageJson.devDependencies['eslint']
delete packageJson.devDependencies['eslint-plugin-react']
delete packageJson.devDependencies['eslint-plugin-react-hooks']
delete packageJson.devDependencies['eslint-plugin-prettier']
delete packageJson.devDependencies['eslint-config-prettier']
delete packageJson.devDependencies['prettier']
delete packageJson.devDependencies['vitest']
delete packageJson.devDependencies['vite-node']
delete packageJson.devDependencies['vite-plugin-checker']
delete packageJson.devDependencies['@types/ansi-escapes']
delete packageJson.dependencies['ansi-escapes']

fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2))
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"dependencies": {
"@types/stack-utils": "^2.0.3",
"ansi-escapes": "^6.2.0",
"ansi-escapes": "^4.3.1",
"auto-bind": "^5.0.1",
"code-excerpt": "^4.0.0",
"is-in-ci": "^0.1.0",
"lodash": "^4.17.21",
"ora": "^8.0.1",
"react": "^18.2.0",
"react-reconciler": "^0.29.0",
"rxjs": "^7.8.1",
"serialport": "^12.0.0",
"stack-utils": "^2.0.6",
"typescript": "^5.4.2",
"vite": "^5.1.6",
"yoga": "^0.0.20",
"yoga-wasm-web": "^0.3.3"
},
Expand All @@ -20,8 +20,12 @@
"@types/auto-bind": "^2.1.0",
"@types/lodash": "^4.14.202",
"@types/node": "^20.8.8",
"@types/react": "^18.2.55",
"@types/react-reconciler": "^0.28.8",
"@types/serialport": "^8.0.3",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@types/stack-utils": "^2.0.3",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.4.0",
"eslint": "^8.56.0",
Expand All @@ -33,13 +37,8 @@
"prettier": "^3.0.3",
"vite-node": "^1.2.2",
"vite-plugin-checker": "^0.6.2",
"vitest": "^1.4.0"
},
"peerDependencies": {
"@types/react": "^18.2.55",
"@types/react-reconciler": "^0.28.8",
"react": "^18.2.0",
"react-reconciler": "^0.29.0"
"vitest": "^1.4.0",
"vite": "^5.1.6"
},
"files": [
"dist",
Expand Down
Binary file removed public/images/icon.png
Binary file not shown.
18 changes: 9 additions & 9 deletions src/declarative/rendere/edison.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import process from 'node:process'
import { type ReactNode } from 'react'
import throttle from 'lodash/throttle'
import ansiEscapes from 'ansi-escapes'
import isInCi from 'is-in-ci'
import autoBind from 'auto-bind'
import { type FiberRoot } from 'react-reconciler'
Expand Down Expand Up @@ -130,7 +129,8 @@ export default class Edison {
return
}

const { output, outputHeight, staticOutput } = render()
// If use ansi-escapes to clear the terminal, add outputHeight to Destructuring assignmen
const { output, staticOutput } = render()

// If <Static> output isn't empty, it means new children have been added to it
const hasStaticOutput = staticOutput && staticOutput !== '\n'
Expand All @@ -157,13 +157,13 @@ export default class Edison {
this.fullStaticOutput += staticOutput
}

if (outputHeight >= this.options.stdout.rows) {
this.options.stdout.write(
ansiEscapes.clearTerminal + this.fullStaticOutput + output,
)
this.lastOutput = output
return
}
// if (outputHeight >= this.options.stdout.rows) {
// this.options.stdout.write(
// ansiEscapes.clearTerminal + this.fullStaticOutput + output,
// )
// this.lastOutput = output
// return
// }

this.lastOutput = output
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
"allowJs": true
},
"include": ["src/**/*.ts", "src/**/*.tsx", "global.d.ts"],
"exclude": ["node_modules", "./dist"]
"exclude": ["node_modules", "./dist", "./src/__tests__"]
}

0 comments on commit 5da0a93

Please sign in to comment.