Skip to content

Commit

Permalink
Release 0.0.1-alpha.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gky360 authored Jun 13, 2020
2 parents 47f71b0 + 6ec7a63 commit 81fb5c8
Show file tree
Hide file tree
Showing 28 changed files with 21,115 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/.git/
/.github/
Dockerfile*
node_modules
/dist/
/examples/
/storybook-static/
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.github/
/dist/
/examples/
/storybook-static/
!/.storybook/
57 changes: 57 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
parser: '@typescript-eslint/parser'
env:
browser: true
es6: true
node: true
extends:
- airbnb
- airbnb/hooks
- plugin:import/typescript
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- plugin:prettier/recommended
- prettier
- prettier/@typescript-eslint
- prettier/react
rules:
react/jsx-filename-extension:
- error
- extensions:
- '.jsx'
- '.tsx'
import/extensions:
- error
- '.ts': never
'.tsx': never
'.d.ts': never
'.js': never
'.jsx': never
jsx-a11y/label-has-associated-control:
- error
- assert: either
import/no-default-export: error
import/prefer-default-export: off
overrides:
- files:
- '**/*.tsx'
rules:
react/prop-types: off
- files:
- '**/*.stories.tsx'
rules:
import/no-default-export: off
- files:
- '**/*.js'
- '**/*.jsx'
- '**/*.stories.tsx'
rules:
'@typescript-eslint/explicit-function-return-type': off
- files:
- '.storybook/*.js'
- '**/*.test.js'
- '**/*.test.jsx'
- '**/*.test.ts'
- '**/*.test.tsx'
- '**/*.stories.tsx'
rules:
import/no-extraneous-dependencies: off
94 changes: 94 additions & 0 deletions .github/workflows/jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Jobs

on:
schedule:
- cron: "43 21 * * *"
push:
branches:
- "**"
tags:
- "v[0-9]+.[0-9]+.[0-9]+**"
pull_request:

jobs:
test:
strategy:
fail-fast: true
matrix:
os:
- windows-latest
- macos-latest
- ubuntu-latest
node-version:
- 12.16.0

name: Test (${{ matrix.os }} ${{ matrix.node-version }})
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci

- run: npm run lint
- run: npm run test:ci
- run: npm run deploy-storybook:ci -- --dry-run
if: matrix.os == 'ubuntu-latest'
- run: npm publish --dry-run
if: matrix.os == 'ubuntu-latest'

deploy-storybook:
needs: [test]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.16.0
- run: npm ci

- run: npm run deploy-storybook:ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-npm:
needs: [test]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.16.0
registry-url: https://registry.npmjs.org/
- run: npm ci

- run: npm run build
- run: npm publish --dry-run
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

publish-gpr:
needs: [test]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.16.0
registry-url: https://npm.pkg.github.com/
- run: npm ci

- run: npm run build
- run: npm publish --dry-run
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/dist/
/storybook-static/


#
# Node
#

# Logs
logs
*.log
Expand Down
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/__mocks__/
/.github/
/.storybook/
/examples/
/storybook-static/
*.test.*
*.stories.*
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"arrowParens": "always",
"endOfLine": "auto",
"singleQuote": true,
"trailingComma": "es5"
}
47 changes: 47 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* eslint-disable @typescript-eslint/no-var-requires */

const path = require('path');

module.exports = {
stories: ['../src/**/*.stories.tsx'],
addons: [
'@storybook/preset-typescript',
'@storybook/preset-scss',
'@storybook/addon-docs',
{
name: '@storybook/addon-storysource',
options: {
rule: {
test: [/\.stories\.tsx?$/],
},
loaderOptions: {
parser: 'typescript',
// eslint-disable-next-line global-require
prettierConfig: require('../.prettierrc.json'),
},
},
},
'@storybook/addon-actions',
'@storybook/addon-links',
'@storybook/addon-events',
'@storybook/addon-knobs',
'@storybook/addon-viewport',
],
webpackFinal: async (config) => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
{
loader: require.resolve('react-docgen-typescript-loader'),
options: {
// Provide the path to your tsconfig.json so that your stories can
// display types from outside each individual story.
tsconfigPath: path.resolve(__dirname, '../tsconfig.json'),
},
},
],
});
config.resolve.extensions.push('.ts', '.tsx');
return config;
},
};
4 changes: 4 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { addDecorator } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';

addDecorator(withKnobs);
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:12.16.0

WORKDIR /app

COPY package.json .
COPY package-lock.json .

RUN npm ci

COPY . .
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# react-ngl

[![Jobs](https://github.com/gky360/react-ngl/workflows/Jobs/badge.svg)](https://github.com/gky360/react-ngl/actions)

React wrapper for ngl
1 change: 1 addition & 0 deletions __mocks__/styleMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
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: 'ts-jest',
setupFilesAfterEnv: ['jest-enzyme'],
testEnvironment: 'enzyme',
moduleNameMapper: {
'\\.(s?css|less)$': '<rootDir>/__mocks__/styleMock.js',
},
testPathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/examples/',
'<rootDir>/storybook-static/',
],
};
Loading

0 comments on commit 81fb5c8

Please sign in to comment.