Skip to content

Commit

Permalink
ts
Browse files Browse the repository at this point in the history
  • Loading branch information
maxprilutskiy committed Oct 7, 2024
1 parent 326ba1b commit 8203a0e
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 21 deletions.
24 changes: 12 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@ name: Replexica
description: Automated AI localization for multilingual software.
author: Replexica

# Define your inputs here.
branding:
icon: './content/logo.png'
color: 'black'

runs:
using: 'docker'
image: 'action/Dockerfile'
env:
REPLEXICA_API_KEY: ${{ inputs.api-key }}
REPLEXICA_PULL_REQUEST: ${{ inputs.pull-request }}
REPLEXICA_COMMIT_MESSAGE: ${{ inputs.commit-message }}

inputs:
api-key:
description: 'Replexica Platform API Key'
Expand All @@ -13,14 +24,3 @@ inputs:
commit-message:
description: 'Commit message'
required: false

runs:
using: 'docker'
image: 'action/Dockerfile'
env:
REPLEXICA_API_KEY: ${{ inputs.api-key }}
REPLEXICA_PULL_REQUEST: ${{ inputs.pull-request }}
REPLEXICA_COMMIT_MESSAGE: ${{ inputs.commit-message }}
branding:
icon: './content/logo.png'
color: 'black'
1 change: 1 addition & 0 deletions action/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
7 changes: 5 additions & 2 deletions action/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ COPY package*.json /app
COPY src /app/src

# Install pnpm and dependencies
RUN npm install -g pnpm ts-node && pnpm install
RUN npm install -g pnpm && pnpm install

# Build the TypeScript application
RUN pnpm build

# Run the Node.js / TypeScript application
ENTRYPOINT ["ts-node", "/app/src/index.ts"]
ENTRYPOINT ["node", "/app/build/index.js"]
5 changes: 5 additions & 0 deletions action/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"type": "module",
"scripts": {
"build": "tsc"
},
"dependencies": {
"octokit": "^4.0.2",
"typescript": "^5.6.2",
"zod": "^3.23.8"
},
"devDependencies": {
Expand Down
10 changes: 10 additions & 0 deletions action/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions action/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { execSync } from 'child_process';

import loadConfig from './instances/config';
import loadConfig from './instances/config.js';
// Uses GitHub's official Octokit
import loadOctokit from './instances/octokit';
import doStuff from './do-stuff';
import loadOctokit from './instances/octokit.js';
import doStuff from './do-stuff.js';

// Run

Expand Down
2 changes: 1 addition & 1 deletion action/src/instances/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import loadEnv from './_env';
import loadEnv from './_env.js';

export default async function loadConfig() {
const env = await loadEnv();
Expand Down
2 changes: 1 addition & 1 deletion action/src/instances/octokit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import loadEnv from './_env';
import loadEnv from './_env.js';
import { Octokit } from 'octokit';

export default async function loadOctokit() {
Expand Down
4 changes: 2 additions & 2 deletions action/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"moduleResolution": "Node",
"module": "CommonJS",
"moduleResolution": "NodeNext",
"module": "NodeNext",
"target": "ESNext",
"rootDir": "src",
"outDir": "build",
Expand Down

0 comments on commit 8203a0e

Please sign in to comment.