* Remove json.parse(json.stringify( usage to improve performance
* Fix missing / duplicate keys in some renders
* Fix missing react-is dependency (only seemed to cause problems from pruning on the heroku deploy)
* Add nextjs tag to datadog-connect config when nextjs is a query param
* Fix router.asPath usage to exclude query param
* Fix styling inconsistencies noticed when testing
* Add a few tests
* fix: req.csrfToken doesn't always exist (e.g. 500 page)
* feat: update dockerfile and add nextjs to build
* fix: run linter
* move @babel deps -> dev deps
* move webpack looking things from deps -> dev deps
* move pa11y-ci to optional dep
* explicitly include optional deps for pa11y
* allow heroku dev deps to be installed
* fix: update postcss module
* fix: update dockerfile build
* tmp: disable renderReact
* see if another deploy is slower/faster
* move a few more packages to devDeps
* upgrade to package-lock v2
* use dayjs instead of date-fns
* move cross-env to devDeps
* remove unused 'del' package
* commit husky precommit hooks
* add hrtime to clone-for-build.js
* Revert "add hrtime to clone-for-build.js"
This reverts commit 70ee647bacce833f4ed2f621f62c63c1d85e5413.
* update babel/eslint
* fix: remove unused plugin
* try a .slugignore
* fix: heroku-postbuild to use npm run build
* fix: i cannot spell dereferenced
* add .next/cache to heroku cacheDirectories
* test cached build
* remove aws-sdk, see what breaks
* move jest-puppeteer to optional deps
* fix: update browser-test.yml to use newer node version
* move jimp to optional dependencies
* move puppeteer to optional dependencies
* fix: ci optional include
* fix: bad copy pasta
* remove previous react experiment
* update tests/README.md with note about optional deps
* bump node test version back to 14
* convert package-lock back to v1
* fix: use node 15.x to leverage npm optional deps
* fix: optional dep install
* test: see what happens with heroku/nodejs-typescript buildpack
* back to heroku/nodejs buildpack
* move jest to optional
* revert jest move
* remove .slugignore
* cleanup dockerfile, move xlsx-population to optional, add comment about optional deps
* Update Dockerfile
Co-authored-by: James M. Greene <JamesMGreene@github.com>
Co-authored-by: James M. Greene <JamesMGreene@github.com>
* feat: add nextjs middleware handling split
* fix: eslint errors
* fix: filter boolean from csp list
* fix: feature flag nextjs server start
* feat: add prettier rules for ts,tsx files
* fix: remove unnecessary async from next middleware
* fix: next middleware name
* Update tsconfig.json
Co-authored-by: James M. Greene <JamesMGreene@github.com>
* Update next-env.d.ts
Co-authored-by: James M. Greene <JamesMGreene@github.com>
* fix: add typescript linting to lint command
* add comment for unsafe-eval, update webpack to use eval in development
* fix: feature flag typo
Co-authored-by: James M. Greene <JamesMGreene@github.com>
* Use existing 'github' script helper to get Octokit instance
* Move @octokit/rest to devDeps
We only use it in scripts, currently
* Removed outdated delete-unused-staging-apps script
* Upgrade primer to 16
* Upgrade colors in scss
* Get SCSS to build
* Initial dark mode support
* trashcan -> trash
* More specific search browser test
* Fix link color on homepage
* Update overrides.scss
* Upgrade some colors to primer variables
* Hide dark mode support for now
* Apply suggestions from code review
* Update overrides.scss
* Use [node-]redis as a direct dependency
* Extract Redis client creation to its own module
* Attach extensive logging in the Redis client creation module
* Allow the rate limiter to pass requests when Redis is disconnected
* Update rate-limit-redis
* Default error input to empty object for formatRedisError method
* Provide a name for the rate limiter's Redis client
* Include redis-mock, exclude ioredis/ioredis-mock
* Remove unused RedisAccessor#exists method
* Switch RedisAccessor to use redis/redis-mock
* Provide a name for logging on the Redis page cache
* Remove extraneous trailing space from Redis logging prefix
Our updated use of console.* will already be adding a space after the prefix
* Replace ioredis-mock with redis-mock in tests
* Revert removal of ioredis dependency
* Bind Redis client to async promisified methods
* Extract former RedisAccessor constructor tests to new create-client tests
* Update RedisAccessor tests to work with the callback-based redis client
* Handle formatting Redis errors (or not) with more resiliency
* Remove ioredis as a dependency
* Update Redis soft-purging script to use node-redis
* Do more promisifying for less ugly code
* Add comment explaining TTL of -1
* Make the script executable
* Use [node-]redis as a direct dependency
* Extract Redis client creation to its own module
* Attach extensive logging in the Redis client creation module
* Allow the rate limiter to pass requests when Redis is disconnected
* Update rate-limit-redis
* Default error input to empty object for formatRedisError method
* Provide a name for the rate limiter's Redis client
* Include redis-mock, exclude ioredis/ioredis-mock
* Remove unused RedisAccessor#exists method
* Switch RedisAccessor to use redis/redis-mock
* Provide a name for logging on the Redis page cache
* Remove extraneous trailing space from Redis logging prefix
Our updated use of console.* will already be adding a space after the prefix
* Replace ioredis-mock with redis-mock in tests
* Revert removal of ioredis dependency
* Bind Redis client to async promisified methods
* Extract former RedisAccessor constructor tests to new create-client tests
* Update RedisAccessor tests to work with the callback-based redis client
* Handle formatting Redis errors (or not) with more resiliency
- add `script/test-render-translation.js` to render all translated content to catch malformed liquid that would cause render errors
- improve test output for `script/fix-translation-errors.js` and `tests/content/lint-files.js`
- make it so `script/reset-translated-file.js` can handle files that have been renamed
* Use [node-]redis as a direct dependency
* Extract Redis client creation to its own module
* Attach extensive logging in the Redis client creation module
* Allow the rate limiter to pass requests when Redis is disconnected
* Update rate-limit-redis
* Default error input to empty object for formatRedisError method
* Provide a name for the rate limiter's Redis client
Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
* Install throng for easy cluster management
* Extract the Express app construction into its own file
* Switch server.js to use app clustering for deployed environments
* Worker count is based on the lesser of process.env.WEB_CONCURRENCY and the count of CPUs
* Reading clustered output is difficult, let's prefix the std{out,err} streams
Co-authored-by: Jason Etcovitch <jasonetco@github.com>
* Add middleware to timeout requests after a period
* Add halt-on-dropped-connection middleware to stop the middleware processing stack if the connection was already dropped
* Add a few strategic bail-out spots for dropped connections during the render-page middleware
* Handle 404s and HEAD requests earlier in the page rendering flow
* Add a few more strategic bail-out spots for dropped connections during the render-page middleware
* Add middleware to notice aborted requests
* Add a check for aborted requests into the isConnectionDropped logic
* Reformat comment for consistency
* Handle aborted requests correctly in the error handler
* Explicit returns for consistency
* Install liquidjs, uninstall liquid
* Comment a bunch of stuff out to get going
* Fix invalid includes
* Fix all includes (path => 'path')
* Get the homepage to render
* Do link-in-list kinda
* Revert "Fix all includes (path => 'path')"
This reverts commit d6fead646353aa5041d9229470a62a1d487456b9.
* Support non-dynamic partials
* Extract getTemplate helper
* Do remaining custom Liquid tags
* Fix some custom tag bugs
* Moar bugs
* Re-add link tag
* Cleaner diff
* Actually fix extended markdown tags
* Fully comment out version matchers
* Smaller diff
* Rely only on Liquid internals for conditionals
* Use new operators option in Liquid engine
* Fix link.js
* Don't need options
* Updoot to the right doot
* Fix some bugs
* Fix another bug
* Pass a test
* Fix the translate bits
* Adjust a test
* Fix another invalid Liquid bug
* Two more borked translations
* Found some more
* Don't need this change
* Revert "Don't need this change"
This reverts commit a916d619747f0492865a69c3e237c97c4d4e7fad.
* This should fix the broken links
* Missed one
* Revert "This should fix the broken links"
This reverts commit e6c2cc0d9055d958706260d57edbe293281c150e.
* Revert "Missed one"
This reverts commit bbe1f23baf16e020f6f7931589decb1afc75dfbd.
* Updoot liquidjs
### Why:
A lot of content gets mistranslated, some common patterns are: frontmatter date and enums getting translated, liquid tags get translated or go missing during the translation process. These translation errors are tough to catch, especially when they often come in huge PRs.
### What's being changed:
- Frontmatter is also getting linted against schema as part of `lint-files`
- When an environment variable `TEST_TRANSLATION` is passed,
- `lint-files` will run its tests against all files that have been newly translated (by git-diffing between `translations` branch and `main` branch), and
- results are outputted using a custom jest reporter. The output is formatted in a way that makes it easy to exclude the problematic translated files from being merged, and to share the errors with [localization support](https://github.com/github/localization-support/issues/489).
- Run the implemented translation test as part of the existing `Node.js Tests - Translations` workflow
* Write our plugin
* Include it
* Move the RegEx
* Don't rewriteLocalLinks with cheerio anymore
* Process after HTML ast is generated
* Use the same logic as before, just to see if it'll pass
* Don't require languageCode/version
* Only work on local links
* Needs an href
* Only update href if there's a new one to use
* Check for node.properties
* Some links are just mean
* Move use-english-headings to be a plugin
* Bail if no englishHeadings were passed
* Install rehype-wrap
* Wrap ol > li img in div.procedural-image-wrapper
* Test for platform without cheerio
* Use a plugin for rewriteAssetPathsToS3
* Remove cheerio from page.render
* Fix require paths
* SImplify
* Fix some 🐛s
* Use our own rehype-wrap
* Move rewriteAssetPathsToS3 after HTML AST
* Remove some console logs
* Fix check for includesPlatformSpecificContent
* Rename ast => tree
* Uninstall hubdown, install unified deps
* Create create-processor
* Use it
* Update a doc
* Tweak the language
* Use the same versions that hubdown used
* Add Lunr as a site search option
* Use a class like the Algolia option does
* Lint
* Working on showing real content, prep for highlighting
* Move searching to their own files
* Split out ridiculous fn
* Add highlighting
* Less lunr search code
* A little more tidy
* Then chain on write too
* Mark from server too
* Write a batch of indices
* Update compress.js
* Highlighting with fewer calls
* Update lunr-search.js
* Update lunr-search.js
* Update lunr-search.js
* Update lunr-search.js
* Update lunr-search.js
* Update lunr-search.js
* Add markdown parsing dependencies
* Use it for the link test
* Use ast tests for hard-coded language
* Dedupe visiting for links
* Add new mdast utils to check-deps exclusions
* Move site search to use an endpoint
* Update browser.js
* Update search.js
* Update lib/search/versions.js
Co-authored-by: James M. Greene <JamesMGreene@github.com>
* Fix URLs
Co-authored-by: James M. Greene <JamesMGreene@github.com>
* Explicitly set the Redis database number used for rate limiting
* Switch to using ioredis as the Redis client for rate limiting
* Install ioredis-mock as a primary dependency
* Create a Redis BasicAccessor class and tests
* Switch rendered page caching to use Redis for storage
* Add support for additional Redis SET options like TTLs
* Remove currently unused methods
* Rename redis-accessors/basic to redis-accessor and remove extra fluff
* Change default behavior for cache setting to throw if an error occurs
Add option allowSetFailures to facilitate graceful failures
* Allow SET failures to fail gracefully for the rendered page cache
* Remove as-yet unneeded serialization options from RedisAccessor
* Move Redis client construction into RedisAccessor constructor, just pass in databaseNumber as option
* Remove rendered-page-cache in favor of direct RedisAccessor use
* Add tests for RedisAccessor constructor param validations
* Eliminate one roundtrip to Redis for the cached HTML existence check
Are we fast yet?
* Set a rendered page cache TTL of 24 hours
* npm i connect-datadog
* Add connectDatadog middleware
* Add comments
* Use DD_API_KEY to gate
Co-authored-by: Chiedo John <2156688+chiedo@users.noreply.github.com>
* Update README
* create structure for discussions landing page
* is everything broken
* [Universe] Dark mode (#16545)
* Fix title
* Add Discussions product
* Correct title
* Correct title
* Move quickstart article
* Move quickstart back out into article
* Add and incorporate reusables
* Move information about search
* Draft conceptual information
* Draft best practices
* Draft further reading
* Draft product introduction
* Draft introduction
* Add author metadata
* Pluralize
* Fix typos
* Add introduction
* Bump Octicons
* Add some reusables
* Add images
* Revise article
* Draft article
* Change word
* 🔪 the gerund
* Add reusable
* Revise introduction
* Revise list
* Simplify
* Revise reusable
* Fix reusable; add context
* Rename reusable
* Deduplicate conceptual information
* 🔪 gerund
* Add link to further reading
* Move link and dispose of tip
* Delete space
* Add images
* Add conceptual section
* Add word
* Delete newline
* Revert package.json to state on main
* Tweak images
* Draft article
* Add product name
* Remove beta note
* Use product name for future-proofing
* Begin adding search information
* Fix copypasta
* little edits
* build out a bit more of the guides content
* Don't mention integrations for now
* Escape quote
* Remove authorship information for new defaults
* Finish drafting article
* Replace encoded character to match description
* Revise away inline link
* Accommodate 'for more information' in reusable
* Fix links
* Fix one last bit of copypasta
* Update indices
* Temporarily remove heading
* Update introduction
* Add new article 💀
* Remove commits from universe-2020-megabranch
* Add article 💀
* update with a very rough draft
* Add content about collaboration options to "About repositories"
* Add content about discussions to "About issues"
* Reorder content
* Add is:discussion query
* update with a few mmore fleshed out sections
* update with more structure
* Add reusable
* Add screenshots
* Clear way for actual procedural
* Discussions landing page "Communities" section (#16692)
* Make button Overview-able
* Make card filtering more extensible
* Guard for missing attributes
* Use arbitrary dataset attributes
* Add section with discussions-community-card
* Tweak show more button behavior
* Conditionally show "Show more"
* Add beta_product frontmatter/label
* Remove beta callout note
* Hide changelog with no items
* Finish importing community info
* Fix borked markup
* Omit search abr
* Two columns should actually be two columns
* Use org image, change card layout
* Add two more examples
* Fix title
* Escape quote
* Escape another quote
* Draft article
* Lower case
* Relocate conceptual information
* Update qualifier name
* Draft article
* Add conceptual information and links
* Remove duplicative section
* Fix copypasta
* Revise reusable
* Update link
* Add content on categories
* Lint the discussions YAML file
* Update introduction and permissions
* ⚓
* Reusablize; fix link
* more planning content stuff
* Escape quotes
* Align prerequisites
* Soften
* Clean up prerequisites
* Fix titles; version; add screenshot
* Fix links
* Actually fix links
* Use better variable
* Mention pinning
* Update screenshots
* Add screenshot
* forgot to committ
* update with reusable
* add that screenshot
* beef up landing page a bit
* remove extra space
* messed that up
* fix hardcoded linkks weirdo
* fix tests
* update with permissions content
* update with placeholder
* filter out standalone category files from test
* update
* update @becca's ⚡ feedback
* update with more feedback
* so many updates
* fix links
* fix some more tests
* flesh some more things out
* update with further reading blah blah
* fix some things
* remove the gate-features label for beta ship only
* Add discussions video to product landing page (#16759)
* Add discussions video placeholder
* This might work maybe
* fix tests
* apply all of @becca's and @lecoursen's ⚡ feedback ❤️
* rename to fix test
* Revert "Add discussions video to product landing page (#16759)"
This reverts commit 2247e5d0881ca6b36cee421218e8341a7cc12ac7.
* update with test fix
Co-authored-by: Melanie Yarbrough <11952755+myarb@users.noreply.github.com>
Co-authored-by: Laura Coursen <lecoursen@github.com>
Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com>
Co-authored-by: Jason Etcovitch <jasonetco@github.com>
Co-authored-by: Sarah Schneider <sarahs@github.com>
* chore: Move standard to ESLint config
* fix: auto-fix ESLint indent issues
* fix: ESLint prefer-regex-literals
* fix: ESLint array-callback-return
- .filter must return a boolean value
- .map replaced with forEach when the value isn't used
* fix: ESLint no-extra-semi
Related to #128
- Prettier to fix indenting/quoting across files
- Manually adjust list styles to "-" style
- Ignore all translated files from automated formatting
- Drop redundant CI env variable
* add linkinator npm package
* add new script that uses Linkinator
* reorg the excluded links file and update comments
* replace blc artifacts with linkinator artifacts in .gitignore
* update the scheduled workflow to use the new script
* dismantle BLC scripts
* add workflow_dispatch event so we can test this manually
* npm uninstall broken-link-checker
* use different exit codes depending on whether broken links are found