Skip to content

Commit

Permalink
add codecs export and fix bundled package.json. fix publication to re…
Browse files Browse the repository at this point in the history
…lease js

Signed-off-by: OlegDokuka <oleh@moderne.io>
  • Loading branch information
OlegDokuka committed Oct 17, 2024
1 parent 0002b46 commit 2c95204
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 19 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
7 changes: 5 additions & 2 deletions openrewrite/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions openrewrite/src/java/remote/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
2 changes: 1 addition & 1 deletion openrewrite/src/javascript/remote/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
5 changes: 5 additions & 0 deletions openrewrite/src/yaml/remote/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// import for side-effects
import './register';

export * from './receiver';
export * from './sender';
9 changes: 9 additions & 0 deletions openrewrite/src/yaml/remote/register.ts
Original file line number Diff line number Diff line change
@@ -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());
23 changes: 7 additions & 16 deletions rewrite-javascript/src/main/resources/META-INF/package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
/**
* Copyright 2024 the original author or authors.
* <p>
* 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
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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": {
}
Expand Down

0 comments on commit 2c95204

Please sign in to comment.