Skip to content

Commit

Permalink
Setup prettier
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
  • Loading branch information
alexandrebodin committed Feb 19, 2020
1 parent 566ee06 commit 97e50bc
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 26 deletions.
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
endOfLine: 'lf',
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
printWidth: 100,
};
6 changes: 1 addition & 5 deletions bin/base.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
'use strict';

const { execDocker } = require('./utils');
const {
NODE_VERSIONS,
BASE_IMAGE_NAME,
LATEST_NODE_VERSION,
} = require('./contstants');
const { NODE_VERSIONS, BASE_IMAGE_NAME, LATEST_NODE_VERSION } = require('./contstants');

module.exports = {
buildBaseImages,
Expand Down
19 changes: 3 additions & 16 deletions bin/strapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
const semver = require('semver');

const { execDocker, getLatestStrapiRelease } = require('./utils');
const {
STRAPI_IMAGE_NAME,
NODE_VERSIONS,
LATEST_NODE_VERSION,
} = require('./contstants');
const { STRAPI_IMAGE_NAME, NODE_VERSIONS, LATEST_NODE_VERSION } = require('./contstants');

module.exports = {
buildStrapiImages,
Expand Down Expand Up @@ -39,12 +35,7 @@ async function buildStrapiImages({ version, shouldPush = false } = {}) {
return createdTags.map(tag => `${STRAPI_IMAGE_NAME}:${tag}`);
}

async function buildStrapiImage({
nodeVersion,
version,
alpine = false,
shouldPush = false,
}) {
async function buildStrapiImage({ nodeVersion, version, alpine = false, shouldPush = false }) {
let tmpImg = `${STRAPI_IMAGE_NAME}:tmp`;

await execDocker([
Expand Down Expand Up @@ -73,11 +64,7 @@ async function buildStrapiImage({
return tags;
}

function buildStrapiTags({
version: strapiVersion,
nodeVersion,
alpine = false,
}) {
function buildStrapiTags({ version: strapiVersion, nodeVersion, alpine = false }) {
let tags = [];
let versions = [strapiVersion];

Expand Down
7 changes: 3 additions & 4 deletions bin/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ const got = require('got');
const { REPO } = require('./contstants');

async function getLatestStrapiRelease() {
const { body } = await got(
`https://api.github.com/repos/${REPO}/releases/latest`,
{ json: true }
);
const { body } = await got(`https://api.github.com/repos/${REPO}/releases/latest`, {
json: true,
});

return body.tag_name.slice(1); // remove the v prefix
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"yargs": "^14.2.0"
},
"devDependencies": {
"eslint": "^6.5.1"
"eslint": "^6.5.1",
"prettier": "1.19.1"
}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,11 @@ prepend-http@^2.0.0:
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=

prettier@1.19.1:
version "1.19.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==

progress@^2.0.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
Expand Down

0 comments on commit 97e50bc

Please sign in to comment.