diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 960455a..520f1a1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,3 +20,27 @@ jobs: ossrh_token: ${{ secrets.OSSRH_TOKEN }} ossrh_signing_key: ${{ secrets.OSSRH_SIGNING_KEY }} ossrh_signing_password: ${{ secrets.OSSRH_SIGNING_PASSWORD }} + release-js: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + + - name: publish-npm + working-directory: openrewrite + run: | + npm i + npm run build + npm ci + npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/openrewrite/package.json b/openrewrite/package.json index eba2d39..0c63289 100644 --- a/openrewrite/package.json +++ b/openrewrite/package.json @@ -1,6 +1,6 @@ { "name": "@openrewrite/rewrite", - "version": "0.18.5", + "version": "0.18.6", "license": "Apache-2.0", "description": "OpenRewrite implementation for JavaScript.", "homepage": "https://github.com/openrewrite/rewrite-javascript", @@ -11,11 +11,14 @@ "./core": "./dist/src/core/index.js", "./java": "./dist/src/java/index.js", "./java/tree": "./dist/src/java/tree/index.js", + "./java/remote": "./dist/src/java/remote/index.js", "./javascript": "./dist/src/javascript/index.js", "./javascript/tree": "./dist/src/javascript/tree/index.js", + "./javascript/remote": "./dist/src/javascript/remote/index.js", "./json": "./dist/src/json/index.js", "./yaml": "./dist/src/yaml/index.js", - "./yaml/tree": "./dist/src/yaml/tree/index.js" + "./yaml/tree": "./dist/src/yaml/tree/index.js", + "./yaml/remote": "./dist/src/yaml/remote/index.js" }, "scripts": { "build": "tsc --build tsconfig.build.json", diff --git a/openrewrite/src/java/remote/register.ts b/openrewrite/src/java/remote/register.ts index 1d6585a..d2e316f 100644 --- a/openrewrite/src/java/remote/register.ts +++ b/openrewrite/src/java/remote/register.ts @@ -7,6 +7,8 @@ import {SenderContext, SerializationContext} from "@openrewrite/rewrite-remote"; import {JavaSender} from "./sender"; import {JavaReceiver} from "./receiver"; +console.log("registering java codecs"); + SenderContext.register(isJava, () => new JavaSender()); ReceiverContext.register(isJava, () => new JavaReceiver()); diff --git a/openrewrite/src/javascript/remote/register.ts b/openrewrite/src/javascript/remote/register.ts index 8e1b9b6..bebab2b 100644 --- a/openrewrite/src/javascript/remote/register.ts +++ b/openrewrite/src/javascript/remote/register.ts @@ -3,6 +3,6 @@ import {ReceiverContext} from "@openrewrite/rewrite-remote"; import {SenderContext} from "@openrewrite/rewrite-remote"; import {JavaScriptSender} from "./sender"; import {JavaScriptReceiver} from "./receiver"; - +console.log("registering javascript codecs"); SenderContext.register(isJavaScript, () => new JavaScriptSender()); ReceiverContext.register(isJavaScript, () => new JavaScriptReceiver()); diff --git a/openrewrite/src/yaml/remote/index.ts b/openrewrite/src/yaml/remote/index.ts new file mode 100644 index 0000000..bb9f4b0 --- /dev/null +++ b/openrewrite/src/yaml/remote/index.ts @@ -0,0 +1,5 @@ +// import for side-effects +import './register'; + +export * from './receiver'; +export * from './sender'; diff --git a/openrewrite/src/yaml/remote/register.ts b/openrewrite/src/yaml/remote/register.ts new file mode 100644 index 0000000..bf78a46 --- /dev/null +++ b/openrewrite/src/yaml/remote/register.ts @@ -0,0 +1,9 @@ +import {isYaml} from "../tree"; +import {ReceiverContext} from "@openrewrite/rewrite-remote"; +import {SenderContext} from "@openrewrite/rewrite-remote"; +import {YamlSender} from "./sender"; +import {YamlReceiver} from "./receiver"; + +console.log("registering yaml codecs"); +SenderContext.register(isYaml, () => new YamlSender()); +ReceiverContext.register(isYaml, () => new YamlReceiver()); diff --git a/rewrite-javascript/src/main/resources/META-INF/package.json b/rewrite-javascript/src/main/resources/META-INF/package.json index 28869ac..aa3847e 100644 --- a/rewrite-javascript/src/main/resources/META-INF/package.json +++ b/rewrite-javascript/src/main/resources/META-INF/package.json @@ -1,24 +1,15 @@ -/** - * Copyright 2024 the original author or authors. - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *

- * https://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ { "name": "@openrewrite/rewrite-bundled-starter", "version": "1.0.0", "description": "", + "overrides": { + "@openrewrite/rewrite-remote": { + "@openrewrite/rewrite": "~0.18.0" + } + }, "dependencies": { - "@openrewrite/rewrite-remote": "~0.3.0" + "@openrewrite/rewrite-remote": "~0.3.0", + "@openrewrite/rewrite": "~0.18.0" }, "devDependencies": { }