diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a9323c..7a9f5c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 0.1.0-alpha.1 (npm prerelease) -- Published the first npm alpha as `@seriohhhh/java-npm`. Install it with `npm install -g @seriohhhh/java-npm@alpha` to get the `jpm` command. [Release notes](docs/releases/0.1.0-alpha.1.md) +- Published the first npm alpha as `@seriohhhh/java-npm`, then as the unscoped `java-npm-cli`. Install it with `npm install -g java-npm-cli@alpha` to get the `jpm` command. [Release notes](docs/releases/0.1.0-alpha.1.md) ## 0.1.0-alpha.0 (Homebrew prerelease) diff --git a/README.md b/README.md index 6ca4f13..a944e65 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,10 @@ If you already reach for `npm install` and `npm run dev`, jpm gives you a famili -Install the [npm alpha](https://www.npmjs.com/package/@seriohhhh/java-npm) on macOS or Linux with Node.js 22 or later. +Install the [npm alpha](https://www.npmjs.com/package/java-npm-cli) on macOS or Linux with Node.js 22 or later. ```sh -npm install --global @seriohhhh/java-npm@alpha +npm install --global java-npm-cli@alpha ``` Prefer Homebrew? `brew install coderserio/tap/jpm` includes Node. The [tap](https://github.com/CoderSerio/homebrew-tap/blob/main/Formula/jpm.rb) currently ships `0.1.0-alpha.0` and npm ships `0.1.0-alpha.1`. diff --git a/README.zh-CN.md b/README.zh-CN.md index e0c632c..a331d84 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -20,10 +20,10 @@ -在 macOS 或 Linux 上准备好 Node.js 22 或更高版本,然后安装 [npm 上的 alpha 版](https://www.npmjs.com/package/@seriohhhh/java-npm)。 +在 macOS 或 Linux 上准备好 Node.js 22 或更高版本,然后安装 [npm 上的 alpha 版](https://www.npmjs.com/package/java-npm-cli)。 ```sh -npm install --global @seriohhhh/java-npm@alpha +npm install --global java-npm-cli@alpha ``` 习惯 Homebrew 的话,`brew install coderserio/tap/jpm` 会一起装好 Node。当前 [Homebrew 配方](https://github.com/CoderSerio/homebrew-tap/blob/main/Formula/jpm.rb)提供 `0.1.0-alpha.0`,npm 提供 `0.1.0-alpha.1`。 diff --git a/assets/brand/jpm-icon.png b/assets/brand/jpm-icon.png index f6bac3d..44c05cf 100644 Binary files a/assets/brand/jpm-icon.png and b/assets/brand/jpm-icon.png differ diff --git a/assets/brand/jpm-readme-dark.png b/assets/brand/jpm-readme-dark.png index 8527ef2..4fd91ca 100644 Binary files a/assets/brand/jpm-readme-dark.png and b/assets/brand/jpm-readme-dark.png differ diff --git a/assets/brand/jpm-readme.png b/assets/brand/jpm-readme.png index 9f45469..61eaf91 100644 Binary files a/assets/brand/jpm-readme.png and b/assets/brand/jpm-readme.png differ diff --git a/assets/brand/jpm.svg b/assets/brand/jpm.svg index 5e8c274..fec3a6a 100644 --- a/assets/brand/jpm.svg +++ b/assets/brand/jpm.svg @@ -1,7 +1,14 @@ - + jpm + - + + + + + - + + + diff --git a/docs/cli.md b/docs/cli.md index 90aaf7e..6f7ba62 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -1,6 +1,6 @@ # CLI reference -The npm package `@seriohhhh/java-npm` installs the `jpm` command. Use `jpm --help` and `jpm --version` to inspect the installed CLI. Node 22+ and macOS/Linux are required. +The npm package `java-npm-cli` installs the `jpm` command. Use `jpm --help` and `jpm --version` to inspect the installed CLI. Node 22+ and macOS/Linux are required. Unless noted otherwise, project commands run from the directory containing the project's `package.json` and `mvnw`. diff --git a/docs/launch/README.md b/docs/launch/README.md index 4450f28..8325d1c 100644 --- a/docs/launch/README.md +++ b/docs/launch/README.md @@ -5,7 +5,7 @@ Use these materials to introduce jpm or record a short walkthrough. The first np ## Public links - [Product page](https://coderserio.github.io/java-npm/) for an introduction to the workflow -- [npm package](https://www.npmjs.com/package/@seriohhhh/java-npm) for installation +- [npm package](https://www.npmjs.com/package/java-npm-cli) for installation - [First npm alpha release notes](../releases/0.1.0-alpha.1.md) for the source revision and verification details - [GitHub repository](https://github.com/CoderSerio/java-npm) for code and issue reports diff --git a/docs/launch/announcement.md b/docs/launch/announcement.md index 60f5663..3692973 100644 --- a/docs/launch/announcement.md +++ b/docs/launch/announcement.md @@ -9,7 +9,7 @@ Draft copy for the first npm alpha. [Release notes](../releases/0.1.0-alpha.1.md 想法很直接:用 `create`、`add`、`dev`、`test`、`build` 这一组熟悉的命令完成日常开发,把 Java 依赖写在 `package.json` 里。jpm 生成标准 POM,依赖解析和构建仍然交给 Maven。 ```sh -npm install --global @seriohhhh/java-npm@alpha +npm install --global java-npm-cli@alpha jpm create my-app --java 21 -y cd my-app jpm jdk use 21 @@ -21,7 +21,7 @@ jpm dev 这一版聚焦新建的单模块 Spring MVC 项目,也提供 JDK 选择、依赖查看和 `doctor` 环境检查。Windows、Gradle、多模块以及任意现有 Maven 项目的导入还不在支持范围内。Alpha 阶段的命令和配置可能调整,欢迎带着具体场景来试用和反馈。 -[项目主页](https://coderserio.github.io/java-npm/) · [源码与文档](https://github.com/CoderSerio/java-npm) · [npm 包](https://www.npmjs.com/package/@seriohhhh/java-npm) · MIT 许可 +[项目主页](https://coderserio.github.io/java-npm/) · [源码与文档](https://github.com/CoderSerio/java-npm) · [npm 包](https://www.npmjs.com/package/java-npm-cli) · MIT 许可 ## English @@ -30,7 +30,7 @@ I've been building **jpm (java-npm)**, a CLI for Java and Spring Boot. The first It brings familiar `create`, `add`, `dev`, `test`, and `build` commands to a Java workflow. Declare Java dependencies in `package.json`; jpm generates a standard POM, and Maven handles dependency resolution and builds. ```sh -npm install --global @seriohhhh/java-npm@alpha +npm install --global java-npm-cli@alpha jpm create my-app --java 21 -y cd my-app jpm jdk use 21 @@ -42,4 +42,4 @@ Start with Node.js 22+ on macOS or Linux. `jpm jdk use 21` reuses a local JDK 21 This alpha focuses on new single-module Spring MVC projects. It also includes JDK selection, dependency inspection, and a `doctor` command. Windows, Gradle, multi-module builds, and arbitrary existing Maven project imports are outside its current scope. Commands and configuration may change during alpha; concrete bug reports and workflow feedback are welcome. -[Product page](https://coderserio.github.io/java-npm/) · [Source and docs](https://github.com/CoderSerio/java-npm) · [npm package](https://www.npmjs.com/package/@seriohhhh/java-npm) · MIT licensed +[Product page](https://coderserio.github.io/java-npm/) · [Source and docs](https://github.com/CoderSerio/java-npm) · [npm package](https://www.npmjs.com/package/java-npm-cli) · MIT licensed diff --git a/docs/launch/brand.md b/docs/launch/brand.md index dfafdfb..33c7da6 100644 --- a/docs/launch/brand.md +++ b/docs/launch/brand.md @@ -1,17 +1,17 @@ # The jpm mark -The blue J forms the cup beneath two red wisps of steam. Its rounded hook and the compact spacing before the black pm are part of the wordmark. +The blue J forms the cup beneath two red wisps of steam. Its crossbar extends to the left like the lip of a test tube, and the steam rises from the middle of that bar. The rounded hook, the open counter of the p and the compact spacing before the black pm are part of the wordmark. ## Assets -- The [approved transparent PNG](../../assets/brand/jpm-readme.png) is the original artwork. Both READMEs display it at 264 px wide. -- The [dark-background wordmark](../../assets/brand/jpm-readme-dark.png) uses off-white lettering for pm. The blue J and red steam retain their original colors and placement. -- The [square icon](../../assets/brand/jpm-icon.png) uses the J and steam alone. The product site uses compact PNG exports of the same artwork. The [standalone SVG](../../assets/brand/jpm.svg) embeds the raster artwork and exposes the square icon as `#symbol`. +- The [vector wordmark](../../assets/brand/jpm.svg) is the master artwork. It switches pm to off-white under `prefers-color-scheme: dark` and exposes the J and steam alone as `#symbol`. +- The [transparent PNG](../../assets/brand/jpm-readme.png) and its [dark-background version](../../assets/brand/jpm-readme-dark.png) keep the original 1565 × 1005 artboard. Both READMEs display them at 264 px wide. +- The [square icon](../../assets/brand/jpm-icon.png) uses the J and steam alone. The product site uses compact PNG exports of the same artwork. -Run `uv run scripts/render-brand.py` from the repository root to regenerate the dark wordmark, icons and site exports. The export bounds refer to the original artboard. +Run `uv run scripts/render-brand.py` from the repository root to regenerate the PNG exports from the SVG. The social card is a 1200 × 630 screenshot of `scripts/social-card.html`. ## Terminal The welcome screen, creation wizard and doctor display `; jpm` in the terminal's normal foreground. A blue arrow marks the selected action and remains visible with `NO_COLOR` enabled. -The artwork was developed with AI image generation and human design direction. +The artwork was developed with AI image generation and human design direction, then traced to vector paths. diff --git a/docs/launch/demo.md b/docs/launch/demo.md index 6f5447a..05fb3c3 100644 --- a/docs/launch/demo.md +++ b/docs/launch/demo.md @@ -1,6 +1,6 @@ # Demo recording script -Aim for a 45–60 second edited walkthrough. Install the npm alpha with `npm install -g @seriohhhh/java-npm@alpha` and start in a new disposable directory. Use Node.js 22+ on macOS or Linux. Check network access, the Maven cache and the application port before recording. Label edits that shorten download time. +Aim for a 45–60 second edited walkthrough. Install the npm alpha with `npm install -g java-npm-cli@alpha` and start in a new disposable directory. Use Node.js 22+ on macOS or Linux. Check network access, the Maven cache and the application port before recording. Label edits that shorten download time. | Segment | Action | Explanation | | --- | --- | --- | @@ -12,4 +12,4 @@ Aim for a 45–60 second edited walkthrough. Install the npm alpha with `npm ins Use a second terminal or browser for the HTTP response. Find the generated controller under `src/main/java`; change only the response string and wait for a successful restart. Do not show a successful response over a failed compile. If port 8080 is occupied, pass `-- -Dspring-boot.run.arguments=--server.port=8081` to `dev` and use that port consistently. -End with the [product page](https://coderserio.github.io/java-npm/) and `npm install -g @seriohhhh/java-npm@alpha`. Keep the alpha label and Node/platform requirements visible in the caption. Use clean terminal paths and public registry URLs. +End with the [product page](https://coderserio.github.io/java-npm/) and `npm install -g java-npm-cli@alpha`. Keep the alpha label and Node/platform requirements visible in the caption. Use clean terminal paths and public registry URLs. diff --git a/docs/releases/0.1.0-alpha.1.md b/docs/releases/0.1.0-alpha.1.md index e1a9368..13d1ce6 100644 --- a/docs/releases/0.1.0-alpha.1.md +++ b/docs/releases/0.1.0-alpha.1.md @@ -3,17 +3,21 @@ The first npm alpha was published on December 4, 2026 (UTC+8). Install this exact version on macOS or Linux with Node.js 22 or later. ```sh -npm install -g @seriohhhh/java-npm@0.1.0-alpha.1 +npm install -g java-npm-cli@0.1.0-alpha.1 jpm --version # 0.1.0-alpha.1 ``` -The scoped package installs the same `jpm` command as the [Homebrew prerelease](https://github.com/CoderSerio/java-npm/releases/tag/v0.1.0-alpha.0). Use `@seriohhhh/java-npm@alpha` to follow the npm alpha channel. At publication, both `alpha` and `latest` pointed to this prerelease. +The package installs the same `jpm` command as the [Homebrew prerelease](https://github.com/CoderSerio/java-npm/releases/tag/v0.1.0-alpha.0). Use `java-npm-cli@alpha` to follow the npm alpha channel. + +## Package name + +The version was first published on December 4 as the scoped `@seriohhhh/java-npm`, where both `alpha` and `latest` pointed to it. On December 5 it was also published as the unscoped `java-npm-cli`, which is now the documented package. On `java-npm-cli`, `alpha` points to this release and `latest` points to a `0.0.0-stage` placeholder that does not install `jpm`, so keep the `@alpha` tag in install commands. ## Verification -The published tarball matched the tested archive byte for byte. A fresh npm installation returned `0.1.0-alpha.1` from `jpm --version` and displayed the CLI help. The release checkout passed all 78 tests. GitHub CI passed on macOS and Ubuntu, including runtime checks on Node 22, 24 and 26. +The scoped tarball matched the tested archive byte for byte. A fresh npm installation returned `0.1.0-alpha.1` from `jpm --version` and displayed the CLI help. A fresh installation of `java-npm-cli@alpha` on December 5 also returned `0.1.0-alpha.1`. The release checkout passed all 78 tests. GitHub CI passed on macOS and Ubuntu, including runtime checks on Node 22, 24 and 26. -- [npm package](https://www.npmjs.com/package/@seriohhhh/java-npm/v/0.1.0-alpha.1) +- [npm package](https://www.npmjs.com/package/java-npm-cli/v/0.1.0-alpha.1) · [registry metadata](https://registry.npmjs.org/java-npm-cli/0.1.0-alpha.1) - [Release source at `ab0ffb1`](https://github.com/CoderSerio/java-npm/tree/ab0ffb1091db9aac336ef6bb5e2a6932aaa7dfa2) · [CI results](https://github.com/CoderSerio/java-npm/actions/runs/47149872491) -- [Registry metadata and SHA-512 integrity](https://registry.npmjs.org/@seriohhhh%2Fjava-npm/0.1.0-alpha.1) +- [Scoped registry metadata and SHA-512 integrity](https://registry.npmjs.org/@seriohhhh%2Fjava-npm/0.1.0-alpha.1) diff --git a/docs/releasing.md b/docs/releasing.md index 4ddb48a..ff3de13 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -1,6 +1,6 @@ # Publishing an alpha -Maintainers publish `@seriohhhh/java-npm` manually. The package installs the `jpm` command. Publish prereleases with `--tag alpha`. The [first npm release](releases/0.1.0-alpha.1.md) also received the `latest` tag, so record the registry's actual tags before and after publishing. +Maintainers publish `java-npm-cli` manually. The package installs the `jpm` command. Publish prereleases with `--tag alpha`. `latest` currently points to a `0.0.0-stage` placeholder; see the [first npm release](releases/0.1.0-alpha.1.md). Record the registry's actual tags before and after publishing. ## Prepare the release @@ -64,10 +64,10 @@ The maintainer signs in locally with npm. Do not paste tokens, passwords, or one ```sh npm login --registry=https://registry.npmjs.org/ npm whoami --registry=https://registry.npmjs.org/ -npm view @seriohhhh/java-npm dist-tags --json --registry=https://registry.npmjs.org/ +npm view java-npm-cli dist-tags --json --registry=https://registry.npmjs.org/ ``` -Check the exact candidate version with `npm view @seriohhhh/java-npm@ version`. For a first publication, an explicit registry 404 means the package/version was not found at that moment; authentication, permission, or network errors are not proof that a name is available. Never overwrite or reuse a published version. +Check the exact candidate version with `npm view java-npm-cli@ version`. For a first publication, an explicit registry 404 means the package/version was not found at that moment; authentication, permission, or network errors are not proof that a name is available. Never overwrite or reuse a published version. Once publication is authorized, publish the exact archive that was inspected above: @@ -80,10 +80,10 @@ Do not depend on package lifecycle hooks to validate an already-built tarball. R ## Verify distribution and document the result ```sh -npm view @seriohhhh/java-npm@0.1.0-alpha.1 version dist.integrity dist.tarball --json --registry=https://registry.npmjs.org/ -npm view @seriohhhh/java-npm dist-tags --json --registry=https://registry.npmjs.org/ +npm view java-npm-cli@0.1.0-alpha.1 version dist.integrity dist.tarball --json --registry=https://registry.npmjs.org/ +npm view java-npm-cli dist-tags --json --registry=https://registry.npmjs.org/ verify_dir=$(mktemp -d) -npm install --prefix "$verify_dir" --cache "$verify_dir/cache" --omit=dev --ignore-scripts @seriohhhh/java-npm@0.1.0-alpha.1 --registry=https://registry.npmjs.org/ +npm install --prefix "$verify_dir" --cache "$verify_dir/cache" --omit=dev --ignore-scripts java-npm-cli@0.1.0-alpha.1 --registry=https://registry.npmjs.org/ "$verify_dir/node_modules/.bin/jpm" --version "$verify_dir/node_modules/.bin/jpm" --help ``` diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 1b9c4d4..81032e1 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -4,8 +4,8 @@ Start with `jpm --version`, `node --version`, and `jpm doctor --json` from the p | Symptom | What to check | | --- | --- | -| `jpm: command not found` | Run `npm install -g @seriohhhh/java-npm@alpha`. On macOS or Linux, check that the `bin` directory under `npm prefix -g` is on your shell's PATH. | -| npm cannot find `@seriohhhh/java-npm@alpha` | Check the spelling, including the `@seriohhhh/` scope. Run `npm view @seriohhhh/java-npm@alpha version --registry=https://registry.npmjs.org/`. If that succeeds, check your configured registry or mirror. [Published package](https://www.npmjs.com/package/@seriohhhh/java-npm) | +| `jpm: command not found` | Run `npm install -g java-npm-cli@alpha`. On macOS or Linux, check that the `bin` directory under `npm prefix -g` is on your shell's PATH. | +| npm cannot find `java-npm-cli@alpha` | Check the spelling: the package is `java-npm-cli`, not `jpm` or `java-npm`. Run `npm view java-npm-cli@alpha version --registry=https://registry.npmjs.org/`. If that succeeds, check your configured registry or mirror. [Published package](https://www.npmjs.com/package/java-npm-cli) | | Node 22 required | Select Node 22+ with your version manager. Check `node --version` in the same shell running jpm. | | No project manifest | Run project commands from the generated application's root, not the jpm source repository or a source subdirectory. | | JDK not found | Run `jpm jdk list`; select a complete JDK with both java and javac, or explicitly run `jpm jdk install `. | diff --git a/package-lock.json b/package-lock.json index b0d74a0..a0a0bd3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@seriohhhh/java-npm", + "name": "java-npm-cli", "version": "0.1.0-alpha.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@seriohhhh/java-npm", + "name": "java-npm-cli", "version": "0.1.0-alpha.1", "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index faae776..0c9c8b1 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@seriohhhh/java-npm", + "name": "java-npm-cli", "version": "0.1.0-alpha.1", "description": "A frontend-friendly workflow for Java and Spring Boot", "type": "module", diff --git a/scripts/render-brand.py b/scripts/render-brand.py index 84763f3..f5010a6 100644 --- a/scripts/render-brand.py +++ b/scripts/render-brand.py @@ -1,60 +1,44 @@ # /// script # requires-python = ">=3.12" -# dependencies = ["pillow==13.0.0"] +# dependencies = ["resvg-py==0.5.0"] # /// -"""Export the selected PNG wordmark for GitHub and the product site.""" +"""Render the PNG exports of the vector wordmark for GitHub and the product site.""" -from base64 import b64encode from pathlib import Path -from PIL import Image, ImageOps +from resvg_py import svg_to_bytes ROOT = Path(__file__).resolve().parents[1] ASSETS = ROOT / "assets" / "brand" SITE = ROOT / "site" -# Artboard coordinates on the approved 1565 × 1005 transparent master. -# The split passes through the transparent gap between the J and the p. -WORDMARK = (196, 62, 1314, 925) -MONOGRAM = (196, 62, 590, 925) -LETTER_START = 590 +WORDMARK = "196 62 1118 863" +# The README PNGs keep the original 1565 × 1005 artboard so their display width stays unchanged. +ARTBOARD = "0 0 1565 1005" +# A square around the J and steam (x 213–583, y 79–909). +MONOGRAM = "-33.5 62 863 863" +LIGHT_LETTERS, DARK_LETTERS = 'fill="#100e11"', 'fill="#f3f4f5"' + + +def render(svg, view_box, width, height, target): + framed = svg.replace(f'viewBox="{WORDMARK}"', f'viewBox="{view_box}"', 1) + target.write_bytes(bytes(svg_to_bytes(svg_string=framed, width=width, height=height))) def main(): - with Image.open(ASSETS / "jpm-readme.png") as source: - mark = source.convert("RGBA") - if mark.size != (1565, 1005): - raise ValueError("Check the export bounds against the new wordmark artboard.") - - dark = mark.copy() - bounds = (LETTER_START, 0, mark.width, mark.height) - letters = Image.new("RGBA", (mark.width - LETTER_START, mark.height), "#f3f4f5") - letters.putalpha(mark.crop(bounds).getchannel("A")) - dark.paste(letters, bounds) - dark.save(ASSETS / "jpm-readme-dark.png", optimize=True) - - for artwork, name in [(mark, "wordmark.png"), (dark, "wordmark-dark.png")]: - wordmark = artwork.crop(WORDMARK) - wordmark.thumbnail((320, 320), Image.Resampling.LANCZOS) - wordmark.save(SITE / name, optimize=True) - - icon = ImageOps.pad(mark.crop(MONOGRAM), (512, 512), method=Image.Resampling.LANCZOS) - icon.save(ASSETS / "jpm-icon.png", optimize=True) - icon.resize((128, 128), Image.Resampling.LANCZOS).save(SITE / "icon.png", optimize=True) - - # Keep the public SVG URL and its square #symbol usable in offline embeds. - wordmark_data = b64encode((SITE / "wordmark.png").read_bytes()).decode("ascii") - icon_data = b64encode((SITE / "icon.png").read_bytes()).decode("ascii") - svg = f''' - jpm - - - - - -''' - (ASSETS / "jpm.svg").write_text(svg, encoding="utf-8") + light = (ASSETS / "jpm.svg").read_text(encoding="utf-8") + if f'viewBox="{WORDMARK}"' not in light or LIGHT_LETTERS not in light: + raise ValueError("Check the export bounds and letter color against jpm.svg.") + dark = light.replace(LIGHT_LETTERS, DARK_LETTERS) + symbol = "\n".join(line for line in light.splitlines() if 'class="pm"' not in line) + + render(light, ARTBOARD, 1565, 1005, ASSETS / "jpm-readme.png") + render(dark, ARTBOARD, 1565, 1005, ASSETS / "jpm-readme-dark.png") + render(light, WORDMARK, 640, 494, SITE / "wordmark.png") + render(dark, WORDMARK, 640, 494, SITE / "wordmark-dark.png") + render(symbol, MONOGRAM, 512, 512, ASSETS / "jpm-icon.png") + render(symbol, MONOGRAM, 128, 128, SITE / "icon.png") if __name__ == "__main__": diff --git a/scripts/social-card.html b/scripts/social-card.html index 4a4ef33..f4c674b 100644 --- a/scripts/social-card.html +++ b/scripts/social-card.html @@ -28,7 +28,7 @@ jpm

Spring Boot,from your terminal.

An npm-style CLI for Java.

-
$ npm install -g @seriohhhh/java-npm@alpha
+
$ npm install -g java-npm-cli@alpha
diff --git a/site/guide/index.html b/site/guide/index.html index 619f45b..352947f 100644 --- a/site/guide/index.html +++ b/site/guide/index.html @@ -29,7 +29,7 @@
  • Add a dependency and build
  • Your first Spring Boot app

    Start with an empty directory. By the end you’ll have a local HTTP endpoint, a passing test and a JAR you can run with Java.

    Install jpm

    Use macOS or Linux with Node.js 22 or newer. The alpha supports new, single-module Spring MVC applications. Allow network access for the first setup.

    -
    npm install -g @seriohhhh/java-npm@alpha
    +
    npm install -g java-npm-cli@alpha
     jpm --version

    On Homebrew, brew install coderserio/tap/jpm installs the CLI and Node together. The formula has its own release version.

    Create the project

    jpm create hello-jpm --java 21 -y
    diff --git a/site/icon.png b/site/icon.png
    index f4d58b0..ea9e2ab 100644
    Binary files a/site/icon.png and b/site/icon.png differ
    diff --git a/site/index.html b/site/index.html
    index e3ce65e..8baed29 100644
    --- a/site/index.html
    +++ b/site/index.html
    @@ -44,11 +44,11 @@
       
    - Public alpha v0.1.0-alpha.1 + Public alpha v0.1.0-alpha.1

    Spring Boot, from your terminal.

    If npm’s commands feel like home, jpm brings that workflow to Java. Create a Spring app, add Maven dependencies, and build a runnable JAR.

    - npm i -g @seriohhhh/java-npm@alpha + npm i -g java-npm-cli@alpha
    diff --git a/site/social.png b/site/social.png index 1416c91..516bbc2 100644 Binary files a/site/social.png and b/site/social.png differ diff --git a/site/wordmark-dark.png b/site/wordmark-dark.png index 7c542e6..c3a8bfd 100644 Binary files a/site/wordmark-dark.png and b/site/wordmark-dark.png differ diff --git a/site/wordmark.png b/site/wordmark.png index 4d4e006..570691a 100644 Binary files a/site/wordmark.png and b/site/wordmark.png differ diff --git a/site/zh/guide/index.html b/site/zh/guide/index.html index 51486aa..396f807 100644 --- a/site/zh/guide/index.html +++ b/site/zh/guide/index.html @@ -29,7 +29,7 @@
  • 添加依赖并打包
  • 跑起你的第一个 Spring Boot 应用

    从一个空目录开始。跟着做完,你会得到一个本地 HTTP 接口、一份能通过的测试,以及一个可以用 Java 直接运行的 JAR。

    安装 jpm

    准备好 macOS 或 Linux,以及 Node.js 22 或更高版本。当前 alpha 支持新建单模块 Spring MVC 应用,首次安装和创建项目需要联网。

    -
    npm install -g @seriohhhh/java-npm@alpha
    +
    npm install -g java-npm-cli@alpha
     jpm --version

    也可以用 brew install coderserio/tap/jpm 一并安装 CLI 和 Node。Homebrew 的版本见 formula。

    创建项目

    jpm create hello-jpm --java 21 -y
    diff --git a/site/zh/index.html b/site/zh/index.html
    index 9bbad0a..9cbda96 100644
    --- a/site/zh/index.html
    +++ b/site/zh/index.html
    @@ -44,11 +44,11 @@
       
    - 公开预览 v0.1.0-alpha.1 + 公开预览 v0.1.0-alpha.1

    在终端里, 开发 Spring Boot。

    习惯了 npm 的命令?用 jpm,你可以沿用这套工作方式,在本机创建 Spring 应用、添加 Maven 依赖,再构建出可运行的 JAR。

    - npm i -g @seriohhhh/java-npm@alpha + npm i -g java-npm-cli@alpha
    diff --git a/src/create.ts b/src/create.ts index 744f6e2..11dbc2b 100644 --- a/src/create.ts +++ b/src/create.ts @@ -244,7 +244,7 @@ export async function createProject(name: string, options: CreateOptions = {}) { await mkdir(path.dirname(filename), { recursive: true }); await writeFile(filename, content, { flag: 'wx' }); } - await writeFile(path.join(project, 'README.md'), `# ${name}\n\nA Spring Boot application created with jpm. Requires jpm on PATH, Node.js 22+ and Java ${javaVersion}.\n\n\`\`\`sh\njpm jdk use ${javaVersion}\njpm install\njpm dev\n# In another terminal:\ncurl http://localhost:8080/\njpm test\njpm build\n\`\`\`\n\nGET / returns \`{"message":"Hello from jpm!"}\`.\n\nEdit Java dependencies in \`package.json\` under \`java.dependencies\`, then run \`jpm install\`. The POM is generated; do not edit it directly.\n\nThe project JDK is selected in \`.jpmrc\` (\`java=${javaVersion}\`). \`package.json.java.version\` remains the compile target. Use \`jpm jdk list\` to see installed JDKs and \`jpm jdk use \` to install a missing JDK and save a project selection. To also switch your current bash/zsh terminal, run \`eval "$(jpm jdk env)"\`.\n\nInstall the CLI with \`npm install -g @seriohhhh/java-npm@alpha\` or \`brew install coderserio/tap/jpm\`. The [getting started guide](https://coderserio.github.io/java-npm/guide/) walks through the first run. Java dependencies are resolved by Maven through jpm; this project does not need npm install, node_modules, or a bundled CLI archive. npm scripts are optional aliases for an already installed jpm.\n`, { flag: 'wx' }); + await writeFile(path.join(project, 'README.md'), `# ${name}\n\nA Spring Boot application created with jpm. Requires jpm on PATH, Node.js 22+ and Java ${javaVersion}.\n\n\`\`\`sh\njpm jdk use ${javaVersion}\njpm install\njpm dev\n# In another terminal:\ncurl http://localhost:8080/\njpm test\njpm build\n\`\`\`\n\nGET / returns \`{"message":"Hello from jpm!"}\`.\n\nEdit Java dependencies in \`package.json\` under \`java.dependencies\`, then run \`jpm install\`. The POM is generated; do not edit it directly.\n\nThe project JDK is selected in \`.jpmrc\` (\`java=${javaVersion}\`). \`package.json.java.version\` remains the compile target. Use \`jpm jdk list\` to see installed JDKs and \`jpm jdk use \` to install a missing JDK and save a project selection. To also switch your current bash/zsh terminal, run \`eval "$(jpm jdk env)"\`.\n\nInstall the CLI with \`npm install -g java-npm-cli@alpha\` or \`brew install coderserio/tap/jpm\`. The [getting started guide](https://coderserio.github.io/java-npm/guide/) walks through the first run. Java dependencies are resolved by Maven through jpm; this project does not need npm install, node_modules, or a bundled CLI archive. npm scripts are optional aliases for an already installed jpm.\n`, { flag: 'wx' }); const ignore = path.join(project, '.gitignore'); const originalIgnore = await readFile(ignore, 'utf8').catch(error => { if (errorCode(error) === 'ENOENT') return ''; throw error; }); await writeFile(ignore, `${originalIgnore.trimEnd()}\nnode_modules/\n.jpm/\n`); diff --git a/test/create.test.js b/test/create.test.js index d716cd9..bbb1fb9 100644 --- a/test/create.test.js +++ b/test/create.test.js @@ -90,7 +90,7 @@ test('create preserves official dependencies and wrappers and supplies a runnabl const sourceDirectory = fileURLToPath(new URL('../', import.meta.url)); assert.ok(!JSON.stringify(manifest).includes(sourceDirectory)); const readme = await readFile(path.join(directory, 'README.md'), 'utf8'); - assert.match(readme, /npm install -g @seriohhhh\/java-npm@alpha/); + assert.match(readme, /npm install -g java-npm-cli@alpha/); assert.match(readme, /brew install coderserio\/tap\/jpm/); assert.ok(!readme.includes(sourceDirectory)); assert.match(await readFile(path.join(directory, 'pom.xml'), 'utf8'), /spring-boot-starter-webmvc-test/); diff --git a/test/package.test.js b/test/package.test.js index 91644f9..00f0134 100644 --- a/test/package.test.js +++ b/test/package.test.js @@ -31,7 +31,7 @@ test('release archive contains built modules and no source, tests, or compiler', await mkdir(extracted); await tar.x({ file: archive, cwd: extracted, strict: true, preserveOwner: false }); const manifest = JSON.parse(await readFile(path.join(extracted, 'package/package.json'), 'utf8')); - assert.equal(manifest.name, '@seriohhhh/java-npm'); + assert.equal(manifest.name, 'java-npm-cli'); assert.equal(manifest.version, metadata.version); assert.deepEqual(manifest.bin, { jpm: 'bin/jpm.js' }); assert.equal(manifest.private, undefined);