-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65afff7
commit f5ed63d
Showing
8 changed files
with
128 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
name: Publish to NPM | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'index.js' | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
|
||
- name: Setup node and restore cached dependencies | ||
uses: actions/setup-node@v2 | ||
with: | ||
registry-url: 'https://registry.npmjs.org/' | ||
node-version: '16' | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Prepare git and update version | ||
run: | | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
npm run auto-version | ||
git commit -m "tags: updated tags" -a | ||
- name: Publish to NPM | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} | ||
tags: true | ||
name: Publish to NPM | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'index.js' | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
|
||
- name: Setup node and restore cached dependencies | ||
uses: actions/setup-node@v2 | ||
with: | ||
registry-url: 'https://registry.npmjs.org/' | ||
node-version: '16' | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Prepare git and update version | ||
run: | | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
npm run auto-version | ||
git commit -m "tags: updated tags" -a | ||
- name: Publish to NPM | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} | ||
tags: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
/node_modules | ||
package-lock.json | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./index')(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,12 @@ | ||
## @arthurfiorette/prettier-config | ||
# @arthurfiorette/prettier-config | ||
|
||
### Usage | ||
|
||
First, install | ||
## Usage | ||
|
||
```sh | ||
# Npm | ||
npm i -D @arthurfiorette/prettier-config | ||
|
||
# Yarn | ||
yarn add -D @arthurfiorette/prettier-config | ||
setup-aff-prettier # creates the .prettierrc.js file. | ||
``` | ||
|
||
You can just copy what is below in a `.prettierrc.js` file: | ||
|
||
```js | ||
// https://github.com/ArthurFiorette/prettier-config | ||
|
||
module.exports = require('@arthurfiorette/prettier-config')({ | ||
// Any options here will override @arthurfiorette/prettier-config defaults | ||
}); | ||
``` | ||
|
||
### See more | ||
## See more | ||
|
||
- [Prettier - extending configurations](https://prettier.io/docs/en/configuration.html#sharing-configurations) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env node | ||
|
||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
const code = ` | ||
// https://github.com/arthurfiorette/prettier-config | ||
module.exports = require('@arthurfiorette/prettier-config')({ | ||
// Any options here will override @arthurfiorette/prettier-config defaults | ||
}); | ||
`.trim(); | ||
|
||
fs.writeFileSync(path.resolve(process.cwd(), '.prettierrc.js'), code); | ||
|
||
console.log( | ||
'\x1b[7mCreated .prettierrc.js file with @arthurfiorette/prettier-config\x1b[0m' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,38 @@ | ||
/** @type {import('prettier').Options} */ | ||
const defaultConfig = { | ||
arrowParens: 'always', | ||
bracketSpacing: true, | ||
endOfLine: 'lf', | ||
insertPragma: false, | ||
bracketSameLine: false, | ||
jsxSingleQuote: false, | ||
printWidth: 90, | ||
proseWrap: 'always', | ||
quoteProps: 'as-needed', | ||
requirePragma: false, | ||
semi: true, | ||
singleQuote: true, | ||
tabWidth: 2, | ||
trailingComma: 'none', | ||
useTabs: false | ||
}; | ||
|
||
/** | ||
* Returns the prettier config with the given overridden options. | ||
* | ||
* @param {Partial<import('prettier').Options>} override | ||
* @returns {import('prettier').Options} | ||
* | ||
* @see {defaultConfig} | ||
*/ | ||
module.exports = function (override = {}) { | ||
return { ...defaultConfig, ...override }; | ||
}; | ||
|
||
module.exports.defaultConfig = defaultConfig; | ||
|
||
/** @satisfies {import('prettier').Options} */ | ||
const defaultConfig = { | ||
arrowParens: 'always', | ||
bracketSpacing: true, | ||
endOfLine: 'lf', | ||
insertPragma: false, | ||
bracketSameLine: false, | ||
jsxSingleQuote: false, | ||
printWidth: 90, | ||
proseWrap: 'always', | ||
quoteProps: 'as-needed', | ||
requirePragma: false, | ||
semi: true, | ||
singleQuote: true, | ||
tabWidth: 2, | ||
trailingComma: 'none', | ||
useTabs: false, | ||
vueIndentScriptAndStyle: false, | ||
plugins: [ | ||
require.resolve('prettier-plugin-packagejson'), | ||
require.resolve('prettier-plugin-jsdoc'), | ||
require.resolve('prettier-plugin-organize-imports') | ||
] | ||
}; | ||
|
||
/** | ||
* Returns the prettier config with the given overridden options. | ||
* | ||
* @param {Partial<import('prettier').Options>} override | ||
* @returns {import('prettier').Options} | ||
* | ||
* @see {defaultConfig} | ||
*/ | ||
module.exports = function config(override = {}) { | ||
return { ...defaultConfig, ...override }; | ||
}; | ||
|
||
module.exports.defaultConfig = defaultConfig; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters