Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap 'src/ya-comiste-rust' backend #1427

Merged
merged 1 commit into from
Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
[*.{md,snap}]
trim_trailing_whitespace = false

[*.rs]
indent_size = 4
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ updates:
interval: 'daily'
labels:
- 'dependencies'

- package-ecosystem: 'cargo'
directory: '/src/ya-comiste-rust/'
schedule:
interval: 'daily'
labels:
- 'dependencies'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Continuous Integration
name: Continuous Integration (JavaScript)

on: [push]

Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/continuous-integration-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Continuous Integration (Rust)

on:
push:
paths:
- 'src/ya-comiste-rust/**'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2.3.4

- uses: actions-rs/toolchain@v1
with:
toolchain: stable

# https://github.com/actions-rs/cargo
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path src/ya-comiste-rust/Cargo.toml

# https://github.com/actions-rs/cargo
- name: Run all tests
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path src/ya-comiste-rust/Cargo.toml
8 changes: 8 additions & 0 deletions .jest-eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
// @flow strict

// https://jestjs.io/docs/en/configuration
module.exports = {
displayName: 'lint',
rootDir: __dirname,
verbose: false,
reporters: ['@adeira/eslint-runner/reporter'],
runner: '@adeira/eslint-runner',
testMatch: ['<rootDir>/src/**/*.js', '<rootDir>/scripts/**/*.js'],
testPathIgnorePatterns: [
'/node_modules/',

// The only reason why this is here is because Jest fails on unrelated .snap files generated by Rust Insta.
// See: https://github.com/facebook/jest/issues/8922
'<rootDir>/src/ya-comiste-rust/',
],
};
19 changes: 18 additions & 1 deletion src/eslint-runner/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,22 @@ type RunCompleteResults = {|
+numTotalTestSuites: number,
+numTotalTests: number,
+openHandles: $ReadOnlyArray<any>, // TODO
+snapshot: any, // TODO
+snapshot: {|
+added: number,
+didUpdate: boolean,
+failure: boolean,
+filesAdded: number,
+filesRemoved: number,
+filesRemovedList: $ReadOnlyArray<string>,
+filesUnmatched: number,
+filesUpdated: number,
+matched: number,
+total: number,
+unchecked: number,
+uncheckedKeysByFile: number,
+unmatched: number,
+updated: number,
|},
+startTime: number,
+success: boolean,
+wasInterrupted: boolean,
Expand Down Expand Up @@ -57,6 +72,8 @@ class JestProgressBarReporter {
}

onRunComplete(test /*: any */, results /*: RunCompleteResults */) /*: void */ {
// TODO: there might be an obsolete .snap file which causes Eslint Runner to fail (should be handle it?)

results.testResults.forEach(({ failureMessage }) => {
if (failureMessage != null) {
console.log(failureMessage);
Expand Down
2 changes: 1 addition & 1 deletion src/ya-comiste-react-native/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type EntrypointBlock {
Technically, `block` can always return any block, however, some combinations don't make sense.
It's up to the server to decide which blocks can be nested/returned and which cannot in the given context.
"""
block(supported: [String!]!): SDUIBlock
block(supported: [String!]!): SDUIBlock # TODO: more like `renderer` (?)
}

union SDUIBlock = CardBlock | DescriptionBlock | JumbotronBlock | ScrollViewHorizontalBlock
Expand Down
1 change: 1 addition & 0 deletions src/ya-comiste-rust/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target