diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..434abb18 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,122 @@ +# For all PRs, this workflow will +# - Install deps +# - Lint +# - Typecheck +# - Test +name: CI + +on: + # will run on all PRs that are opened or updated (synchronized) + pull_request: + types: [opened, synchronize, reopened] + +jobs: + # changelog must be edited for every PR + changelog: + name: Updates Changelog + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dangoslen/changelog-enforcer@v1.4.0 + with: + changeLogPath: "CHANGELOG.md" + skipLabel: "no-changelog" + + lint: + name: Lint + runs-on: ubuntu-latest + env: + CI: true + steps: + - uses: actions/checkout@v2 + - id: nvmrc + run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) + + - name: Use Node Version from nvmrc + uses: actions/setup-node@v1 + with: { node-version: "${{ steps.nvmrc.outputs.NODE_VERSION }}" } + + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - name: Install Dependencies + run: npm install + + - name: Lint + run: npm run lint + + typecheck: + name: Typecheck + runs-on: ubuntu-latest + env: + CI: true + steps: + - uses: actions/checkout@v2 + - id: nvmrc + run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) + + - name: Use Node Version from nvmrc + uses: actions/setup-node@v1 + with: { node-version: "${{ steps.nvmrc.outputs.NODE_VERSION }}" } + + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - name: Install Dependencies + run: npm install + + - name: Typecheck + run: node_modules/typescript/bin/tsc --noEmit + + test: + name: Test & Coverage + runs-on: ubuntu-latest + env: + CI: true + steps: + - uses: actions/checkout@v2 + - id: nvmrc + run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) + + - name: Use Node Version from nvmrc + uses: actions/setup-node@v1 + with: { node-version: "${{ steps.nvmrc.outputs.NODE_VERSION }}" } + + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - name: Install Dependencies + run: npm install + + - name: Test + run: npm run test diff --git a/.nycrc b/.nycrc deleted file mode 100644 index 1f41d8a5..00000000 --- a/.nycrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "@istanbuljs/nyc-config-babel" -} diff --git a/.storybook/addons.js b/.storybook/addons.js deleted file mode 100644 index 8e6a6949..00000000 --- a/.storybook/addons.js +++ /dev/null @@ -1,4 +0,0 @@ -import '@storybook/addon-actions/register'; -import '@storybook/addon-notes/register-panel'; -import '@storybook/addon-a11y/register'; -import '@storybook/addon-knobs/register'; diff --git a/.storybook/config.js b/.storybook/config.js deleted file mode 100644 index e1f1e74d..00000000 --- a/.storybook/config.js +++ /dev/null @@ -1,14 +0,0 @@ -import { configure } from '@storybook/react'; -import { addDecorator } from '@storybook/react'; -import { withA11y } from '@storybook/addon-a11y'; -import { withKnobs } from '@storybook/addon-knobs'; - -// automatically import all files ending in *.stories.js -const req = require.context('../stories', true, /\.stories\.jsx$/); -function loadStories() { - req.keys().forEach(filename => req(filename)); -} - -configure(loadStories, module); -addDecorator(withA11y); -addDecorator(withKnobs); diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js deleted file mode 100644 index 73f9a61a..00000000 --- a/.storybook/webpack.config.js +++ /dev/null @@ -1,18 +0,0 @@ -const path = require('path'); - -// Export a function. Accept the base config as the only param. -module.exports = async ({ config, mode }) => { - // `mode` has a value of 'DEVELOPMENT' or 'PRODUCTION' - // You can change the configuration based on that. - // 'PRODUCTION' is used when building the static version of storybook. - - // Make whatever fine-grained changes you need - config.module.rules.push({ - test: /\.scss$/, - use: ['style-loader', 'css-loader', 'sass-loader'], - include: path.resolve(__dirname, '../'), - }); - - // Return the altered config - return config; -}; diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b994cd34..00000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -language: node_js -node_js: - - 10.16.0 -install: npm install -before_script: npm run dist -script: npm test -before_deploy: echo "All unit tests pass. Launching build on AWS EB." -deploy: - - provider: elasticbeanstalk - skip_cleanup: true - access_key_id: "$AWS_ACCESS_KEY_ID_DEVELOPMENT" - secret_access_key: "$AWS_SECRET_ACCESS_KEY_DEVELOPMENT" - region: us-east-1 - app: sfr-front-end - env: sfr-front-end-development - bucket_name: elasticbeanstalk-us-east-1-224280085904 - bucket_path: rnw-front-end-development - on: - repo: NYPL/sfr-bookfinder-front-end - branch: development - - provider: elasticbeanstalk - skip_cleanup: true - access_key_id: "$AWS_ACCESS_KEY_ID_PRODUCTION" - secret_access_key: "$AWS_SECRET_ACCESS_KEY_PRODUCTION" - region: us-east-1 - app: DigitalResearchBooks-front-end - env: digital-research-books-beta - bucket_name: elasticbeanstalk-us-east-1-946183545209 - bucket_path: DigitalResearchBooks-front-end - on: - repo: NYPL/sfr-bookfinder-front-end - branch: beta-production -env: - global: - - secure: sBbLIPtXIpRUFo7PBduT8aQocYts2MTlBSKcCr/1WGGAoih3lEkTDPJkiGxaF6vqCCdfkBLPIECzYbiH49ZA6HrR/nnKVsvFbTAc5MQkCrPyipEXy27/urohzQDK1tH0wmr6Xz1Of80RwO4/viuX/pjRXwvbkw+jOO0+2J6Jl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hlz2mBQABiJTXkDt07VBPfJIpuJdqvfdLTYM4TVpI0lfR6Rrhpcy/3+HDUqwu4T2JSeAOY= diff --git a/AWSCLIV2.pkg b/AWSCLIV2.pkg deleted file mode 100644 index 4ab57b9d..00000000 Binary files a/AWSCLIV2.pkg and /dev/null differ diff --git a/CHANGELOG.md b/CHANGELOG.md index f666b9f8..174f7242 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # CHANGE LOG +## PRERELEASE +- Refactors app to use NextJS, NYPL Design System, Typescript + ## [0.9.3] - Updated dgx-global-footer to 0.5.7. - Adds the new urlType prop to the Footer component set to "absolute" diff --git a/package-lock.json b/package-lock.json index ec5ad6c1..02f80a22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2146,9 +2146,9 @@ "dev": true }, "@types/node": { - "version": "14.14.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.31.tgz", - "integrity": "sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==", + "version": "14.14.33", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.33.tgz", + "integrity": "sha512-oJqcTrgPUF29oUP8AsUqbXGJNuPutsetaa9kTQAQce5Lx5dTYWV02ScBiT/k1BX/Z7pKeqedmvp39Wu4zR7N7g==", "dev": true }, "@types/normalize-package-data": { @@ -15857,8 +15857,7 @@ "typescript": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.2.tgz", - "integrity": "sha512-tbb+NVrLfnsJy3M59lsDgrzWIflR4d4TIUjz+heUnHZwdF7YsrMTKoRERiIvI2lvBG95dfpLxB21WZhys1bgaQ==", - "dev": true + "integrity": "sha512-tbb+NVrLfnsJy3M59lsDgrzWIflR4d4TIUjz+heUnHZwdF7YsrMTKoRERiIvI2lvBG95dfpLxB21WZhys1bgaQ==" }, "ua-parser-js": { "version": "0.7.24", diff --git a/package.json b/package.json index e8f81540..6e935863 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,8 @@ "private": true, "scripts": { "dev": "next dev", - "eb-dev": "next dev -p $PORT", "build": "next build", "start": "next start", - "eb-start": "NODE_ENV=development next build && node ./server.js", "test": "jest", "test:watch": "jest --watch", "lint": "eslint --ignore-path .gitignore '*/**/*.{ts,tsx}'", @@ -24,7 +22,10 @@ "react": "^16.14.0", "react-dom": "^16.14.0", "redux": "4.0.1", - "sass": "^1.29.0" + "sass": "^1.29.0", + "typescript": "^4.1.3", + "@types/node": "^14.14.33", + "@types/react": "^16.9.5" }, "devDependencies": { "@testing-library/jest-dom": "^5.11.9", @@ -33,7 +34,6 @@ "@types/enzyme-adapter-react-16": "^1.0.6", "@types/jest": "^26.0.20", "@types/mocha": "^8.2.0", - "@types/react": "^16.9.5", "@types/testing-library__jest-dom": "^5.9.5", "@typescript-eslint/eslint-plugin": "^4.10.0", "@typescript-eslint/parser": "^4.10.0", @@ -52,7 +52,6 @@ "eslint-plugin-react-hooks": "^4.2.0", "jest": "^26.6.3", "next-page-tester": "^0.23.0", - "prettier": "^2.2.1", - "typescript": "^4.1.3" + "prettier": "^2.2.1" } }