@phcdevworks/spectre-shell-wordpress 1.1.0
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.
Potentially problematic release.
This version of @phcdevworks/spectre-shell-wordpress might be problematic. Click here for more details.
- package/.devcontainer/devcontainer.json +40 -0
- package/.gitattributes +203 -0
- package/.github/FUNDING.yml +6 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +23 -0
- package/.github/ISSUE_TEMPLATE/docs_request.md +11 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +13 -0
- package/.github/dependabot.yml +12 -0
- package/.github/pull_request_template.md +15 -0
- package/.vscode/extensions.json +31 -0
- package/CHANGELOG.md +80 -0
- package/CODE_OF_CONDUCT.md +80 -0
- package/CONTRIBUTING.md +194 -0
- package/LICENSE +21 -0
- package/README.md +338 -0
- package/SECURITY.md +94 -0
- package/index.html +13 -0
- package/package.json +52 -0
- package/public/vite.svg +1 -0
- package/spectre-shell-wordpress.code-workspace +8 -0
- package/spectre-theme/README.md +33 -0
- package/spectre-theme/footer.php +9 -0
- package/spectre-theme/functions.php +89 -0
- package/spectre-theme/header.php +35 -0
- package/spectre-theme/index.php +60 -0
- package/spectre-theme/style.css +20 -0
- package/src/README.md +56 -0
- package/src/js/main.ts +11 -0
- package/src/styles/main.css +12 -0
- package/tailwind.config.ts +12 -0
- package/tsconfig.json +33 -0
- package/vite.config.ts +38 -0
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@phcdevworks/spectre-shell-wordpress",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Official Vite template for WordPress theme development with TypeScript and Tailwind CSS 4",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"vite-template",
|
|
8
|
+
"vite",
|
|
9
|
+
"wordpress",
|
|
10
|
+
"wordpress-theme",
|
|
11
|
+
"tailwindcss",
|
|
12
|
+
"typescript",
|
|
13
|
+
"phcdevworks",
|
|
14
|
+
"spectre"
|
|
15
|
+
],
|
|
16
|
+
"author": "PHCDevworks",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"funding": [
|
|
19
|
+
{
|
|
20
|
+
"type": "github",
|
|
21
|
+
"url": "https://github.com/sponsors/phcdevworks"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "buymeacoffee",
|
|
25
|
+
"url": "https://buymeacoffee.com/phcdevworks"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/phcdevworks/spectre-shell-wordpress.git"
|
|
31
|
+
},
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/phcdevworks/spectre-shell-wordpress/issues"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://phcdevworks.com",
|
|
36
|
+
"scripts": {
|
|
37
|
+
"dev": "vite",
|
|
38
|
+
"build": "tsc && vite build",
|
|
39
|
+
"preview": "vite preview"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "^25.1.0",
|
|
43
|
+
"autoprefixer": "^10.4.23",
|
|
44
|
+
"postcss": "^8.5.6",
|
|
45
|
+
"tailwindcss": "^4.1.18",
|
|
46
|
+
"typescript": "~5.9.3",
|
|
47
|
+
"vite": "^7.3.1"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@phcdevworks/spectre-ui": "^0.4.1"
|
|
51
|
+
}
|
|
52
|
+
}
|
package/public/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Vite WordPress Theme Builder Template
|
|
2
|
+
|
|
3
|
+
This directory is a **TEMPLATE** for creating WordPress themes with Vite.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
1. Customize `style.css` with your theme details
|
|
8
|
+
2. Replace `spectre_shell` prefix in `functions.php` with your theme slug
|
|
9
|
+
3. Modify templates (index.php, header.php, footer.php) as needed
|
|
10
|
+
4. Run `npm run dev` in the project root during development
|
|
11
|
+
5. Run `npm run build` before deploying
|
|
12
|
+
|
|
13
|
+
## What Gets Deployed
|
|
14
|
+
|
|
15
|
+
Deploy this entire `spectre-theme/` folder to your WordPress installation:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
wp-content/themes/your-theme-name/
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The `dist/` folder will be auto-generated by Vite with your compiled assets.
|
|
22
|
+
|
|
23
|
+
## Customization Checklist
|
|
24
|
+
|
|
25
|
+
- [ ] Update `style.css` header (Theme Name, Author, Description, Text Domain)
|
|
26
|
+
- [ ] Replace all `spectre_shell` instances with your slug
|
|
27
|
+
- [ ] Update function prefixes in `functions.php`
|
|
28
|
+
- [ ] Customize templates (header.php, footer.php, index.php)
|
|
29
|
+
- [ ] Add additional WordPress templates as needed
|
|
30
|
+
- [ ] Update navigation menu locations
|
|
31
|
+
- [ ] Add custom post types/taxonomies if needed
|
|
32
|
+
|
|
33
|
+
See the main README.md in project root for full documentation.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<footer class="site-footer bg-gray-800 text-white p-8 mt-12">
|
|
2
|
+
<div class="container mx-auto text-center">
|
|
3
|
+
<p>© <?php echo date('Y'); ?> <?php bloginfo('name'); ?>. All rights reserved.</p>
|
|
4
|
+
</div>
|
|
5
|
+
</footer>
|
|
6
|
+
|
|
7
|
+
<?php wp_footer(); ?>
|
|
8
|
+
</body>
|
|
9
|
+
</html>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Theme Functions - Vite WordPress Template
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: This is a template file. You should:
|
|
6
|
+
* 1. Replace 'spectre_shell' with your theme slug throughout this file
|
|
7
|
+
* 2. Replace function prefixes (e.g., spectre_shell_setup -> yourtheme_setup)
|
|
8
|
+
* 3. Update text domain in translation functions
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
if (!defined('ABSPATH')) exit;
|
|
12
|
+
|
|
13
|
+
// Theme setup
|
|
14
|
+
function spectre_shell_setup() {
|
|
15
|
+
add_theme_support('title-tag');
|
|
16
|
+
add_theme_support('post-thumbnails');
|
|
17
|
+
add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
|
|
18
|
+
add_theme_support('custom-logo');
|
|
19
|
+
|
|
20
|
+
register_nav_menus(array(
|
|
21
|
+
'primary' => __('Primary Menu', 'spectre-shell'),
|
|
22
|
+
));
|
|
23
|
+
}
|
|
24
|
+
add_action('after_setup_theme', 'spectre_shell_setup');
|
|
25
|
+
|
|
26
|
+
// Enqueue Vite assets
|
|
27
|
+
function spectre_shell_enqueue_assets() {
|
|
28
|
+
$is_dev = function_exists('wp_get_environment_type')
|
|
29
|
+
? wp_get_environment_type() === 'development'
|
|
30
|
+
: (defined('WP_ENV') && WP_ENV === 'development');
|
|
31
|
+
$vite_server = defined('VITE_DEV_SERVER') ? rtrim(VITE_DEV_SERVER, '/') : 'http://localhost:5173';
|
|
32
|
+
|
|
33
|
+
if ($is_dev) {
|
|
34
|
+
// Development mode - load from Vite dev server
|
|
35
|
+
wp_enqueue_script(
|
|
36
|
+
'vite-client',
|
|
37
|
+
$vite_server . '/@vite/client',
|
|
38
|
+
array(),
|
|
39
|
+
null,
|
|
40
|
+
false
|
|
41
|
+
);
|
|
42
|
+
wp_script_add_data('vite-client', 'type', 'module');
|
|
43
|
+
|
|
44
|
+
wp_enqueue_script(
|
|
45
|
+
'spectre-shell-main',
|
|
46
|
+
$vite_server . '/src/js/main.ts',
|
|
47
|
+
array('vite-client'),
|
|
48
|
+
null,
|
|
49
|
+
true
|
|
50
|
+
);
|
|
51
|
+
wp_script_add_data('spectre-shell-main', 'type', 'module');
|
|
52
|
+
} else {
|
|
53
|
+
// Production mode - load built assets with manifest
|
|
54
|
+
$manifest_path = get_template_directory() . '/dist/.vite/manifest.json';
|
|
55
|
+
if (!file_exists($manifest_path)) {
|
|
56
|
+
if (defined('WP_DEBUG') && WP_DEBUG) {
|
|
57
|
+
error_log('Vite manifest not found: ' . $manifest_path);
|
|
58
|
+
}
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
$manifest = json_decode(file_get_contents($manifest_path), true);
|
|
63
|
+
|
|
64
|
+
// Enqueue CSS
|
|
65
|
+
if (isset($manifest['src/styles/main.css'])) {
|
|
66
|
+
$css_file = $manifest['src/styles/main.css']['file'];
|
|
67
|
+
wp_enqueue_style(
|
|
68
|
+
'spectre-shell-style',
|
|
69
|
+
get_template_directory_uri() . '/dist/' . $css_file,
|
|
70
|
+
array(),
|
|
71
|
+
null
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Enqueue JS
|
|
76
|
+
if (isset($manifest['src/js/main.ts'])) {
|
|
77
|
+
$js_file = $manifest['src/js/main.ts']['file'];
|
|
78
|
+
wp_enqueue_script(
|
|
79
|
+
'spectre-shell-main',
|
|
80
|
+
get_template_directory_uri() . '/dist/' . $js_file,
|
|
81
|
+
array(),
|
|
82
|
+
null,
|
|
83
|
+
true
|
|
84
|
+
);
|
|
85
|
+
wp_script_add_data('spectre-shell-main', 'type', 'module');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
add_action('wp_enqueue_scripts', 'spectre_shell_enqueue_assets');
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html <?php language_attributes(); ?>>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="<?php bloginfo('charset'); ?>">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<?php wp_head(); ?>
|
|
7
|
+
</head>
|
|
8
|
+
<body <?php body_class(); ?>>
|
|
9
|
+
<?php wp_body_open(); ?>
|
|
10
|
+
|
|
11
|
+
<header class="site-header bg-gray-800 text-white p-4">
|
|
12
|
+
<div class="container mx-auto flex justify-between items-center">
|
|
13
|
+
<div class="site-branding">
|
|
14
|
+
<?php if (has_custom_logo()) : ?>
|
|
15
|
+
<?php the_custom_logo(); ?>
|
|
16
|
+
<?php else : ?>
|
|
17
|
+
<h1 class="text-2xl font-bold">
|
|
18
|
+
<a href="<?php echo esc_url(home_url('/')); ?>" class="text-white hover:text-gray-300">
|
|
19
|
+
<?php bloginfo('name'); ?>
|
|
20
|
+
</a>
|
|
21
|
+
</h1>
|
|
22
|
+
<?php endif; ?>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<nav class="main-navigation">
|
|
26
|
+
<?php
|
|
27
|
+
wp_nav_menu(array(
|
|
28
|
+
'theme_location' => 'primary',
|
|
29
|
+
'menu_class' => 'flex space-x-4',
|
|
30
|
+
'container' => false,
|
|
31
|
+
));
|
|
32
|
+
?>
|
|
33
|
+
</nav>
|
|
34
|
+
</div>
|
|
35
|
+
</header>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<?php get_header(); ?>
|
|
2
|
+
|
|
3
|
+
<main class="site-main container mx-auto px-4 py-8">
|
|
4
|
+
<?php if (have_posts()) : ?>
|
|
5
|
+
<div class="posts-grid grid gap-8 md:grid-cols-2 lg:grid-cols-3">
|
|
6
|
+
<?php while (have_posts()) : the_post(); ?>
|
|
7
|
+
<article id="post-<?php the_ID(); ?>" <?php post_class('bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow'); ?>>
|
|
8
|
+
<?php if (has_post_thumbnail()) : ?>
|
|
9
|
+
<div class="post-thumbnail">
|
|
10
|
+
<a href="<?php the_permalink(); ?>">
|
|
11
|
+
<?php the_post_thumbnail('medium', array('class' => 'w-full h-48 object-cover')); ?>
|
|
12
|
+
</a>
|
|
13
|
+
</div>
|
|
14
|
+
<?php endif; ?>
|
|
15
|
+
|
|
16
|
+
<div class="p-6">
|
|
17
|
+
<h2 class="text-2xl font-bold mb-2">
|
|
18
|
+
<a href="<?php the_permalink(); ?>" class="text-gray-800 hover:text-blue-600">
|
|
19
|
+
<?php the_title(); ?>
|
|
20
|
+
</a>
|
|
21
|
+
</h2>
|
|
22
|
+
|
|
23
|
+
<div class="post-meta text-sm text-gray-600 mb-4">
|
|
24
|
+
<time datetime="<?php echo get_the_date('c'); ?>">
|
|
25
|
+
<?php echo get_the_date(); ?>
|
|
26
|
+
</time>
|
|
27
|
+
<span class="mx-2">•</span>
|
|
28
|
+
<span><?php the_author(); ?></span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="post-excerpt text-gray-700">
|
|
32
|
+
<?php the_excerpt(); ?>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<a href="<?php the_permalink(); ?>" class="inline-block mt-4 text-blue-600 hover:text-blue-800 font-semibold">
|
|
36
|
+
Read More →
|
|
37
|
+
</a>
|
|
38
|
+
</div>
|
|
39
|
+
</article>
|
|
40
|
+
<?php endwhile; ?>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="pagination mt-12">
|
|
44
|
+
<?php
|
|
45
|
+
the_posts_pagination(array(
|
|
46
|
+
'mid_size' => 2,
|
|
47
|
+
'prev_text' => __('← Previous', 'spectre-shell'),
|
|
48
|
+
'next_text' => __('Next →', 'spectre-shell'),
|
|
49
|
+
));
|
|
50
|
+
?>
|
|
51
|
+
</div>
|
|
52
|
+
<?php else : ?>
|
|
53
|
+
<div class="no-posts text-center py-12">
|
|
54
|
+
<h2 class="text-3xl font-bold mb-4"><?php _e('No posts found', 'spectre-shell'); ?></h2>
|
|
55
|
+
<p class="text-gray-600"><?php _e('Sorry, no posts were found.', 'spectre-shell'); ?></p>
|
|
56
|
+
</div>
|
|
57
|
+
<?php endif; ?>
|
|
58
|
+
</main>
|
|
59
|
+
|
|
60
|
+
<?php get_footer(); ?>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Theme Name: Your Theme Name
|
|
3
|
+
Theme URI: https://yoursite.com
|
|
4
|
+
Author: Your Name
|
|
5
|
+
Author URI: https://yoursite.com
|
|
6
|
+
Description: A modern WordPress theme built with Vite, TypeScript, and Tailwind CSS
|
|
7
|
+
Version: 1.0.0
|
|
8
|
+
License: GNU General Public License v2 or later
|
|
9
|
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
10
|
+
Text Domain: your-theme-slug
|
|
11
|
+
|
|
12
|
+
Tags: vite, tailwind, typescript, modern, starter-theme
|
|
13
|
+
Requires at least: 6.0
|
|
14
|
+
Tested up to: 6.7
|
|
15
|
+
Requires PHP: 7.4
|
|
16
|
+
|
|
17
|
+
NOTE: This is a TEMPLATE. Customize all the above fields for your theme.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/* This file is required by WordPress but styles are loaded from Vite build */
|
package/src/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Source Files - Vite WordPress Template
|
|
2
|
+
|
|
3
|
+
This directory contains your development source files that Vite will compile.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/
|
|
9
|
+
├── js/
|
|
10
|
+
│ └── main.ts # JavaScript/TypeScript entry point
|
|
11
|
+
├── styles/
|
|
12
|
+
│ └── main.css # CSS entry point (includes Tailwind)
|
|
13
|
+
└── tokens/ # Design tokens, variables, etc. (optional)
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Development
|
|
17
|
+
|
|
18
|
+
- Edit files here during development
|
|
19
|
+
- Changes trigger HMR when running `npm run dev`
|
|
20
|
+
- Compiled output goes to `spectre-theme/dist/`
|
|
21
|
+
|
|
22
|
+
## Adding Files
|
|
23
|
+
|
|
24
|
+
### JavaScript/TypeScript
|
|
25
|
+
|
|
26
|
+
Create new files in `js/` and import them in `main.ts`:
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import "./components/slider";
|
|
30
|
+
import "./utils/helpers";
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### CSS
|
|
34
|
+
|
|
35
|
+
Create new stylesheets and import in `main.css`:
|
|
36
|
+
|
|
37
|
+
```css
|
|
38
|
+
@import "tailwindcss";
|
|
39
|
+
@import "./components/buttons.css";
|
|
40
|
+
@import "./layouts/grid.css";
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Assets
|
|
44
|
+
|
|
45
|
+
For images, fonts, etc.:
|
|
46
|
+
|
|
47
|
+
1. Import in JS/TS files
|
|
48
|
+
2. Or place in `public/` folder for static assets
|
|
49
|
+
3. Or reference in CSS with relative paths
|
|
50
|
+
|
|
51
|
+
## Notes
|
|
52
|
+
|
|
53
|
+
- This folder is NOT deployed to WordPress
|
|
54
|
+
- Only the compiled output in `spectre-theme/dist/` is deployed
|
|
55
|
+
- Keep this folder in version control
|
|
56
|
+
- Add `spectre-theme/dist/` to `.gitignore`
|
package/src/js/main.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Main Stylesheet */
|
|
2
|
+
@import 'tailwindcss';
|
|
3
|
+
|
|
4
|
+
/* Optional: Spectre UI */
|
|
5
|
+
/* @import "@phcdevworks/spectre-ui/base.css"; */
|
|
6
|
+
/* @import "@phcdevworks/spectre-ui/components.css"; */
|
|
7
|
+
/* @import "@phcdevworks/spectre-ui/utilities.css"; */
|
|
8
|
+
|
|
9
|
+
/* Base Styles */
|
|
10
|
+
:root {
|
|
11
|
+
--font-sans: system-ui, -apple-system, sans-serif;
|
|
12
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": [
|
|
7
|
+
"ES2022",
|
|
8
|
+
"DOM",
|
|
9
|
+
"DOM.Iterable"
|
|
10
|
+
],
|
|
11
|
+
"types": [
|
|
12
|
+
"vite/client",
|
|
13
|
+
"node"
|
|
14
|
+
],
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
/* Bundler mode */
|
|
17
|
+
"moduleResolution": "bundler",
|
|
18
|
+
"allowImportingTsExtensions": true,
|
|
19
|
+
"verbatimModuleSyntax": true,
|
|
20
|
+
"moduleDetection": "force",
|
|
21
|
+
"noEmit": true,
|
|
22
|
+
/* Linting */
|
|
23
|
+
"strict": true,
|
|
24
|
+
"noUnusedLocals": true,
|
|
25
|
+
"noUnusedParameters": true,
|
|
26
|
+
"erasableSyntaxOnly": true,
|
|
27
|
+
"noFallthroughCasesInSwitch": true,
|
|
28
|
+
"noUncheckedSideEffectImports": true
|
|
29
|
+
},
|
|
30
|
+
"include": [
|
|
31
|
+
"src"
|
|
32
|
+
]
|
|
33
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { resolve } from 'node:path'
|
|
2
|
+
import { fileURLToPath } from 'node:url'
|
|
3
|
+
import { defineConfig } from 'vite'
|
|
4
|
+
|
|
5
|
+
const __dirname = fileURLToPath(new URL('.', import.meta.url))
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
build: {
|
|
9
|
+
outDir: 'spectre-theme/dist',
|
|
10
|
+
emptyOutDir: true,
|
|
11
|
+
manifest: true,
|
|
12
|
+
rollupOptions: {
|
|
13
|
+
input: {
|
|
14
|
+
main: resolve(__dirname, 'src/js/main.ts'),
|
|
15
|
+
style: resolve(__dirname, 'src/styles/main.css')
|
|
16
|
+
},
|
|
17
|
+
output: {
|
|
18
|
+
entryFileNames: 'js/[name].[hash].js',
|
|
19
|
+
chunkFileNames: 'js/[name].[hash].js',
|
|
20
|
+
assetFileNames: (assetInfo: { name?: string }) => {
|
|
21
|
+
if (assetInfo.name?.endsWith('.css')) {
|
|
22
|
+
return 'css/[name].[hash][extname]'
|
|
23
|
+
}
|
|
24
|
+
return 'assets/[name].[hash][extname]'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
server: {
|
|
30
|
+
port: 5173,
|
|
31
|
+
strictPort: true,
|
|
32
|
+
cors: true,
|
|
33
|
+
hmr: {
|
|
34
|
+
host: 'localhost',
|
|
35
|
+
protocol: 'ws'
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
})
|