Skip to content

Commit

Permalink
feat!: rename npm packages (#1943)
Browse files Browse the repository at this point in the history
* feat!: rename npm packages

Fixes #1904

---------

Co-authored-by: Vlad Rindevich <[email protected]>
Co-authored-by: Luciano Vernaschi <[email protected]>
  • Loading branch information
3 people authored Jan 11, 2024
1 parent c42db20 commit 87a02fe
Show file tree
Hide file tree
Showing 362 changed files with 32,376 additions and 42,881 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ packages/ts/*/.coverage
packages/ts/*/.vite
packages/ts/*/types/**
!packages/ts/*/.lintstagedrc.js
scripts/generator/results/
scripts/prepare/results/
packages/java/hilla/*.json
packages/java/hilla-react/*.json
packages/java/hilla/src/main/java/com/vaadin/hilla/theme/
Expand All @@ -50,7 +50,7 @@ packages/java/hilla-react/src/main/java/com/vaadin/hilla/theme/
packages/ts/*/*.tgz

# temporary scripts from platform for preparations
scripts/generator/src/
scripts/prepare/src/

# backup files from some editors
*~
6,401 changes: 3,440 additions & 2,961 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@hilla/hilla",
"name": "@vaadin/hilla",
"private": true,
"description": "Hilla frontend & NodeJS code",
"main": "index.js",
Expand Down Expand Up @@ -33,11 +33,11 @@
"prettier": "$prettier"
},
"devDependencies": {
"@hilla/react-components": "^2.3.0",
"@vaadin/react-components": "^24.4.0-alpha3",
"@nx/js": "^16.10.0",
"@types/karma": "^6.3.5",
"@types/node": "^20.7.1",
"@vaadin/vaadin-lumo-styles": "^24.3.0",
"@vaadin/vaadin-lumo-styles": "^24.4.0-alpha3",
"chai-dom": "^1.11.0",
"compare-versions": "^6.1.0",
"concurrently": "^8.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
*/
@RestController
@Import({ EndpointControllerConfiguration.class, EndpointProperties.class })
@NpmPackage(value = "@hilla/frontend", version = "2.5.2")
@NpmPackage(value = "@vaadin/hilla-core", version = "24.4.0")
public class EndpointController {
private static final Logger LOGGER = LoggerFactory
.getLogger(EndpointController.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import {ConnectClient} from '@hilla/frontend';
import {ConnectClient} from '@vaadin/hilla-core';
const client = new ConnectClient({prefix: '{{PREFIX}}'});
export default client;
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ public boolean shouldAllDefaultsBeDisabled() {

static class PluginsProcessor extends ConfigList.Processor<Plugin> {
static private final List<Plugin> DEFAULTS = List.of(
new Plugin("@hilla/generator-typescript-plugin-backbone"),
new Plugin("@hilla/generator-typescript-plugin-client"),
new Plugin("@hilla/generator-typescript-plugin-barrel"),
new Plugin("@hilla/generator-typescript-plugin-model"),
new Plugin("@hilla/generator-typescript-plugin-push"),
new Plugin("@hilla/generator-typescript-plugin-subtypes"));
new Plugin("@vaadin/hilla-generator-plugin-backbone"),
new Plugin("@vaadin/hilla-generator-plugin-client"),
new Plugin("@vaadin/hilla-generator-plugin-barrel"),
new Plugin("@vaadin/hilla-generator-plugin-model"),
new Plugin("@vaadin/hilla-generator-plugin-push"),
new Plugin("@vaadin/hilla-generator-plugin-subtypes"));

PluginsProcessor() {
super(DEFAULTS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@

import com.vaadin.flow.component.dependency.NpmPackage;

@NpmPackage(value = "@hilla/generator-typescript-core", version = "2.5.2")
@NpmPackage(value = "@hilla/generator-typescript-utils", version = "2.5.2")
@NpmPackage(value = "@hilla/generator-typescript-cli", version = "2.5.2")
@NpmPackage(value = "@hilla/generator-typescript-plugin-client", version = "2.5.2")
@NpmPackage(value = "@hilla/generator-typescript-plugin-backbone", version = "2.5.2")
@NpmPackage(value = "@hilla/generator-typescript-plugin-barrel", version = "2.5.2")
@NpmPackage(value = "@hilla/generator-typescript-plugin-model", version = "2.5.2")
@NpmPackage(value = "@hilla/generator-typescript-plugin-push", version = "2.5.2")
@NpmPackage(value = "@hilla/generator-typescript-plugin-subtypes", version = "2.5.2")
@NpmPackage(value = "@vaadin/hilla-generator-core", version = "24.4.0")
@NpmPackage(value = "@vaadin/hilla-generator-utils", version = "24.4.0")
@NpmPackage(value = "@vaadin/hilla-generator-cli", version = "24.4.0")
@NpmPackage(value = "@vaadin/hilla-generator-plugin-client", version = "24.4.0")
@NpmPackage(value = "@vaadin/hilla-generator-plugin-backbone", version = "24.4.0")
@NpmPackage(value = "@vaadin/hilla-generator-plugin-barrel", version = "24.4.0")
@NpmPackage(value = "@vaadin/hilla-generator-plugin-model", version = "24.4.0")
@NpmPackage(value = "@vaadin/hilla-generator-plugin-push", version = "24.4.0")
@NpmPackage(value = "@vaadin/hilla-generator-plugin-subtypes", version = "24.4.0")
public final class GeneratorProcessor {
private static final Logger logger = LoggerFactory
.getLogger(GeneratorProcessor.class);

private static final Path TSGEN_PATH = Paths.get("node_modules", "@hilla",
"generator-typescript-cli", "bin", "index.js");
private static final Path TSGEN_PATH = Paths.get("node_modules", "@vaadin",
"hilla-generator-cli", "bin", "index.js");
private final Path baseDir;
private final String nodeCommand;
private final Path openAPIFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void should_generate_Two_TypeScriptFiles() throws Exception {

String output = FileUtils.readFileToString(client, "UTF-8");
assertThat(output, containsString(
"import { ConnectClient as ConnectClient_1 } from \"@hilla/frontend\";"));
"import { ConnectClient as ConnectClient_1 } from \"@vaadin/hilla-core\";"));
assertThat(output, containsString(
"const client_1 = new ConnectClient_1({ prefix: \"connect\" });"));
assertThat(output, containsString("export default client_1;"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.junit.jupiter.api.BeforeEach;

import com.vaadin.flow.server.frontend.FrontendUtils;

import com.vaadin.hilla.engine.EngineConfiguration;
import com.vaadin.hilla.parser.testutils.TestEngineConfigurationPathResolver;

Expand Down Expand Up @@ -74,12 +73,9 @@ public void setUpTaskApplication() throws IOException, URISyntaxException,
var npmCmd = Stream.of("npm", "--no-update-notifier", "--no-audit",
"install", "--no-save", "--install-links");

var generatedFiles = Files
.list(packagesDirectory).filter(dirName -> dirName.getFileName()
.toString().startsWith("generator-"))
.map(Path::toString);
var generatorFiles = Files.list(packagesDirectory).map(Path::toString);

var command = Stream.of(shellCmd, npmCmd, generatedFiles)
var command = Stream.of(shellCmd, npmCmd, generatorFiles)
.flatMap(Function.identity()).toList();

var processBuilder = FrontendUtils.createProcessBuilder(command)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,20 +313,26 @@ class SingleModuleTest : AbstractGradleTest() {
"install", "--no-save", "--install-links"
)

val generatedFiles = Files
val hillaCoreAndFormPackages = Stream.of(
packagesDirectory.resolve("core").toString(),
packagesDirectory.resolve("lit-form").toString())

val generatorPackages = Files
.list(packagesDirectory).filter { dirName: Path ->
dirName.fileName
.toString().startsWith("generator-")
}
.map { obj: Path -> obj.toString() }

val command = Stream.of(shellCmd, npmCmd, generatedFiles)
// executing the full command will install necessary npm packages without a package.json file:
val command = Stream.of(shellCmd, npmCmd, hillaCoreAndFormPackages, generatorPackages)
.flatMap(Function.identity()).toList()

val processBuilder = FrontendUtils.createProcessBuilder(command)
.directory(testProject.dir)
.redirectOutput(ProcessBuilder.Redirect.INHERIT)
.redirectError(ProcessBuilder.Redirect.INHERIT)
.redirectErrorStream(true)
val exitCode = processBuilder.start().waitFor()
if (exitCode != 0) {
throw FrontendUtils.CommandExecutionException(exitCode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import com.vaadin.flow.component.dependency.NpmPackage;

/**
* Empty class that adds <code>@hilla/react-auth</code> npm package dependency.
* Empty class that adds <code>@vaadin/hilla-react-auth</code> npm package
* dependency.
*/
@NpmPackage(value = "@hilla/react-auth", version = "2.5.2")
@NpmPackage(value = "@vaadin/hilla-react-auth", version = "24.4.0")
public class HillaReactAuth {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import com.vaadin.flow.component.dependency.NpmPackage;

/**
* Empty class that adds <code>@hilla/react-crud</code> npm package dependency.
* Empty class that adds <code>@vaadin/hilla-react-crud</code> npm package
* dependency.
*/
@NpmPackage(value = "@hilla/react-crud", version = "2.5.2")
@NpmPackage(value = "@vaadin/hilla-react-crud", version = "24.4.0")
public class HillaReactCrud {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import com.vaadin.flow.component.dependency.NpmPackage;

/**
* Empty class that adds <code>@hilla/react-form</code> npm package dependency.
* Empty class that adds <code>@vaadin/hilla-react-form</code> npm package
* dependency.
*/
@NpmPackage(value = "@hilla/react-form", version = "2.5.2")
@NpmPackage(value = "@hilla/form", version = "2.5.2")
@NpmPackage(value = "@vaadin/hilla-react-form", version = "24.4.0")
@NpmPackage(value = "@vaadin/hilla-lit-form", version = "24.4.0")
public class HillaReactForm {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import com.vaadin.flow.component.dependency.NpmPackage;

/**
* Empty class that adds <code>@hilla/form</code> npm package dependency.
* Empty class that adds <code>@vaadin/hilla-lit-form</code> npm package
* dependency.
*/
@NpmPackage(value = "@hilla/form", version = "2.5.2")
@NpmPackage(value = "@vaadin/hilla-lit-form", version = "24.4.0")
public class HillaForm {
}
Loading

0 comments on commit 87a02fe

Please sign in to comment.