diff --git a/.gitmodules b/.gitmodules index 9337c3e1..4a038299 100644 --- a/.gitmodules +++ b/.gitmodules @@ -818,6 +818,15 @@ [submodule "vendor/grammars/language-regexp"] path = vendor/grammars/language-regexp url = https://github.com/Alhadis/language-regexp +[submodule "vendor/grammars/Terraform.tmLanguage"] + path = vendor/grammars/Terraform.tmLanguage + url = https://github.com/alexlouden/Terraform.tmLanguage +[submodule "vendor/grammars/shaders-tmLanguage"] + path = vendor/grammars/shaders-tmLanguage + url = https://github.com/tgjones/shaders-tmLanguage +[submodule "vendor/grammars/language-meson"] + path = vendor/grammars/language-meson + url = https://github.com/TingPing/language-meson [submodule "vendor/grammars/atom-language-p4"] path = vendor/grammars/atom-language-p4 url = https://github.com/TakeshiTseng/atom-language-p4 diff --git a/LICENSE b/LICENSE index ca0844d1..acc8e6f2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011-2016 GitHub, Inc. +Copyright (c) 2017 GitHub, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/github-linguist.gemspec b/github-linguist.gemspec index 183d0fb8..9da23a15 100644 --- a/github-linguist.gemspec +++ b/github-linguist.gemspec @@ -16,7 +16,7 @@ Gem::Specification.new do |s| s.add_dependency 'charlock_holmes', '~> 0.7.3' s.add_dependency 'escape_utils', '~> 1.1.0' s.add_dependency 'mime-types', '>= 1.19' - s.add_dependency 'rugged', '0.25.1.1' + s.add_dependency 'rugged', '>= 0.25.1' s.add_development_dependency 'minitest', '>= 5.0' s.add_development_dependency 'mocha' diff --git a/grammars.yml b/grammars.yml index c1619668..5be1025d 100755 --- a/grammars.yml +++ b/grammars.yml @@ -130,6 +130,8 @@ vendor/grammars/TLA: - source.tla vendor/grammars/TXL: - source.txl +vendor/grammars/Terraform.tmLanguage: +- source.terraform vendor/grammars/Textmate-Gosu-Bundle: - source.gosu.2 vendor/grammars/UrWeb-Language-Definition: @@ -408,6 +410,8 @@ vendor/grammars/language-less: - source.css.less vendor/grammars/language-maxscript: - source.maxscript +vendor/grammars/language-meson: +- source.meson vendor/grammars/language-ncl: - source.ncl vendor/grammars/language-ninja: @@ -573,6 +577,9 @@ vendor/grammars/scilab.tmbundle: - source.scilab vendor/grammars/secondlife-lsl: - source.lsl +vendor/grammars/shaders-tmLanguage: +- source.hlsl +- source.shaderlab vendor/grammars/smali-sublime: - source.smali vendor/grammars/smalltalk-tmbundle: diff --git a/lib/linguist/classifier.rb b/lib/linguist/classifier.rb index 89a0df2f..4d549cc9 100644 --- a/lib/linguist/classifier.rb +++ b/lib/linguist/classifier.rb @@ -95,7 +95,7 @@ module Linguist # Returns sorted Array of result pairs. Each pair contains the # String language name and a Float score. def classify(tokens, languages) - return [] if tokens.nil? + return [] if tokens.nil? || languages.empty? tokens = Tokenizer.tokenize(tokens) if tokens.is_a?(String) scores = {} diff --git a/lib/linguist/documentation.yml b/lib/linguist/documentation.yml index 230cd423..21710b03 100644 --- a/lib/linguist/documentation.yml +++ b/lib/linguist/documentation.yml @@ -27,4 +27,4 @@ - (^|/)[Rr]eadme(\.|$) # Samples folders -- ^[Ss]amples/ +- ^[Ss]amples?/ diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 514ddb8a..ab8c4599 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -465,5 +465,13 @@ module Linguist Language["Scilab"] end end + + disambiguate ".tsx" do |data| + if /^\s*(import.+(from\s+|require\()['"]react|\/\/\/\s* Promise + selectExample: (selectedExample: Example) => any + gettingStartedState: GettingStartedState +} + +interface State { + mouseOver: boolean +} + +class PlaygroundCPopup extends React.Component { + + state = { + mouseOver: false, + } + + refs: { + [key: string]: any + exampleAnchor: HTMLDivElement + congratsAnchor: HTMLDivElement + scroller: HTMLDivElement, + } + + componentDidUpdate(prevProps: Props, prevState: State) { + if (prevProps.gettingStartedState.selectedExample !== this.props.gettingStartedState.selectedExample) { + this.refs.scroller.scrollTop += this.refs.exampleAnchor.getBoundingClientRect().top + } + + if (prevProps.gettingStartedState.isCurrentStep('STEP5_WAITING') + && this.props.gettingStartedState.isCurrentStep('STEP5_DONE')) { + this.refs.scroller.scrollTop += this.refs.congratsAnchor.getBoundingClientRect().top + + const snd = new Audio(require('../../../assets/success.mp3') as string) + snd.volume = 0.5 + snd.play() + } + } + + render() { + const {mouseOver} = this.state + const {selectedExample} = this.props.gettingStartedState + const hovering = !this.props.gettingStartedState.isCurrentStep('STEP4_CLICK_TEASER_STEP5') + const downloadUrl = (example) => `${__BACKEND_ADDR__}/resources/getting-started-example?repository=${examples[example].path}&project_id=${this.props.projectId}&user=graphcool-examples` // tslint:disable-line + return ( +
+
+
this.setState({ mouseOver: false })} + onMouseEnter={() => { + this.setState({ mouseOver: true }) + }} + onMouseOver={(e: any) => { + if (this.props.gettingStartedState.isCurrentStep('STEP4_CLICK_TEASER_STEP5')) { + this.props.nextStep() + } + }} + > +
+
+ You did it! Time to run an example. +
+
+ You have successfully set up your own Instagram backend.{' '} + When building an app with Graphcool you can easily explore queries in the{' '} + playground and "copy & paste" selected queries into your code.{' '} + Of course, to do so, you need to implement the frontend first. +
+
+
We put together a simple app to show and add posts
+
using the backend you just built, to test and run it locally.
+
+
+
+
+ Select your preferred technology to download the example. +
+
+
this.props.selectExample('ReactRelay')} + > + React + Relay +
+
this.props.selectExample('ReactApollo')} + > + React + Apollo +
+
this.props.selectExample('ReactNativeApollo')} + > + React Native + Apollo +
+
this.props.selectExample('AngularApollo')} + > + Angular + Apollo +
+
+
+ {selectedExample && +
+
+