Add a flake and move code to index.tsx

This commit is contained in:
Ivan Malison 2024-02-03 15:08:27 -07:00
parent 582cf4fe75
commit 7060eb1e95
7 changed files with 137 additions and 14 deletions

9
.editorconfig Normal file
View File

@ -0,0 +1,9 @@
root = true
[*.json]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

5
.envrc Normal file
View File

@ -0,0 +1,5 @@
use flake . --impure
if [ -f .envrc.local ]; then
source .envrc.local
fi

View File

@ -2,7 +2,7 @@ overwrite: true
schema: "src/schema.gql" schema: "src/schema.gql"
documents: "src/**/*.gql" documents: "src/**/*.gql"
generates: generates:
src/generated/graphql.tsx: src/index.tsx:
plugins: plugins:
- "typescript" - "typescript"
- "typescript-operations" - "typescript-operations"

82
flake.lock Normal file
View File

@ -0,0 +1,82 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1703887061,
"narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1706732774,
"narHash": "sha256-hqJlyJk4MRpcItGYMF+3uHe8HvxNETWvlGtLuVpqLU0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b8b232ae7b8b144397fdb12d20f592e5e7c1a64d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

27
flake.nix Normal file
View File

@ -0,0 +1,27 @@
{
description = "Sample Nix ts-node build";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
flake-utils,
gitignore,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
nodejs = pkgs.nodejs-18_x;
in
with pkgs; {
devShell = mkShell {
buildInputs = [nodejs yarn watchman alejandra nodePackages.prettier];
};
});
}

View File

@ -1,15 +1,15 @@
{ {
"name": "railbird-gql", "name": "railbird-gql",
"version": "1.0.0", "version": "1.0.0",
"main": "index.js", "main": "generated/index.js",
"repository": "ssh://gitea@dev.railbird.ai:1123/railbird/railbird-gql.git", "repository": "ssh://gitea@dev.railbird.ai:1123/railbird/railbird-gql.git",
"author": "Ivan Malison <IvanMalison@gmail.com>", "author": "Ivan Malison <IvanMalison@gmail.com>",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@graphql-codegen/cli": "^5.0.0", "@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/typescript": "^4.0.1", "@graphql-codegen/typescript": "^4.0.1",
"@graphql-codegen/typescript-operations": "^4.0.1", "@graphql-codegen/typescript-operations": "^4.0.1",
"@graphql-codegen/typescript-react-apollo": "^4.2.0", "@graphql-codegen/typescript-react-apollo": "^4.2.0",
"graphql": "^16.8.1" "graphql": "^16.8.1"
} }
} }