Skip to content

Commit f55b709

Browse files
committed
first commit
0 parents  commit f55b709

23 files changed

Lines changed: 2657 additions & 0 deletions

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto eol=lf

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
check:
13+
name: Build & test
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
node-version: [22, 24]
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: pnpm/action-setup@v4
23+
with:
24+
version: 9
25+
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: pnpm
30+
31+
- name: Install dependencies
32+
run: pnpm install --frozen-lockfile
33+
34+
- name: Lint
35+
run: pnpm lint
36+
37+
- name: Format check
38+
run: pnpm format:check
39+
40+
- name: Typecheck
41+
run: pnpm typecheck
42+
43+
- name: Test
44+
run: pnpm test
45+
46+
- name: Build
47+
run: pnpm build

.github/workflows/release.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to release (x.y.z or x.y.z-tag)'
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: write
13+
id-token: write
14+
15+
jobs:
16+
release:
17+
name: Publish to npm and GitHub Releases
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- uses: pnpm/action-setup@v4
26+
with:
27+
version: 9
28+
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: 22
32+
cache: pnpm
33+
registry-url: https://registry.npmjs.org
34+
35+
- name: Install dependencies
36+
run: pnpm install --frozen-lockfile
37+
38+
- name: Validate version input
39+
run: |
40+
echo "${{ inputs.version }}" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.\-]+)?$' || {
41+
echo "::error::version must look like x.y.z or x.y.z-tag"
42+
exit 1
43+
}
44+
45+
- name: Lint
46+
run: pnpm lint
47+
48+
- name: Typecheck
49+
run: pnpm typecheck
50+
51+
- name: Test
52+
run: pnpm test
53+
54+
- name: Build
55+
run: pnpm build
56+
57+
- name: Set package version
58+
id: bump
59+
run: |
60+
npm pkg set version="${{ inputs.version }}"
61+
echo "version=${{ inputs.version }}" >> "$GITHUB_OUTPUT"
62+
echo "tag=v${{ inputs.version }}" >> "$GITHUB_OUTPUT"
63+
64+
- name: Determine npm dist-tag
65+
id: tag
66+
run: |
67+
if echo "${{ steps.bump.outputs.version }}" | grep -q '-'; then
68+
echo "dist=next" >> "$GITHUB_OUTPUT"
69+
else
70+
echo "dist=latest" >> "$GITHUB_OUTPUT"
71+
fi
72+
73+
- name: Commit version bump
74+
run: |
75+
git config user.name "github-actions[bot]"
76+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
77+
git add package.json
78+
git diff --staged --quiet || git commit -m "chore(release): ${{ steps.bump.outputs.tag }}"
79+
git tag "${{ steps.bump.outputs.tag }}"
80+
git push origin HEAD:${{ github.ref_name }} --follow-tags
81+
82+
- name: Publish to npm
83+
run: npm publish --provenance --access public --tag ${{ steps.tag.outputs.dist }}
84+
env:
85+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
86+
87+
- name: Create GitHub Release
88+
uses: softprops/action-gh-release@v2
89+
with:
90+
tag_name: ${{ steps.bump.outputs.tag }}
91+
name: ${{ steps.bump.outputs.tag }}
92+
generate_release_notes: true
93+
prerelease: ${{ steps.tag.outputs.dist == 'next' }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
dist/
3+
coverage/
4+
*.log
5+
.DS_Store

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dist/
2+
node_modules/
3+
pnpm-lock.yaml
4+
.idea/
5+
coverage/
6+
testplay/
7+
.prettierrc

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"arrowParens": "always",
8+
"endOfLine": "lf",
9+
"embeddedLanguageFormatting": "off"
10+
}

CONTRIBUTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Contributing
2+
3+
## Setup
4+
5+
```sh
6+
pnpm install
7+
pnpm test
8+
pnpm build
9+
```
10+
11+
## Development
12+
13+
The plugin source is in `src/index.ts`. Tests are in `tests/index.test.ts`.
14+
15+
For general Indentier development guidelines, see the [Indentier contributing guide](https://github.com/indentier/indentier/blob/main/CONTRIBUTING.md).
16+
17+
## Scripts
18+
19+
<!-- prettier-ignore -->
20+
| Script | Purpose |
21+
|-|-|
22+
| `pnpm dev` | tsdown in watch mode |
23+
| `pnpm build` | Produce ESM + CJS bundles in `dist/` |
24+
| `pnpm test` | Run vitest |
25+
| `pnpm typecheck` | TypeScript type check |
26+
| `pnpm lint` / `lint:fix` | ESLint |
27+
| `pnpm format` / `format:check` | Prettier |
28+
| `pnpm play` / `play:ruby` | Run indentier against `testplay/` sample files |
29+
30+
## Releasing
31+
32+
Releases follow the same workflow as Indentier core — see the [core contributing guide](https://github.com/indentier/indentier/blob/main/CONTRIBUTING.md#releasing) for details.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 otoneko.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<div align="center">
2+
3+
<img src="./icon.png" width="256" height="256" alt="Indentier">
4+
5+
# @indentier/plugin-java
6+
7+
</div>
8+
9+
[![npm version](https://img.shields.io/npm/v/@indentier/plugin-java.svg?color=cb3837&logo=npm)](https://www.npmjs.com/package/@indentier/plugin-java)
10+
[![CI](https://github.com/indentier/plugin-java/actions/workflows/ci.yml/badge.svg)](https://github.com/indentier/plugin-java/actions/workflows/ci.yml)
11+
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
12+
13+
> Java support for [Indentier](https://github.com/indentier/indentier).
14+
15+
Full documentation: **[indentier.github.io](https://indentier.github.io)**
16+
17+
## Install
18+
19+
```sh
20+
npm i -D indentier @indentier/plugin-java
21+
```
22+
23+
## Setup
24+
25+
```jsonc
26+
// .indentierrc.json
27+
{
28+
"plugins": ["@indentier/plugin-java"]
29+
}
30+
```
31+
32+
<!-- prettier-ignore -->
33+
| | |
34+
|-|-|
35+
| Language | Java |
36+
| Extensions | `.java` |
37+
| Ruby mode | No — basic symbol formatting only |
38+
39+
## License
40+
41+
[MIT](./LICENSE) © otoneko.

eslint.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import js from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
import prettier from 'eslint-config-prettier';
4+
5+
export default tseslint.config(
6+
{
7+
ignores: ['dist/**', 'node_modules/**', 'coverage/**'],
8+
},
9+
js.configs.recommended,
10+
...tseslint.configs.recommended,
11+
prettier,
12+
{
13+
languageOptions: {
14+
ecmaVersion: 2024,
15+
sourceType: 'module',
16+
},
17+
rules: {
18+
'@typescript-eslint/no-unused-vars': [
19+
'error',
20+
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
21+
],
22+
},
23+
},
24+
);

0 commit comments

Comments
 (0)