From 4dcdd1b828db38d1c38a82dc63109819fc84719b Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Wed, 23 Feb 2022 14:00:29 +0000 Subject: [PATCH] Set up Node environment --- .eslintrc.json | 18 ++++++++++++++++++ .gitignore | 2 ++ .prettierrc.json | 1 + action.yml | 8 +++----- package.json | 19 +++++++++++++++++++ tsconfig.json | 8 ++++++++ 6 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 .eslintrc.json create mode 100644 .gitignore create mode 100644 .prettierrc.json create mode 100644 package.json create mode 100644 tsconfig.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..7c9c6fa --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "env": { + "node": true + }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking" + ], + "parserOptions": { + "ecmaVersion": 11, + "parser": "@typescript-eslint/parser", + "sourceType": "module", + "project": ["./tsconfig.json"] + }, + "plugins": ["@typescript-eslint"] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..504afef --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +package-lock.json diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1 @@ +{} diff --git a/action.yml b/action.yml index f53f180..856aeae 100644 --- a/action.yml +++ b/action.yml @@ -9,7 +9,6 @@ branding: color: yellow inputs: - preview-branch: description: > Branch on which the previews will be deployed. This should be the @@ -20,7 +19,7 @@ inputs: description: > Name of the directory containing all previews. All previews will be created inside this directory. - + The umbrella directory is used to namespace previews from your main branch's deployment on GitHub Pages. @@ -61,6 +60,5 @@ inputs: default: auto runs: - using: composite - steps: - \ No newline at end of file + using: node16 + main: dist/main.js diff --git a/package.json b/package.json new file mode 100644 index 0000000..183385d --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "pr-preview", + "version": "0.0.0", + "main": "dist/main.js", + "scripts": {}, + "devDependencies": { + "@types/node": "^17.0.19", + "@typescript-eslint/eslint-plugin": "^5.12.1", + "@typescript-eslint/parser": "^5.12.1", + "eslint": "^8.9.0", + "prettier": "2.5.1", + "typescript": "^4.5.5" + }, + "dependencies": { + "@actions/core": "^1.6.0", + "@actions/github": "^5.0.0", + "@jamesives/github-pages-deploy-action": "^4.2.5" + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..b6e87ce --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "outDir": "./dist/", + "strict": true, + "module": "CommonJS" + }, + "include": ["src/**/*.ts"] +}