Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
.idea
.vscode
.pixi
__pycache__/
build/
dist/
venv*/
.streamlit
*.egg-info/
**/node_modules/
test*
**/package-lock.json
**/tsconfig.json
poetry.lock
pyproject.toml
.vscode
.DS_Store
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

12 changes: 12 additions & 0 deletions hatch_build_hook.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
import subprocess


class BuildFrontend(BuildHookInterface):
PLUGIN_NAME = "build_frontend"
FRONTEND_DIR_PATH = "streamlit_antd_components/frontend"

def initialize(self, version, build_data):
subprocess.run(args=["npm", "install"], cwd=self.FRONTEND_DIR_PATH, check=True)
subprocess.run(args=["npm", "run", "build"], cwd=self.FRONTEND_DIR_PATH, check=True)
return super().initialize(version, build_data)
4,786 changes: 4,786 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[project]
authors = [{name = "jihaoran"}]
name = "streamlit_antd_components"
description = "A collection of Streamlit components built with Ant Design and Mantine"
requires-python = ">= 3.11"
version = "0.3.2"
dependencies = [
"streamlit>=1.40.0,<2",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.custom]
path = "hatch_build_hook.py"

[tool.hatch.build.targets.wheel]
packages = ["streamlit_antd_components"]
exclude = ["streamlit_antd_components/frontend/**"]
artifacts = [
"streamlit_antd_components/frontend/build/**",
"!*.map",
"!*.LICENSE.txt",
]

[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64"]

[tool.pixi.pypi-dependencies]
streamlit_antd_components = { path = ".", editable = true }

[tool.pixi.dependencies]
streamlit = ">=1.40.0,<2"
nodejs = "*"
hatch = "*"

[tool.pixi.tasks]
wheel = "hatch build -t wheel"
30 changes: 0 additions & 30 deletions setup.py

This file was deleted.

1 change: 0 additions & 1 deletion streamlit_antd_components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
@Project : StreamlitAntdComponents
@Software : PyCharm
"""
_RELEASE = True
__VERSION__ = "0.3.2"

from .widgets import *
Expand Down
11 changes: 11 additions & 0 deletions streamlit_antd_components/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
dist/
build/
node_modules/

.npm/
.eslintcache
.node_repl_history
.env*
.vite/
.next/
.DS_Store
46 changes: 46 additions & 0 deletions streamlit_antd_components/frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import eslintReact from "@eslint-react/eslint-plugin";
import eslintJs from "@eslint/js";
import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";

export default defineConfig([
{
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
ignores: ["dist", "build", "node_modules"],

// Extend recommended rule sets from:
// 1. ESLint JS's recommended rules
// 2. TypeScript ESLint recommended rules
// 3. ESLint React's recommended-typescript rules
extends: [
eslintJs.configs.recommended,
tseslint.configs.recommended,
eslintReact.configs["recommended-typescript"],
],

// Configure language/parsing options
languageOptions: {
// Use TypeScript ESLint parser for TypeScript files
parser: tseslint.parser,
parserOptions: {
// Enable project service for better TypeScript integration
projectService: true,
tsconfigRootDir: import.meta.dirname,
ecmaFeatures: {
jsx: true,
},
env: {
browser: true,
es2021: true,
},
},
},

// Custom rule overrides (modify rule levels or disable rules)
rules: {
"@eslint-react/no-missing-key": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "warn",
},
},
]);
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Streamlit Component" />
<link rel="stylesheet" href="bootstrap.min.css" />
<link rel="stylesheet" href="/bootstrap.min.css" />
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
Loading