mirror of
https://github.com/ziex-dev/ziex.git
synced 2026-07-20 02:29:36 -06:00
refactor: renamed packages -> pkg
This commit is contained in:
parent
ad3400b3f5
commit
5dcbb21d66
2
.gitignore
vendored
2
.gitignore
vendored
@ -10,7 +10,7 @@ dist
|
||||
node_modules
|
||||
|
||||
# Project Specific
|
||||
# packages/transformjs
|
||||
# pkg/transformjs
|
||||
site/.zx
|
||||
tmp
|
||||
test/data/assets/
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
// Client Side Rendering
|
||||
import { init } from "../../packages/ziex/src/wasm";
|
||||
import { init } from "../../pkg/ziex/src/wasm";
|
||||
init();
|
||||
|
||||
@ -19,14 +19,14 @@
|
||||
.zli = .{ .path = "vendor/cliz" },
|
||||
.zig_js = .{ .path = "vendor/jsz" },
|
||||
.tree_sitter = .{ .path = "vendor/zig-tree-sitter" },
|
||||
.tree_sitter_zx = .{ .path = "packages/tree-sitter-zx" },
|
||||
.tree_sitter_zx = .{ .path = "pkg/tree-sitter-zx" },
|
||||
.cachez = .{ .path = "vendor/cachez" },
|
||||
},
|
||||
.paths = .{
|
||||
"build.zig",
|
||||
"build.zig.zon",
|
||||
"src",
|
||||
"packages/tree-sitter-zx",
|
||||
"pkg/tree-sitter-zx",
|
||||
"vendor/cachez",
|
||||
"vendor/cliz",
|
||||
"vendor/jsz",
|
||||
|
||||
@ -16,7 +16,7 @@ local parser_path = vim.fn.stdpath("data") .. "/site/parser/zx.so"
|
||||
-- Auto-build parser if tree-sitter CLI is available
|
||||
if vim.fn.filereadable(parser_path) == 0 and vim.fn.executable("tree-sitter") == 1 then
|
||||
local plugin_dir = vim.fn.fnamemodify(debug.getinfo(1).source:sub(2), ":h:h")
|
||||
local grammar_dir = plugin_dir .. "/../../packages/tree-sitter-zx"
|
||||
local grammar_dir = plugin_dir .. "/../../pkg/tree-sitter-zx"
|
||||
|
||||
vim.notify("ZX: Building parser...", vim.log.levels.INFO)
|
||||
vim.fn.mkdir(vim.fn.stdpath("data") .. "/site/parser", "p")
|
||||
@ -40,7 +40,7 @@ if ok then
|
||||
local config = {
|
||||
install_info = {
|
||||
url = "https://github.com/nurulhudaapon/zx",
|
||||
files = { "packages/tree-sitter-zx/src/parser.c" },
|
||||
files = { "pkg/tree-sitter-zx/src/parser.c" },
|
||||
branch = "main",
|
||||
generate_requires_npm = false,
|
||||
},
|
||||
|
||||
@ -47,7 +47,7 @@ fi
|
||||
# Check if grammar exists
|
||||
echo ""
|
||||
echo "Step 4: Checking grammar..."
|
||||
GRAMMAR_DIR="$(cd "$(dirname "$0")/../../../packages/tree-sitter-zx" && pwd)"
|
||||
GRAMMAR_DIR="$(cd "$(dirname "$0")/../../../pkg/tree-sitter-zx" && pwd)"
|
||||
if [ -f "$GRAMMAR_DIR/src/parser.c" ]; then
|
||||
echo " ✓ Grammar found: $GRAMMAR_DIR"
|
||||
else
|
||||
|
||||
@ -12,7 +12,7 @@ language = "ZX"
|
||||
|
||||
[grammars.zx]
|
||||
# repository = "https://github.com/nurulhudaapon/zx"
|
||||
path = "packages/tree-sitter-zx"
|
||||
path = "pkg/tree-sitter-zx"
|
||||
# rev = "main"
|
||||
|
||||
repository = "file:///Users/nurulhudaapon/Projects/nurulhudaapon/zx"
|
||||
@ -20,7 +20,7 @@ rev = "feat/mdzx"
|
||||
|
||||
[grammars.mdzx]
|
||||
# repository = "https://github.com/nurulhudaapon/zx"
|
||||
path = "packages/tree-sitter-mdzx"
|
||||
path = "pkg/tree-sitter-mdzx"
|
||||
# rev = "main"
|
||||
|
||||
repository = "file:///Users/nurulhudaapon/Projects/nurulhudaapon/zx"
|
||||
|
||||
@ -78,12 +78,12 @@ async function main() {
|
||||
await $`cd ${pkgDir} && tsc --project ${tempTsConfigPath}`;
|
||||
|
||||
// Move nested declaration files to root of dist
|
||||
// TypeScript outputs to dist/packages/ziex/src/ due to rootDir being project root
|
||||
const nestedSrcDir = join(pkgDistDir, "packages/ziex/src");
|
||||
// TypeScript outputs to dist/pkg/ziex/src/ due to rootDir being project root
|
||||
const nestedSrcDir = join(pkgDistDir, "pkg/ziex/src");
|
||||
await $`cp -r ${nestedSrcDir}/* ${pkgDistDir}/`.quiet().nothrow();
|
||||
|
||||
// Clean up nested directories
|
||||
await $`rm -rf ${join(pkgDistDir, "packages")}`.quiet().nothrow();
|
||||
await $`rm -rf ${join(pkgDistDir, "pkg")}`.quiet().nothrow();
|
||||
await $`rm -rf ${join(pkgDistDir, "vendor")}`.quiet().nothrow();
|
||||
|
||||
// Clean up temporary tsconfig
|
||||
@ -18,7 +18,7 @@ COPY src/ ./src
|
||||
COPY site/ ./site
|
||||
COPY build.zig.zon ./build.zig.zon
|
||||
COPY build.zig ./build.zig
|
||||
COPY packages/ ./packages/
|
||||
COPY pkg/ ./pkg/
|
||||
COPY vendor/ ./vendor
|
||||
|
||||
RUN (cd site && $HOME/.bun/bin/bun install)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// Client Side Rendering
|
||||
import { init, edge } from "../packages/ziex/src/wasm";
|
||||
import { init, edge } from "../pkg/ziex/src/wasm";
|
||||
init();
|
||||
edge({'url': "/assets/edge.wasm"});
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { hydrateAll } from "../../packages/ziex/src/react";
|
||||
import { hydrateAll } from "../../pkg/ziex/src/react";
|
||||
import { registry } from "@ziex/components";
|
||||
|
||||
// Hydrate React islands
|
||||
|
||||
@ -7,7 +7,7 @@ pub fn build(
|
||||
target: std.Build.ResolvedTarget,
|
||||
optimize: std.builtin.OptimizeMode,
|
||||
) *std.Build.Step {
|
||||
const transformjs_dir = "packages/transformjs";
|
||||
const transformjs_dir = "pkg/transformjs";
|
||||
|
||||
// Build the Rust library using cargo
|
||||
const cargo_build = b.addSystemCommand(&.{ "cargo", "build", "--lib" });
|
||||
@ -66,7 +66,7 @@ pub fn link(
|
||||
optimize: std.builtin.OptimizeMode,
|
||||
) void {
|
||||
const target = exe.root_module.resolved_target orelse return;
|
||||
const transformjs_dir = "packages/transformjs";
|
||||
const transformjs_dir = "pkg/transformjs";
|
||||
|
||||
exe.step.dependOn(build_step);
|
||||
exe.addIncludePath(b.path(transformjs_dir));
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
PROJECT_ROOT="$(pwd)"
|
||||
|
||||
# Source and destination directories
|
||||
SOURCE_DIR="$PROJECT_ROOT/packages/tree-sitter-zx/queries"
|
||||
SOURCE_DIR="$PROJECT_ROOT/pkg/tree-sitter-zx/queries"
|
||||
ZED_DIR="$PROJECT_ROOT/editors/zed/languages/zx"
|
||||
NEOVIM_DIR="$PROJECT_ROOT/editors/neovim/queries/zx"
|
||||
SITE_PAGES_DIR="$PROJECT_ROOT/site/pages/docs"
|
||||
|
||||
@ -64,12 +64,12 @@ rm -f "$BUILD_ZON_PATH.bak"
|
||||
echo "Version: $CURRENT_VERSION -> $NEW_VERSION"
|
||||
echo "Updated $BUILD_ZON_FILE"
|
||||
|
||||
# Update packages/ziex/package.json version
|
||||
ZIEX_PACKAGE_JSON="$PROJECT_ROOT/packages/ziex/package.json"
|
||||
# Update pkg/ziex/package.json version
|
||||
ZIEX_PACKAGE_JSON="$PROJECT_ROOT/pkg/ziex/package.json"
|
||||
if [ -f "$ZIEX_PACKAGE_JSON" ]; then
|
||||
sed -i.bak -E "s/$VERSION_PATTERN/$NEW_VERSION/" "$ZIEX_PACKAGE_JSON"
|
||||
rm -f "$ZIEX_PACKAGE_JSON.bak"
|
||||
echo "Updated packages/ziex/package.json"
|
||||
echo "Updated pkg/ziex/package.json"
|
||||
fi
|
||||
|
||||
# Update editors/zed/extension.toml version
|
||||
@ -100,7 +100,7 @@ git add "$ZED_EXTENSION_TOML" 2>/dev/null || true
|
||||
git add "$VSCODE_PACKAGE_JSON" 2>/dev/null || true
|
||||
|
||||
# Update tree-sitter-zx version (ignore errors)
|
||||
TREE_SITTER_DIR="$PROJECT_ROOT/packages/tree-sitter-zx"
|
||||
TREE_SITTER_DIR="$PROJECT_ROOT/pkg/tree-sitter-zx"
|
||||
if [ -d "$TREE_SITTER_DIR" ]; then
|
||||
(cd "$TREE_SITTER_DIR" && tree-sitter version "$NEW_VERSION") 2>/dev/null || true
|
||||
git add "$TREE_SITTER_DIR" 2>/dev/null || true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user