Skip to content

Commit

Permalink
Merge pull request #1 from lifeomic/bootstrap
Browse files Browse the repository at this point in the history
Bootstrap Repo
  • Loading branch information
swain authored Oct 20, 2021
2 parents 7f99a3d + e2ef35d commit a84d73e
Show file tree
Hide file tree
Showing 15 changed files with 3,414 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
extends: ['@lifeomic/standards'],
overrides: [
// Set correct env for config files
{
files: ['*.js'],
env: {
node: true,
},
},
],
};
1 change: 1 addition & 0 deletions .github/lifeomic-probot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enforceSemanticCommits: true
18 changes: 18 additions & 0 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PR Build & Test

on: pull_request

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- name: Build & Test
run: |
yarn install --frozen-lockfile
yarn lint
yarn test
yarn build
27 changes: 27 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- name: Test
run: |
yarn install --frozen-lockfile
yarn lint
yarn test
yarn build
- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.LIFEOMIC_NPM_TOKEN }}
run: |
npx semantic-release
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
*.log
dist
.vscode
coverage
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# eslint-plugin-i18next
This repository contains an ESLint plugin for validating usage of [`18next`](https://github.com/i18next/i18next).
20 changes: 20 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { execSync } = require('child_process');
const { unlinkSync } = require('fs');
const glob = require('glob');

const run = (cmd) => execSync(cmd, { stdio: 'inherit' });

run('rm -rf dist/');

run('yarn tsc');

for (const file of ['package.json', 'yarn.lock', 'README.md']) {
run(`cp ${file} dist/`);
}

// Remove test files from output
for (const file of glob.sync('dist/**/*.test.*')) {
unlinkSync(file);
}

console.log('✔️ Successfully built library to dist folder');
13 changes: 13 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
preset: '@lifeomic/jest-config',
testMatch: ['<rootDir>/**/*.test.ts'],
collectCoverage: true,
coverageThreshold: {
global: {
branches: 100,
statements: 100,
functions: 100,
lines: 100,
},
},
};
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "@lifeomic/eslint-plugin-i18next",
"version": "0.0.0",
"description": "An ESLint plugin for validating i18next usage",
"main": "index.js",
"repository": "git@github.com:lifeomic/eslint-plugin-i18next.git",
"author": "LifeOmic <development@lifeomic.com>",
"license": "UNLICENSED",
"scripts": {
"lint": "eslint . && prettier --check .",
"test": "jest",
"build": "node build.js"
},
"devDependencies": {
"@lifeomic/eslint-config-standards": "^1.2.1",
"@lifeomic/jest-config": "^1.0.2",
"@lifeomic/typescript-config": "^1.0.1",
"@types/eslint": "^7.28.1",
"@types/jest": "^27.0.2",
"eslint": "^7.32.0",
"glob": "^7.2.0",
"jest": "^27.3.1",
"jest-circus": "^27.3.1",
"prettier": "^2.4.1",
"ts-jest": "^27.0.7",
"typescript": "^4.4.4"
}
}
5 changes: 5 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
arrowParens: 'always',
trailingComma: 'all',
singleQuote: true,
};
16 changes: 16 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
branches: ['master'],
plugins: [
['@semantic-release/commit-analyzer', { preset: 'conventionalcommits' }],
['@semantic-release/npm', { pkgRoot: 'dist/' }],
[
'@semantic-release/github',
{
// Setting this to false disables the default behavior
// of opening a GitHub issue when a release fails.
// We have other methods of tracking these failures.
failComment: false,
},
],
],
};
5 changes: 5 additions & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { placeholder } from './';

test('placeholder', () => {
expect(placeholder).toBe('placeholder');
});
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const placeholder = 'placeholder';
14 changes: 14 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "@lifeomic/typescript-config",
"exclude": ["node_modules"],
"include": ["src"],
"compilerOptions": {
"target": "es2019",
"module": "commonjs",
"lib": ["ES2020"],
"outDir": "./dist",
"inlineSources": false,
"inlineSourceMap": false,
"esModuleInterop": false
}
}
Loading

0 comments on commit a84d73e

Please sign in to comment.