From 59164695c7c8ddf5305cc15e0f9b94cef0ae8a6e Mon Sep 17 00:00:00 2001 From: Dan Schultz Date: Mon, 20 Sep 2021 15:13:00 -0600 Subject: [PATCH 1/2] NPM shared Prettier config --- .prettierrc.js | 6 ++++++ README.md | 43 +++++++++++++++++++++++++++++++++++++++++-- package.json | 13 +++++++++++++ 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 .prettierrc.js create mode 100644 package.json diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..e617454 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,6 @@ +module.exports = { + trailingComma: "es5", + tabWidth: 2, + semi: true, + singleQuote: false, +}; diff --git a/README.md b/README.md index 8b6bd4d..4a16d5c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,41 @@ -# prettier-config -Vertex's shared config for Prettier. +# @vertexvis/prettier-config + +Vertex's shared Prettier config. + +## Usage + +This is based on [Shared +Configurations](https://prettier.io/docs/en/configuration.html#sharing-configurations) +in Prettier's documentation. + +1. Remove any existing `.prettierrc` files. +2. Install the config. + ``` + yarn add --dev @vertexvis/prettier-config + + # or + + npm install -D @vertexvis/prettier-config + ``` +3. Update your `package.json` to reference the shared config. + ``` + "prettier": "@vertexvis/prettier-config", + ``` + +## Overrides + +If you'd like to override any of the default settings, add a `.prettierrc.js` +file in your project with any settings that you'd like to change: + +```js +module.exports = { + ...require("@vertexvis/prettier-config"), + semi: false, +}; +``` + +## Publishing to NPM + +To publish a release to NPM, run `yarn version` to update the major or minor +version. Commit your changes and open a PR. Once the PR is merged, the new +version will be published to NPM. diff --git a/package.json b/package.json new file mode 100644 index 0000000..d7b0fa8 --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "name": "@vertexvis/prettier-config", + "version": "1.0.0", + "description": "Vertex's shared Prettier config.", + "main": ".prettierrc.js", + "repository": "git@github.com:Vertexvis/prettier-config.git", + "author": "Dan Schultz ", + "bugs": { + "url": "https://github.com/vertexvis/prettier-config/issues" + }, + "homepage": "https://github.com/vertexvis/prettier-config#readme", + "license": "MIT" +} From 541143f9fcdaa451b761240ef4fe08e82d9d53ea Mon Sep 17 00:00:00 2001 From: Dan Schultz Date: Mon, 20 Sep 2021 16:15:53 -0600 Subject: [PATCH 2/2] Publish via CI --- .github/CODEOWNERS | 1 + .github/workflows/main.yml | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/main.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..4cde4c7 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @vertexvis/platform diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..63912e2 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,21 @@ +name: Main + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: "Checkout changes" + uses: actions/checkout@v2 + - name: Setup NodeJS + uses: actions/setup-node@v1 + - name: "Install" + run: "yarn install" + - uses: JS-DevTools/npm-publish@v1 + with: + token: "${{ secrets.NPMJS_ACCESS_TOKEN }}" + access: "public"