Project setup.
This commit is contained in:
commit
036861bf4d
16 changed files with 3225 additions and 0 deletions
10
.editorconfig
Normal file
10
.editorconfig
Normal file
|
@ -0,0 +1,10 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{js,jsx,ts,tsx,json,yml}]
|
||||
charset = utf-8
|
||||
indent_style = tab
|
||||
indent_size = 2
|
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
/.yarn/** linguist-vendored
|
||||
/.yarn/releases/* binary
|
||||
/.yarn/plugins/**/* binary
|
||||
/.pnp.* binary linguist-generated
|
25
.gitignore
vendored
Normal file
25
.gitignore
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
# IDEA
|
||||
|
||||
.idea/
|
||||
*.iml
|
||||
|
||||
# YARN / NPM
|
||||
|
||||
.yarn/*
|
||||
!.yarn/patches
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
|
||||
# Swap the comments on the following lines if you wish to use zero-installs
|
||||
# In that case, don't forget to run `yarn config set enableGlobalCache false`!
|
||||
# Documentation here: https://yarnpkg.com/features/caching#zero-installs
|
||||
|
||||
#!.yarn/cache
|
||||
node_modules/
|
||||
.pnp.*
|
||||
|
||||
# Library
|
||||
|
||||
lib/
|
17
.woodpecker.yaml
Normal file
17
.woodpecker.yaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
steps:
|
||||
- name: build_library
|
||||
image: node:alpine
|
||||
volumes:
|
||||
- /tmp/woodpecker/cache/uikernel/smartable/node_modules:/woodpecker/src/code.zeptotech.net/UIKernel/Smartable/node_modules
|
||||
- /tmp/woodpecker/cache/uikernel/smartable/.yarn/cache:/woodpecker/src/code.zeptotech.net/UIKernel/Smartable/.yarn/cache
|
||||
secrets:
|
||||
- FORGE_TOKEN
|
||||
commands:
|
||||
- corepack enable
|
||||
- yarn install
|
||||
- yarn build
|
||||
- ./.woodpecker/yarn_auth.sh
|
||||
- yarn npm publish
|
||||
when:
|
||||
- event: tag
|
||||
ref: refs/tags/v*
|
6
.woodpecker/yarn_auth.sh
Executable file
6
.woodpecker/yarn_auth.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "npmRegistries:
|
||||
//code.zeptotech.net/api/packages/UIKernel/npm/:
|
||||
npmAlwaysAuth: true
|
||||
npmAuthToken: \"$FORGE_TOKEN\"" >> ./.yarnrc.yml
|
6
.yarnrc.yml
Normal file
6
.yarnrc.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
nodeLinker: node-modules
|
||||
|
||||
npmScopes:
|
||||
kernelui:
|
||||
npmPublishRegistry: "https://code.zeptotech.net/api/packages/UIKernel/npm/"
|
||||
npmRegistryServer: "https://code.zeptotech.net/api/packages/UIKernel/npm/"
|
1
README.md
Normal file
1
README.md
Normal file
|
@ -0,0 +1 @@
|
|||
# Kernel UI Smartable
|
10
demo/DemoApp.tsx
Normal file
10
demo/DemoApp.tsx
Normal file
|
@ -0,0 +1,10 @@
|
|||
import React from "react";
|
||||
import {Application} from "@kernelui/core";
|
||||
|
||||
export function DemoApp()
|
||||
{
|
||||
return (
|
||||
<Application>
|
||||
</Application>
|
||||
)
|
||||
}
|
30
demo/demo.tsx
Normal file
30
demo/demo.tsx
Normal file
|
@ -0,0 +1,30 @@
|
|||
import "@kernelui/core/lib/style.css";
|
||||
|
||||
import React from "react";
|
||||
import {createRoot} from "react-dom/client";
|
||||
import {DemoApp} from "./DemoApp";
|
||||
import {createBrowserRouter} from "react-router-dom";
|
||||
import {Avocado} from "@phosphor-icons/react";
|
||||
import {ApplicationError, Kernel} from "@kernelui/core";
|
||||
|
||||
// Router initialization.
|
||||
const router = createBrowserRouter([
|
||||
{
|
||||
path: "/",
|
||||
element: <DemoApp />,
|
||||
errorElement: <ApplicationError />,
|
||||
}
|
||||
])
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const demoApp = document.getElementById("demo-app");
|
||||
|
||||
const root = createRoot(demoApp);
|
||||
|
||||
root.render(<Kernel router={router} footer={
|
||||
<footer>
|
||||
<Avocado weight={"duotone"} size={32} />
|
||||
<div>Kernel</div>
|
||||
</footer>
|
||||
} />);
|
||||
});
|
9
index.html
Normal file
9
index.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>UIKernel - Smartable</title>
|
||||
<script type="module" src="demo/demo.tsx"></script>
|
||||
</head>
|
||||
<body id="demo-app">
|
||||
</body>
|
||||
</html>
|
2
index.ts
Normal file
2
index.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
import "./src/styles/smartable.less";
|
||||
|
32
package.json
Normal file
32
package.json
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"version": "1.0.0-rc1",
|
||||
"name": "@kernelui/smartable",
|
||||
"description": "Kernel UI Smartable.",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build"
|
||||
},
|
||||
"type": "module",
|
||||
"source": "index.ts",
|
||||
"types": "lib/index.d.ts",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
"lib/**/*"
|
||||
],
|
||||
"publishConfig": {
|
||||
"@kernelui:registry": "https://code.zeptotech.net/api/packages/UIKernel/npm/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@kernelui/core": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@vitejs/plugin-react": "^4.3.0",
|
||||
"less": "^4.2.0",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^5.2.11",
|
||||
"vite-plugin-dts": "^3.9.1"
|
||||
},
|
||||
"packageManager": "yarn@4.2.2"
|
||||
}
|
0
src/styles/smartable.less
Normal file
0
src/styles/smartable.less
Normal file
28
tsconfig.json
Normal file
28
tsconfig.json
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"ts-node": {
|
||||
"compilerOptions": {
|
||||
"module": "ESNext",
|
||||
"types": ["node"]
|
||||
}
|
||||
},
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"incremental": true,
|
||||
"sourceMap": true,
|
||||
"noImplicitAny": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"resolveJsonModule": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"module": "ES6",
|
||||
"target": "ES6",
|
||||
"moduleResolution": "Bundler",
|
||||
"lib": [
|
||||
"ESNext",
|
||||
"DOM"
|
||||
],
|
||||
"jsx": "react",
|
||||
"allowJs": true
|
||||
}
|
||||
}
|
31
vite.config.ts
Normal file
31
vite.config.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import {ConfigEnv, defineConfig, UserConfig} from "vite";
|
||||
import dts from "vite-plugin-dts";
|
||||
import react from "@vitejs/plugin-react";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
|
||||
export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
|
||||
return ({
|
||||
build: {
|
||||
outDir: "lib",
|
||||
sourcemap: true,
|
||||
minify: "esbuild",
|
||||
lib: {
|
||||
entry: "index.ts",
|
||||
formats: ["es"],
|
||||
fileName: "index",
|
||||
},
|
||||
rollupOptions: {
|
||||
external: ["react"],
|
||||
},
|
||||
},
|
||||
|
||||
plugins: [
|
||||
react(),
|
||||
dts({
|
||||
insertTypesEntry: true,
|
||||
exclude: ["demo", "node_modules"],
|
||||
}),
|
||||
]
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue