-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR gives a concrete structure to JsPlugin; name, version, main, root, and paths. All existing means of configuration for JS plugins delegates to JsPlugin. Java jars can now provide JS plugins with this change as well. This is also a _partial_ improvement for #4817 (JS Plugins development is slow), in that JsPlugin paths is a mean to reduce the scope of files that needs to be copied. This is _not_ a full solution (which may involve routing paths in Jetty that lead directly to the resources as configured via the JS plugins). For NPM packages, this PR takes a practical approach as opposed to a "perfect" approach; we are requiring that all "real" files be included under the top-level directory as specified by package.json/main. For example, if main is "build/index.js", we'll include everything under "build/". If main is "dist/bundle/index.js", we'll include everything under "dist/". Adds testing, fixes #4893
- Loading branch information
1 parent
482cd8e
commit aadf4c8
Showing
47 changed files
with
1,200 additions
and
389 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,3 +1,3 @@ | ||
io.deephaven.project.ProjectType=DOCKER_REGISTRY | ||
deephaven.registry.imageName=ghcr.io/deephaven/server-base:edge | ||
deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:bd59f63831db8ff86c3ebab21ffecd1804e58dcfaaf08a67bf0c2b320a2ce179 | ||
deephaven.registry.imageId=ghcr.io/deephaven/server-base@sha256:8f9b993a4ce7c78b50b869be840241a0a9d19d3f4f35601f20cd05475abd5753 |
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
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
15 changes: 0 additions & 15 deletions
15
plugin/src/main/java/io/deephaven/plugin/js/JsPluginBase.java
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
plugin/src/main/java/io/deephaven/plugin/js/JsPluginManifestPath.java
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
plugin/src/main/java/io/deephaven/plugin/js/JsPluginPackagePath.java
This file was deleted.
Oops, something went wrong.
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,53 @@ | ||
/** | ||
* Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending | ||
*/ | ||
package io.deephaven.plugin.js; | ||
|
||
import java.nio.file.Path; | ||
|
||
/** | ||
* The subset of paths to serve, see {@link JsPlugin#paths()}. | ||
*/ | ||
public interface Paths { | ||
|
||
/** | ||
* Includes all paths. | ||
* | ||
* @return the paths | ||
*/ | ||
static Paths all() { | ||
return PathsAll.ALL; | ||
} | ||
|
||
/** | ||
* Includes only the paths that are prefixed by {@code prefix}. | ||
* | ||
* @param prefix the prefix | ||
* @return the paths | ||
*/ | ||
static Paths ofPrefixes(Path prefix) { | ||
// Note: we have specific overload for single element to explicitly differentiate from Iterable overload since | ||
// Path extends Iterable<Path>. | ||
return PathsPrefixes.builder().addPrefixes(prefix).build(); | ||
} | ||
|
||
/** | ||
* Includes only the paths that are prefixed by one of {@code prefixes}. | ||
* | ||
* @param prefixes the prefixes | ||
* @return the paths | ||
*/ | ||
static Paths ofPrefixes(Path... prefixes) { | ||
return PathsPrefixes.builder().addPrefixes(prefixes).build(); | ||
} | ||
|
||
/** | ||
* Includes only the paths that are prefixed by one of {@code prefixes}. | ||
* | ||
* @param prefixes the prefixes | ||
* @return the paths | ||
*/ | ||
static Paths ofPrefixes(Iterable<? extends Path> prefixes) { | ||
return PathsPrefixes.builder().addAllPrefixes(prefixes).build(); | ||
} | ||
} |
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,15 @@ | ||
/** | ||
* Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending | ||
*/ | ||
package io.deephaven.plugin.js; | ||
|
||
import java.nio.file.Path; | ||
|
||
enum PathsAll implements PathsInternal { | ||
ALL; | ||
|
||
@Override | ||
public boolean matches(Path path) { | ||
return true; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
plugin/src/main/java/io/deephaven/plugin/js/PathsInternal.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,10 @@ | ||
/** | ||
* Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending | ||
*/ | ||
package io.deephaven.plugin.js; | ||
|
||
import java.nio.file.PathMatcher; | ||
|
||
interface PathsInternal extends Paths, PathMatcher { | ||
|
||
} |
Oops, something went wrong.