fuzor 0.0.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +112 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +97 -0
- package/dist/cli.js.map +1 -0
- package/dist/compiler/index.d.ts +28 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/index.js +184 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/islands.d.ts +17 -0
- package/dist/compiler/islands.d.ts.map +1 -0
- package/dist/compiler/islands.js +78 -0
- package/dist/compiler/islands.js.map +1 -0
- package/dist/create.d.ts +21 -0
- package/dist/create.d.ts.map +1 -0
- package/dist/create.js +111 -0
- package/dist/create.js.map +1 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/islands/react.d.ts +8 -0
- package/dist/islands/react.d.ts.map +1 -0
- package/dist/islands/react.js +19 -0
- package/dist/islands/react.js.map +1 -0
- package/dist/islands/solid.d.ts +8 -0
- package/dist/islands/solid.d.ts.map +1 -0
- package/dist/islands/solid.js +15 -0
- package/dist/islands/solid.js.map +1 -0
- package/dist/islands/vue.d.ts +5 -0
- package/dist/islands/vue.d.ts.map +1 -0
- package/dist/islands/vue.js +13 -0
- package/dist/islands/vue.js.map +1 -0
- package/dist/runtime/atom.d.ts +10 -0
- package/dist/runtime/atom.d.ts.map +1 -0
- package/dist/runtime/atom.js +38 -0
- package/dist/runtime/atom.js.map +1 -0
- package/dist/runtime/index.d.ts +31 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +121 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/islands.d.ts +6 -0
- package/dist/runtime/islands.d.ts.map +1 -0
- package/dist/runtime/islands.js +43 -0
- package/dist/runtime/islands.js.map +1 -0
- package/dist/ssr/node.d.ts +7 -0
- package/dist/ssr/node.d.ts.map +1 -0
- package/dist/ssr/node.js +46 -0
- package/dist/ssr/node.js.map +1 -0
- package/dist/ssr.d.ts +10 -0
- package/dist/ssr.d.ts.map +1 -0
- package/dist/ssr.js +19 -0
- package/dist/ssr.js.map +1 -0
- package/dist/vite.d.ts +8 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +310 -0
- package/dist/vite.js.map +1 -0
- package/package.json +71 -56
- package/templates/basic/README.md +16 -0
- package/templates/basic/_gitignore +3 -0
- package/templates/basic/components/app-badge.html +1 -0
- package/templates/basic/index.html +12 -0
- package/templates/basic/islands/counter.ts +13 -0
- package/templates/basic/package.json +20 -0
- package/templates/basic/pages/about/index.html +5 -0
- package/templates/basic/pages/docs/index.md +9 -0
- package/templates/basic/pages/index.html +9 -0
- package/templates/basic/pages/layout.html +8 -0
- package/templates/basic/pnpm-workspace.yaml +5 -0
- package/templates/basic/server.mjs +10 -0
- package/templates/basic/style.css +1 -0
- package/templates/basic/tsconfig.json +13 -0
- package/templates/basic/vite.config.ts +4 -0
- package/bin/index.js +0 -13
- package/dist/core/init.d.ts +0 -7
- package/dist/core/router.d.ts +0 -4
- package/dist/core/vite-config.d.ts +0 -5
- package/dist/init.cjs +0 -237
- package/dist/init.js +0 -468
- package/dist/lib.cjs +0 -222
- package/dist/lib.js +0 -19247
- package/dist/render/lit.d.ts +0 -1
- package/dist/render/preact.d.ts +0 -1
- package/dist/render/react.d.ts +0 -7
- package/dist/render/solid.d.ts +0 -1
- package/dist/render/svelte.d.ts +0 -6
- package/dist/render/vue.d.ts +0 -1
- package/dist/utils/create-file-if-not-exists.d.ts +0 -1
- package/dist/utils/create-folder-if-not-exist.d.ts +0 -2
- package/dist/utils/default-theme-files.d.ts +0 -7
- package/dist/utils/file-path-helpers.d.ts +0 -3
- package/dist/utils/is-valid-wordpress-slug.d.ts +0 -17
- package/dist/utils/read-write-file.d.ts +0 -1
- package/dist/utils/remove-file-exists.d.ts +0 -2
- package/dist/utils/remove-trailing-slash-url.d.ts +0 -1
- package/dist/utils/router-helpers.d.ts +0 -19
- package/dist/utils/zip-wp-theme.d.ts +0 -2
- package/types/index.d.ts +0 -6
package/dist/render/lit.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/render/preact.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/render/react.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { JSXElementConstructor, ReactElement, ReactNode, ReactPortal } from 'react';
|
|
2
|
-
export declare function renderReactComponent(comp: string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null | undefined): string;
|
|
3
|
-
type Props = {
|
|
4
|
-
use: "MyComponent.tsx" | "OtherComponent.tsx";
|
|
5
|
-
};
|
|
6
|
-
export declare function UseComponent({ use }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
package/dist/render/solid.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/render/svelte.d.ts
DELETED
package/dist/render/vue.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function createFileIfNotExists(filePath: string, content?: string): Promise<void>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const readmeTXT: () => string;
|
|
2
|
-
export declare const styleCSS: () => string;
|
|
3
|
-
export declare const themeJSON = "{\n\t\"settings\": {\n\t\t\"appearanceTools\": true,\n\t\t\"layout\": {\n\t\t\t\"contentSize\": \"620px\",\n\t\t\t\"wideSize\": \"1000px\"\n\t\t},\n\t\t\"spacing\": {\n\t\t\t\"units\": [\n\t\t\t\t\"%\",\n\t\t\t\t\"px\",\n\t\t\t\t\"em\",\n\t\t\t\t\"rem\",\n\t\t\t\t\"vh\",\n\t\t\t\t\"vw\"\n\t\t\t]\n\t\t},\n\t\t\"typography\": {\n\t\t\t\"fontFamilies\": [\n\t\t\t\t{\n\t\t\t\t\t\"fontFamily\": \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif\",\n\t\t\t\t\t\"name\": \"System Font\",\n\t\t\t\t\t\"slug\": \"system-font\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"useRootPaddingAwareAlignments\": true\n\t},\n\t\"templateParts\": [\n\t\t{\n\t\t\t\"area\": \"header\",\n\t\t\t\"name\": \"header\"\n\t\t},\n\t\t{\n\t\t\t\"area\": \"footer\",\n\t\t\t\"name\": \"footer\"\n\t\t}\n\t],\n\t\"version\": 3,\n\t\"$schema\": \"https://schemas.wp.org/wp/6.7/theme.json\"\n}";
|
|
4
|
-
export declare const footerHTML = "<!-- wp:group {\"layout\":{\"inherit\":true}} -->\n<div class=\"wp-block-group\">\n\t<!-- wp:group {\"style\":{\"spacing\":{\"padding\":{\"top\":\"80px\",\"bottom\":\"30px\"}}}} -->\n\t<div class=\"wp-block-group\" style=\"padding-top:80px;padding-bottom:30px\">\n\t\t<!-- wp:paragraph {\"align\":\"center\"} -->\n\t\t<p class=\"has-text-align-center\">Proudly Powered by <a href=\"https://wordpress.org\" rel=\"nofollow\">WordPress</a></p>\n\t\t<!-- /wp:paragraph -->\n\t</div>\n\t<!-- /wp:group -->\n</div>\n<!-- /wp:group -->";
|
|
5
|
-
export declare const headerHTML = "<!-- wp:group {\"layout\":{\"inherit\":\"true\"}} -->\n<div class=\"wp-block-group\">\n\t<!-- wp:group {\"align\":\"full\",\"layout\":{\"type\":\"flex\",\"justifyContent\":\"space-between\"},\"style\":{\"spacing\":{\"padding\":{\"bottom\":\"30px\",\"top\":\"30px\"}}}} -->\n\t<div class=\"wp-block-group alignfull\" style=\"padding-bottom:30px;padding-top:30px\">\n\t\n\t\t<!-- wp:group {\"layout\":{\"type\":\"flex\"}} -->\n\t\t<div class=\"wp-block-group\">\n\t\t\t<!-- wp:site-logo {\"width\":64} /-->\n\t\n\t\t\t<!-- wp:group -->\n\t\t\t<div class=\"wp-block-group\">\n\t\t\t\t<!-- wp:site-title /-->\n\t\t\t\t<!-- wp:site-tagline /-->\n\t\t\t</div>\n\t\t\t<!-- /wp:group -->\n\t\t</div>\n\t\t<!-- /wp:group -->\n\t\n\t\t<!-- wp:navigation {\"layout\":{\"type\":\"flex\",\"setCascadingProperties\":true,\"justifyContent\":\"right\",\"orientation\":\"horizontal\"},\"style\":{\"spacing\":{\"margin\":{\"top\":\"0\"}}}} /-->\n\t\n\t</div>\n\t<!-- /wp:group -->\n\n</div>\n<!-- /wp:group -->\n\n<!-- wp:spacer {\"height\":50} -->\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"></div>\n<!-- /wp:spacer -->";
|
|
6
|
-
export declare const indexHTML = "<!-- wp:template-part {\"slug\":\"header\",\"tagName\":\"header\"} /-->\n\n<!-- wp:group {\"tagName\":\"main\",\"layout\":{\"type\":\"constrained\"}} -->\n<main class=\"wp-block-group\">\n\t<!-- wp:query {\"layout\":{\"inherit\":true}} -->\n\t<div class=\"wp-block-query\">\n\t\t<!-- wp:post-template -->\n\t\t<!-- wp:group -->\n\t\t<div class=\"wp-block-group\">\n\t\t\t<!-- wp:post-title {\"isLink\":true} /-->\n\t\t\t<!-- wp:post-featured-image {\"isLink\":true} /-->\n\t\t\t<!-- wp:post-content /-->\n\t\t\t<!-- wp:group {\"layout\":{\"type\":\"flex\"},\"style\":{\"typography\":{\"fontSize\":\"14px\"}}} -->\n\t\t\t<div class=\"wp-block-group\" style=\"font-size:14px\">\n\t\t\t\t<!-- wp:post-author {\"showAvatar\":false,\"showBio\":false} /-->\n\t\t\t\t<!-- wp:post-date {\"isLink\":true} /-->\n\t\t\t\t<!-- wp:post-terms {\"term\":\"category\"} /-->\n\t\t\t\t<!-- wp:post-terms {\"term\":\"post_tag\"} /-->\n\t\t\t</div>\n\t\t\t<!-- /wp:group -->\n\t\t\t<!-- wp:spacer {\"height\":40} -->\n\t\t\t<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"></div>\n\t\t\t<!-- /wp:spacer -->\n\t\t</div>\n\t\t<!-- /wp:group -->\n\t\t<!-- /wp:post-template -->\n\t\t<!-- wp:group {\"layout\":{\"inherit\":true}} -->\n\t\t\t<div class=\"wp-block-group\">\n\t\t\t<!-- wp:query-pagination -->\n\t\t\t\t<!-- wp:query-pagination-previous /-->\n\n\t\t\t\t<!-- wp:query-pagination-numbers /-->\n\n\t\t\t\t<!-- wp:query-pagination-next /-->\n\t\t\t<!-- /wp:query-pagination -->\n\t\t\t</div>\n\t\t\t<!-- /wp:group -->\n\t\t</div>\n\t<!-- /wp:query -->\n</main>\n<!-- /wp:group -->\n\n<!-- wp:template-part {\"slug\":\"footer\",\"tagName\":\"footer\"} /-->";
|
|
7
|
-
export declare const functionsPHP = "<?php\n// Flag to prevent recursive execution\n$prevent_recursive_execution = false;\n\nfunction create_or_update_or_delete_pages_from_json() {\n global $prevent_recursive_execution;\n\n // Prevent recursive execution\n if ($prevent_recursive_execution) {\n return;\n }\n\n // Path to the JSON file\n $json_file = get_template_directory() . '/pages.json';\n\n // Check if the file exists\n if (file_exists($json_file)) {\n // Read the JSON file\n $json_data = file_get_contents($json_file);\n $pages = json_decode($json_data, true)['pages'];\n\n // Initialize an array to store pages that are not deleted\n $updated_pages = [];\n\n // Get all pages from the database\n $all_pages = get_pages(array(\n 'post_status' => 'any'\n ));\n\n // Check if $all_pages is an array\n if (is_array($all_pages)) {\n // Create an array of slugs for all pages in the database\n $db_page_slugs = array_map(function($page) {\n return $page->post_name;\n }, $all_pages);\n } else {\n $db_page_slugs = [];\n }\n\n // Loop through the pages array\n foreach ($pages as $page) {\n $page_slug = $page['path'];\n $page_type = $page['type'];\n\n // Use WP_Query to find the page by slug\n $query = new WP_Query(array(\n 'post_type' => 'page',\n 'name' => $page_slug,\n 'post_status' => 'any',\n 'posts_per_page' => 1,\n 'no_found_rows' => true,\n 'ignore_sticky_posts' => true,\n 'update_post_term_cache' => false,\n 'update_post_meta_cache' => false,\n ));\n\n $page_check = !empty($query->posts) ? $query->posts[0] : null;\n\n if ($page_type === 'create') {\n // If the page exists, update it\n if ($page_check) {\n $page_id = $page_check->ID;\n $my_post = array(\n 'ID' => $page_id,\n 'post_title' => ucfirst(str_replace('-', ' ', $page_slug)),\n 'post_name' => $page_slug,\n 'post_status' => 'publish',\n 'post_author' => 1,\n 'post_type' => 'page',\n 'page_template' => $page_slug\n );\n\n // Update the post in the database\n wp_update_post($my_post);\n } else {\n // If the page doesn't exist, create it\n $my_post = array(\n 'post_title' => ucfirst(str_replace('-', ' ', $page_slug)),\n 'post_name' => $page_slug,\n 'post_status' => 'publish',\n 'post_author' => 1,\n 'post_type' => 'page',\n 'page_template' => $page_slug\n );\n\n // Insert the post into the database\n wp_insert_post($my_post);\n }\n\n // Add the page to the updated pages array\n $updated_pages[] = $page;\n } elseif ($page_type === 'delete' && $page_check) {\n // If the page exists and the type is 'delete', delete it\n wp_delete_post($page_check->ID, true);\n\n // Remove the \"create\" entry of the deleted page\n $updated_pages = array_filter($updated_pages, function($p) use ($page_slug) {\n return $p['path'] !== $page_slug;\n });\n }\n }\n\n // Update the JSON file with the remaining pages\n $new_json_data = json_encode(['pages' => $updated_pages], JSON_PRETTY_PRINT);\n file_put_contents($json_file, $new_json_data);\n }\n}\n\n// Hook the function to the 'init' action\nadd_action('init', 'create_or_update_or_delete_pages_from_json');\n\n// Function to remove page from JSON before deletion\nfunction remove_page_from_json_before_delete($post_id) {\n global $prevent_recursive_execution;\n\n // Check if the post type is 'page'\n if (get_post_type($post_id) !== 'page') {\n return;\n }\n\n // Path to the JSON file\n $json_file = get_template_directory() . '/pages.json';\n\n // Check if the file exists\n if (file_exists($json_file)) {\n // Read the JSON file\n $json_data = file_get_contents($json_file);\n $pages = json_decode($json_data, true)['pages'];\n\n // Get the slug of the page being deleted\n $page_slug = get_post_field('post_name', $post_id);\n\n // Remove the page entry from the JSON data\n $updated_pages = array_filter($pages, function($page) use ($page_slug) {\n return $page['path'] !== $page_slug;\n });\n\n // Update the JSON file with the remaining pages\n $new_json_data = json_encode(['pages' => array_values($updated_pages)], JSON_PRETTY_PRINT);\n file_put_contents($json_file, $new_json_data);\n\n // Set the flag to prevent recursive execution\n $prevent_recursive_execution = true;\n }\n}\n\n// Hook the function to the 'wp_trash_post' and 'wp_delete_post' actions\nadd_action('wp_trash_post', 'remove_page_from_json_before_delete', 10, 1);\nadd_action('wp_delete_post', 'remove_page_from_json_before_delete', 10, 1);";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if the given version string is a valid WordPress version.
|
|
3
|
-
*
|
|
4
|
-
* The Regex is based on the releases on https://wordpress.org/download/releases/#betas
|
|
5
|
-
* The version string can be one of the following formats:
|
|
6
|
-
* - "latest"
|
|
7
|
-
* - "trunk"
|
|
8
|
-
* - "nightly"
|
|
9
|
-
* - "x.y" (x and y are integers) e.g. "6.2"
|
|
10
|
-
* - "x.y.z" (x, y and z are integers) e.g. "6.2.1"
|
|
11
|
-
* - "x.y.z-betaN" (N is an integer) e.g. "6.2.1-beta1"
|
|
12
|
-
* - "x.y.z-RCN" (N is an integer) e.g. "6.2-RC1"
|
|
13
|
-
*
|
|
14
|
-
* @param version The version string to check.
|
|
15
|
-
* @returns A boolean value indicating whether the version string is a valid WordPress version.
|
|
16
|
-
*/
|
|
17
|
-
export declare function isValidWordPressSlug(version: string): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function readAndWriteFile(input: string, output: string): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function removeTrailingSlashURL(url: string): string;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare const allowedExtensions: string[];
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param directory
|
|
5
|
-
* @param jsonPath
|
|
6
|
-
*/
|
|
7
|
-
export declare function cleanUnusedFiles(directory: string, jsonPath: string): Promise<void>;
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param folderPath
|
|
11
|
-
* @param outputPath
|
|
12
|
-
*/
|
|
13
|
-
export declare function createPagesJson(folderPath: string, outputPath: string): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* @param filePath
|
|
17
|
-
* @param jsonPath
|
|
18
|
-
*/
|
|
19
|
-
export declare function deletePageFromJson(filePath: string, jsonPath: string): Promise<void>;
|