name: Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "esnext", | |
"module": "esnext", | |
"strict": true, | |
"jsx": "preserve", | |
"importHelpers": true, | |
"moduleResolution": "node", | |
"experimentalDecorators": true, | |
"esModuleInterop": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/inline' | |
require 'minitest/autorun' | |
gemfile true do | |
source 'https://rubygems.org' | |
gem 'activerecord', require: 'active_record' | |
gem 'sqlite3' | |
end | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deprecator = ActiveSupport::Deprecation.new('in the future', 'B4B') | |
deprecator.behavior = ActiveSupport::Deprecation.behavior | |
ActiveSupport::Deprecation.deprecate_methods( | |
Rails.application.routes.named_routes.path_helpers_module, | |
:foo_path, | |
:bar_path, | |
deprecator: deprecator | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
require 'rails' | |
require 'action_view' | |
require 'action_controller' | |
require 'rspec/rails' | |
class TestApplication < Rails::Application | |
end | |
RSpec.describe 'example', type: :controller do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "set" | |
require "graphql" | |
require "json" | |
SCHEMA_PATH = ENV.fetch("SCHEMA") do | |
abort "Run with SCHEMA=<path-to-schema.json> and try again." | |
end | |
SCHEMA = JSON.parse(File.read(SCHEMA_PATH)) | |
REFERENCES = Hash.new do |h, t| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -lt 2 ]; then | |
echo "Usage: wait-for-it [host] [port] [timeout(optional)]" | |
exit 1 | |
fi | |
host="$1" | |
port="$2" | |
timeout="${3:-0}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert your codebase to use TypedDocumentNode. It's not perfect, but | |
# it does a pretty decent job. You'll want to review the changes manually. | |
# Usage: ruby convert.rb [...GLOBS] | |
# Example: ruby convert.rb "src/**/*.{ts,tsx}" | |
require "set" | |
def convert_import(line) | |
parts = line.scan(/use(\w+)(Query|Mutation)/) | |
return [line] if parts.empty? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { print } from "graphql"; | |
import { pipe, map } from "wonka"; | |
import { Exchange, Operation } from "urql"; | |
type FetchExchangeFn = ( | |
operation: Operation, | |
options: RequestInit | |
) => RequestInit; | |
const createFetchExchange = (fn: FetchExchangeFn): Exchange => { |
NewerOlder