diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d3f2cdb..689cef0 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,12 +38,12 @@ jobs: # If this run was triggered by a pull request event, then checkout # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 + - run: git checkout HEAD^1 if: ${{ github.event_name == 'pull_request' }} # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -54,7 +54,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -68,4 +68,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 7fe6bb5..8ab3c7a 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -14,7 +14,7 @@ jobs: node-version: '16' - name: npm install, build, and test run: | - npm ci + npm install npm run lint npm run build --if-present env: diff --git a/.gitignore b/.gitignore index 2768c68..dd02c06 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ node_modules .firebase .next .meta +.env diff --git a/.hintrc b/.hintrc new file mode 100644 index 0000000..cb34607 --- /dev/null +++ b/.hintrc @@ -0,0 +1,8 @@ +{ + "extends": [ + "development" + ], + "hints": { + "no-inline-styles": "off" + } +} \ No newline at end of file diff --git a/.nvmrc b/.nvmrc index 8351c19..3c03207 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -14 +18 diff --git a/components/badgen-title.tsx b/components/badgen-title.tsx index a829046..527ce56 100644 --- a/components/badgen-title.tsx +++ b/components/badgen-title.tsx @@ -10,7 +10,7 @@ export default function BadgenTitle ({ host }) {

- badgen logo + badgen logo Badgen

diff --git a/components/builder-preview.tsx b/components/builder-preview.tsx index d5dbeb3..2b21dd2 100644 --- a/components/builder-preview.tsx +++ b/components/builder-preview.tsx @@ -1,4 +1,3 @@ -// import debounceRender from 'react-debounce-render' import BadgenTitle from './badgen-title' const BadgePreview = ({ host, badgeURL, focus }) => { @@ -11,7 +10,7 @@ const BadgePreview = ({ host, badgeURL, focus }) => {
- - - ) - } -} diff --git a/pages-/builder.tsx b/pages-/builder.tsx deleted file mode 100644 index 78c89c5..0000000 --- a/pages-/builder.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import React from 'react' -import Preview from '../components/builder-preview' -import Bar from '../components/builder-bar' -import Hints from '../components/builder-hints' -import Helper from '../components/builder-helper' -import Footer from '../components/footer' - -export default class BuilderPage extends React.Component { - state = { - host: undefined, - badgeURL: '', - placeholder: '', - focus: false - } - - handleBlur = () => this.setState({ focus: false }) - - handleFocus = () => this.setState({ focus: true }) - - handleChange = badgeURL => this.setState({ badgeURL }) - - handleSelect = exampleURL => this.setState({ badgeURL: exampleURL }) - - componentDidMount () { - const forceHost = new URL(window.location.href).searchParams.get('host') - this.setState({ - host: (forceHost || window.location.origin) + '/', - badgeURL: window.location.hash.replace(/^#/, ''), - placeholder: 'badge/:subject/:status/:color?icon=github' - }) - } - - render () { - const { host, placeholder, badgeURL, focus } = this.state - - return ( -
-
- - - - {badgeURL && } -
-
- -
- ) - } -} diff --git a/pages-/index.tsx b/pages-/index.tsx deleted file mode 100644 index 846c232..0000000 --- a/pages-/index.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { useState, useEffect } from 'react' -import BadgeExamples from '../components/badge-examples' -import BadgenTitle from '../components/badgen-title' -// import TopBar from '../components/top-bar' -import Intro from '../components/home-intro' -import Footer from '../components/footer' -import examples from '../public/.meta/badges.json' - -const Index = () => { - const [tab, setTab] = useState('live') - const [host, setHost] = useState('') - const badges = examples[tab] - - useEffect(() => { - const forceHost = new URL(window.location.href).searchParams.get('host') - setHost((forceHost || window.location.origin) + '/') - }) - - return <> - -
- -

Badge Gallery

- - - -
-