-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move ViteProperties in javite-webmvc
- Loading branch information
1 parent
9d535bf
commit 0af42d1
Showing
7 changed files
with
259 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version=0.1.2 | ||
version=0.1.3-alpha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
javite-webmvc-jre8/src/main/java/com/javite/spring/config/ViteProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
package com.javite.spring.config; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* Configuration properties for integrating Vite with Java web applications. | ||
* | ||
* <p>This class provides properties that can be used to configure the Vite integration, | ||
* including settings for the Vite manifest file, local development server URL, resource paths, and debug mode.</p> | ||
* | ||
* <p>These properties can be configured in the application's configuration file (e.g., `application.properties` | ||
* or `application.yml` for Spring applications) and are typically used by integration modules to facilitate the setup and use of Vite in Java web | ||
* applications.</p> | ||
* | ||
* <p>Usage example:</p> | ||
* <pre class="code"> | ||
* vite.debug=true | ||
* vite.manifestPath=/WEB-INF/dist/.vite/manifest.json | ||
* vite.localServerUrl=http://localhost:5173 | ||
* vite.resourcePath=/resources | ||
* </pre> | ||
*/ | ||
@Component | ||
@ConfigurationProperties(prefix = "vite") | ||
public class ViteProperties { | ||
|
||
/** | ||
* Whether to enable debug mode in Vite. | ||
* <p>Default is {@code true}.</p> | ||
*/ | ||
private boolean debug = true; | ||
|
||
/** | ||
* The path of the manifest file generated by Vite. | ||
* <p>Default is {@code /WEB-INF/dist/.vite/manifest.json}.</p> | ||
*/ | ||
private String manifestPath = "/WEB-INF/dist/.vite/manifest.json"; | ||
|
||
/** | ||
* The local server URL for Vite development. | ||
* <p>Default is {@code http://localhost:5173}.</p> | ||
*/ | ||
private String localServerUrl = "http://localhost:5173"; | ||
|
||
/** | ||
* The path to the resources. | ||
* <p>Default is {@code /resources}.</p> | ||
*/ | ||
private String resourcePath = "/resources"; | ||
|
||
/** | ||
* Returns whether debug mode is enabled. | ||
* | ||
* @return {@code true} if debug mode is enabled, {@code false} otherwise | ||
*/ | ||
public boolean isDebug() { | ||
return debug; | ||
} | ||
|
||
/** | ||
* Sets whether debug mode is enabled. | ||
* | ||
* @param debug {@code true} to enable debug mode, {@code false} to disable it | ||
*/ | ||
public void setDebug(boolean debug) { | ||
this.debug = debug; | ||
} | ||
|
||
/** | ||
* Returns the path of the manifest file generated by Vite. | ||
* | ||
* @return the manifest file path | ||
*/ | ||
public String getManifestPath() { | ||
return manifestPath; | ||
} | ||
|
||
/** | ||
* Sets the path of the manifest file generated by Vite. | ||
* | ||
* @param manifestPath the manifest file path | ||
*/ | ||
public void setManifestPath(String manifestPath) { | ||
this.manifestPath = manifestPath; | ||
} | ||
|
||
/** | ||
* Returns the local server URL for Vite development. | ||
* | ||
* @return the local server URL | ||
*/ | ||
public String getLocalServerUrl() { | ||
return localServerUrl; | ||
} | ||
|
||
/** | ||
* Sets the local server URL for Vite development. | ||
* | ||
* @param localServerUrl the local server URL | ||
*/ | ||
public void setLocalServerUrl(String localServerUrl) { | ||
this.localServerUrl = localServerUrl; | ||
} | ||
|
||
/** | ||
* Returns the path to the resources. | ||
* | ||
* @return the resource path | ||
*/ | ||
public String getResourcePath() { | ||
return resourcePath; | ||
} | ||
|
||
/** | ||
* Sets the path to the resources. | ||
* | ||
* @param resourcePath the resource path | ||
*/ | ||
public void setResourcePath(String resourcePath) { | ||
this.resourcePath = resourcePath; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
javite-webmvc/src/main/java/com/javite/spring/config/ViteProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
package com.javite.spring.config; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* Configuration properties for integrating Vite with Java web applications. | ||
* | ||
* <p>This class provides properties that can be used to configure the Vite integration, | ||
* including settings for the Vite manifest file, local development server URL, resource paths, and debug mode.</p> | ||
* | ||
* <p>These properties can be configured in the application's configuration file (e.g., `application.properties` | ||
* or `application.yml` for Spring applications) and are typically used by integration modules to facilitate the setup and use of Vite in Java web | ||
* applications.</p> | ||
* | ||
* <p>Usage example:</p> | ||
* <pre class="code"> | ||
* vite.debug=true | ||
* vite.manifestPath=/WEB-INF/dist/.vite/manifest.json | ||
* vite.localServerUrl=http://localhost:5173 | ||
* vite.resourcePath=/resources | ||
* </pre> | ||
*/ | ||
@Component | ||
@ConfigurationProperties(prefix = "vite") | ||
public class ViteProperties { | ||
|
||
/** | ||
* Whether to enable debug mode in Vite. | ||
* <p>Default is {@code true}.</p> | ||
*/ | ||
private boolean debug = true; | ||
|
||
/** | ||
* The path of the manifest file generated by Vite. | ||
* <p>Default is {@code /WEB-INF/dist/.vite/manifest.json}.</p> | ||
*/ | ||
private String manifestPath = "/WEB-INF/dist/.vite/manifest.json"; | ||
|
||
/** | ||
* The local server URL for Vite development. | ||
* <p>Default is {@code http://localhost:5173}.</p> | ||
*/ | ||
private String localServerUrl = "http://localhost:5173"; | ||
|
||
/** | ||
* The path to the resources. | ||
* <p>Default is {@code /resources}.</p> | ||
*/ | ||
private String resourcePath = "/resources"; | ||
|
||
/** | ||
* Returns whether debug mode is enabled. | ||
* | ||
* @return {@code true} if debug mode is enabled, {@code false} otherwise | ||
*/ | ||
public boolean isDebug() { | ||
return debug; | ||
} | ||
|
||
/** | ||
* Sets whether debug mode is enabled. | ||
* | ||
* @param debug {@code true} to enable debug mode, {@code false} to disable it | ||
*/ | ||
public void setDebug(boolean debug) { | ||
this.debug = debug; | ||
} | ||
|
||
/** | ||
* Returns the path of the manifest file generated by Vite. | ||
* | ||
* @return the manifest file path | ||
*/ | ||
public String getManifestPath() { | ||
return manifestPath; | ||
} | ||
|
||
/** | ||
* Sets the path of the manifest file generated by Vite. | ||
* | ||
* @param manifestPath the manifest file path | ||
*/ | ||
public void setManifestPath(String manifestPath) { | ||
this.manifestPath = manifestPath; | ||
} | ||
|
||
/** | ||
* Returns the local server URL for Vite development. | ||
* | ||
* @return the local server URL | ||
*/ | ||
public String getLocalServerUrl() { | ||
return localServerUrl; | ||
} | ||
|
||
/** | ||
* Sets the local server URL for Vite development. | ||
* | ||
* @param localServerUrl the local server URL | ||
*/ | ||
public void setLocalServerUrl(String localServerUrl) { | ||
this.localServerUrl = localServerUrl; | ||
} | ||
|
||
/** | ||
* Returns the path to the resources. | ||
* | ||
* @return the resource path | ||
*/ | ||
public String getResourcePath() { | ||
return resourcePath; | ||
} | ||
|
||
/** | ||
* Sets the path to the resources. | ||
* | ||
* @param resourcePath the resource path | ||
*/ | ||
public void setResourcePath(String resourcePath) { | ||
this.resourcePath = resourcePath; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters