-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* other: #217 🔹 configure formatter * other: #217 🔹 configure linter * other: #217 🔹 configure lint staged
- Loading branch information
Showing
2,653 changed files
with
70,455 additions
and
69,889 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
dist | ||
temp | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { builtinModules } = require('node:module') | ||
|
||
/** | ||
* @type {import('eslint-define-config').ESLintConfig} | ||
*/ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
sourceType: 'module', | ||
}, | ||
plugins: ['import', '@typescript-eslint'], | ||
rules: { | ||
'no-debugger': 'error', | ||
'sort-imports': ['error', { ignoreDeclarationSort: true }], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
node_modules | ||
book/images | ||
book/online-book/cache | ||
|
||
dist | ||
*.md | ||
*.html | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"arrowParens": "avoid" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
book/impls/00_introduction/010_project_setup/examples/playground/src/main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { helloChibivue } from "chibivue"; | ||
import { helloChibivue } from 'chibivue' | ||
|
||
helloChibivue(); | ||
helloChibivue() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
book/impls/00_introduction/010_project_setup/examples/playground/vite.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { defineConfig } from "vite"; | ||
import { defineConfig } from 'vite' | ||
|
||
export default defineConfig({ | ||
resolve: { | ||
alias: { | ||
chibivue: `${process.cwd()}/../../packages`, | ||
}, | ||
}, | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
"devDependencies": { | ||
"@types/node": "^18.15.11" | ||
} | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
book/impls/00_introduction/010_project_setup/packages/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const helloChibivue = () => { | ||
console.log("Hello chibivue!"); | ||
}; | ||
console.log('Hello chibivue!') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
book/impls/10_minimum_example/010_create_app/examples/playground/src/main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { createApp } from "chibivue"; | ||
import { createApp } from 'chibivue' | ||
|
||
const app = createApp({ | ||
render() { | ||
return "Hello world."; | ||
return 'Hello world.' | ||
}, | ||
}); | ||
}) | ||
|
||
app.mount("#app"); | ||
app.mount('#app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
book/impls/10_minimum_example/010_create_app/examples/playground/vite.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { defineConfig } from "vite"; | ||
import { defineConfig } from 'vite' | ||
|
||
export default defineConfig({ | ||
resolve: { | ||
alias: { | ||
chibivue: `${process.cwd()}/../../packages`, | ||
}, | ||
}, | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
"devDependencies": { | ||
"@types/node": "^18.15.11" | ||
} | ||
} | ||
} |
18 changes: 9 additions & 9 deletions
18
book/impls/10_minimum_example/010_create_app/packages/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
export type Options = { | ||
render: () => string; | ||
}; | ||
render: () => string | ||
} | ||
|
||
export type App = { | ||
mount: (selector: string) => void; | ||
}; | ||
mount: (selector: string) => void | ||
} | ||
|
||
export const createApp = (options: Options): App => { | ||
return { | ||
mount: (selector) => { | ||
const root = document.querySelector(selector); | ||
mount: selector => { | ||
const root = document.querySelector(selector) | ||
if (root) { | ||
root.innerHTML = options.render(); | ||
root.innerHTML = options.render() | ||
} | ||
}, | ||
}; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
book/impls/10_minimum_example/010_create_app2/examples/playground/src/main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { createApp } from "chibivue"; | ||
import { createApp } from 'chibivue' | ||
|
||
const app = createApp({ | ||
render() { | ||
return "Hello world."; | ||
return 'Hello world.' | ||
}, | ||
}); | ||
}) | ||
|
||
app.mount("#app"); | ||
app.mount('#app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
book/impls/10_minimum_example/010_create_app2/examples/playground/vite.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { defineConfig } from "vite"; | ||
import { defineConfig } from 'vite' | ||
|
||
export default defineConfig({ | ||
resolve: { | ||
alias: { | ||
chibivue: `${process.cwd()}/../../packages`, | ||
}, | ||
}, | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
"devDependencies": { | ||
"@types/node": "^18.15.11" | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
book/impls/10_minimum_example/010_create_app2/packages/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from "./runtime-dom"; | ||
export * from './runtime-dom' |
22 changes: 11 additions & 11 deletions
22
book/impls/10_minimum_example/010_create_app2/packages/runtime-core/apiCreateApp.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
import { Component } from "./component"; | ||
import { RootRenderFunction } from "./renderer"; | ||
import { Component } from './component' | ||
import { RootRenderFunction } from './renderer' | ||
|
||
export interface App<HostElement = any> { | ||
mount(rootContainer: HostElement | string): void; | ||
mount(rootContainer: HostElement | string): void | ||
} | ||
|
||
export type CreateAppFunction<HostElement> = ( | ||
rootComponent: Component | ||
) => App<HostElement>; | ||
rootComponent: Component, | ||
) => App<HostElement> | ||
|
||
export function createAppAPI<HostElement>( | ||
render: RootRenderFunction<HostElement> | ||
render: RootRenderFunction<HostElement>, | ||
): CreateAppFunction<HostElement> { | ||
return function createApp(rootComponent) { | ||
const app: App = { | ||
mount(rootContainer: HostElement) { | ||
const message = rootComponent.render!(); | ||
render(message, rootContainer); | ||
const message = rootComponent.render!() | ||
render(message, rootContainer) | ||
}, | ||
}; | ||
} | ||
|
||
return app; | ||
}; | ||
return app | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
book/impls/10_minimum_example/010_create_app2/packages/runtime-core/component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { ComponentOptions } from "./componentOptions"; | ||
import { ComponentOptions } from './componentOptions' | ||
|
||
export type Component = ComponentOptions; | ||
export type Component = ComponentOptions |
4 changes: 2 additions & 2 deletions
4
book/impls/10_minimum_example/010_create_app2/packages/runtime-core/componentOptions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export type ComponentOptions = { | ||
render?: Function; | ||
}; | ||
render?: Function | ||
} |
8 changes: 4 additions & 4 deletions
8
book/impls/10_minimum_example/010_create_app2/packages/runtime-core/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export type { App, CreateAppFunction } from "./apiCreateApp"; | ||
export { createAppAPI } from "./apiCreateApp"; | ||
export type { App, CreateAppFunction } from './apiCreateApp' | ||
export { createAppAPI } from './apiCreateApp' | ||
|
||
export type { RendererOptions } from "./renderer"; | ||
export { createRenderer } from "./renderer"; | ||
export type { RendererOptions } from './renderer' | ||
export { createRenderer } from './renderer' |
Oops, something went wrong.