Skip to content

Commit 1716983

Browse files
committed
Bootstrap 'src/ya-comiste-rust' backend
I am still working on the schema design so this is just a project bootstrap so I can setup all the things around it.
1 parent 50fdffb commit 1716983

37 files changed

+2690
-4
lines changed

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@ charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true
1010

11-
[*.md]
11+
[*.{md,snap}]
1212
trim_trailing_whitespace = false
13+
14+
[*.rs]
15+
indent_size = 4

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,10 @@ updates:
2020
interval: 'daily'
2121
labels:
2222
- 'dependencies'
23+
24+
- package-ecosystem: 'cargo'
25+
directory: '/src/ya-comiste-rust/'
26+
schedule:
27+
interval: 'daily'
28+
labels:
29+
- 'dependencies'

.github/workflows/continuous-integration.yml renamed to .github/workflows/continuous-integration-javascript.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Continuous Integration
1+
name: Continuous Integration (JavaScript)
22

33
on: [push]
44

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Continuous Integration (Rust)
2+
3+
on:
4+
push:
5+
paths:
6+
- 'src/ya-comiste-rust/**'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/[email protected]
14+
15+
- uses: actions-rs/toolchain@v1
16+
with:
17+
toolchain: stable
18+
19+
# https://github.com/actions-rs/cargo
20+
- uses: actions-rs/cargo@v1
21+
with:
22+
command: clippy
23+
args: --manifest-path src/ya-comiste-rust/Cargo.toml
24+
25+
# https://github.com/actions-rs/cargo
26+
- name: Run all tests
27+
uses: actions-rs/cargo@v1
28+
with:
29+
command: test
30+
args: --manifest-path src/ya-comiste-rust/Cargo.toml

.jest-eslint.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
// @flow strict
22

3+
// https://jestjs.io/docs/en/configuration
34
module.exports = {
45
displayName: 'lint',
56
rootDir: __dirname,
67
verbose: false,
78
reporters: ['@adeira/eslint-runner/reporter'],
89
runner: '@adeira/eslint-runner',
910
testMatch: ['<rootDir>/src/**/*.js', '<rootDir>/scripts/**/*.js'],
11+
testPathIgnorePatterns: [
12+
'/node_modules/',
13+
14+
// The only reason why this is here is because Jest fails on unrelated .snap files generated by Rust Insta.
15+
// See: https://github.com/facebook/jest/issues/8922
16+
'<rootDir>/src/ya-comiste-rust/',
17+
],
1018
};

src/eslint-runner/reporter.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,22 @@ type RunCompleteResults = {|
1818
+numTotalTestSuites: number,
1919
+numTotalTests: number,
2020
+openHandles: $ReadOnlyArray<any>, // TODO
21-
+snapshot: any, // TODO
21+
+snapshot: {|
22+
+added: number,
23+
+didUpdate: boolean,
24+
+failure: boolean,
25+
+filesAdded: number,
26+
+filesRemoved: number,
27+
+filesRemovedList: $ReadOnlyArray<string>,
28+
+filesUnmatched: number,
29+
+filesUpdated: number,
30+
+matched: number,
31+
+total: number,
32+
+unchecked: number,
33+
+uncheckedKeysByFile: number,
34+
+unmatched: number,
35+
+updated: number,
36+
|},
2237
+startTime: number,
2338
+success: boolean,
2439
+wasInterrupted: boolean,
@@ -57,6 +72,8 @@ class JestProgressBarReporter {
5772
}
5873

5974
onRunComplete(test /*: any */, results /*: RunCompleteResults */) /*: void */ {
75+
// TODO: there might be an obsolete .snap file which causes Eslint Runner to fail (should be handle it?)
76+
6077
results.testResults.forEach(({ failureMessage }) => {
6178
if (failureMessage != null) {
6279
console.log(failureMessage);

src/ya-comiste-react-native/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type EntrypointBlock {
1515
Technically, `block` can always return any block, however, some combinations don't make sense.
1616
It's up to the server to decide which blocks can be nested/returned and which cannot in the given context.
1717
"""
18-
block(supported: [String!]!): SDUIBlock
18+
block(supported: [String!]!): SDUIBlock # TODO: more like `renderer` (?)
1919
}
2020

2121
union SDUIBlock = CardBlock | DescriptionBlock | JumbotronBlock | ScrollViewHorizontalBlock

src/ya-comiste-rust/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target

0 commit comments

Comments
 (0)