diff --git a/.gitattributes b/.gitattributes index 42b18af806..5bac1d93f5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ +* text eol=lf **/yarn.lock linguist-generated diff --git a/.prettierrc b/.prettierrc index d5cc87f98a..ca5392be9c 100644 --- a/.prettierrc +++ b/.prettierrc @@ -4,5 +4,6 @@ "singleQuote": true, "bracketSameLine": true, "trailingComma": "es5", - "arrowParens": "avoid" + "arrowParens": "avoid", + "endOfLine": "auto" } diff --git a/packages/eas-cli/graphql-codegen.yml b/packages/eas-cli/graphql-codegen.yml index 32741105eb..8570a100b2 100644 --- a/packages/eas-cli/graphql-codegen.yml +++ b/packages/eas-cli/graphql-codegen.yml @@ -14,7 +14,7 @@ generates: dedupeOperationSuffix: true hooks: afterOneFileWrite: - - ./annotate-graphql-codegen.sh + - 'node ./scripts/annotate-graphql-codegen.js' ./graphql.schema.json: plugins: - 'introspection' diff --git a/packages/eas-cli/graphql.schema.json b/packages/eas-cli/graphql.schema.json index 5a48fc3184..0dd7c0877b 100644 --- a/packages/eas-cli/graphql.schema.json +++ b/packages/eas-cli/graphql.schema.json @@ -1008,6 +1008,30 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "githubAppInstallations", + "description": "GitHub App installations for an account", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GitHubAppInstallation", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "googleServiceAccountKeys", "description": "Android credentials for account", @@ -15013,6 +15037,49 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "CreateGitHubAppInstallationInput", + "description": "", + "fields": null, + "inputFields": [ + { + "name": "accountId", + "description": "", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "installationIdentifier", + "description": "", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "INPUT_OBJECT", "name": "CreateIosSubmissionInput", @@ -16503,6 +16570,197 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "GitHubAppInstallation", + "description": "", + "fields": [ + { + "name": "account", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Account", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "actor", + "description": "", + "args": [], + "type": { + "kind": "INTERFACE", + "name": "Actor", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "installationIdentifier", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "GitHubAppInstallationMutation", + "description": "", + "fields": [ + { + "name": "createGitHubAppInstallationForAccount", + "description": "Create a GitHub App installation for an Account", + "args": [ + { + "name": "githubAppInstallationData", + "description": "", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CreateGitHubAppInstallationInput", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GitHubAppInstallation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deleteGitHubAppInstallation", + "description": "Delete a GitHub App installation by ID", + "args": [ + { + "name": "githubAppInstallationId", + "description": "", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GitHubAppInstallation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "GitHubAppQuery", + "description": "", + "fields": [ + { + "name": "appIdentifier", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "clientIdentifier", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "GoogleServiceAccountKey", @@ -21659,6 +21917,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "githubAppInstallation", + "description": "Mutations for GitHub App installations", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GitHubAppInstallationMutation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "googleServiceAccountKey", "description": "Mutations that modify a Google Service Account Key", @@ -21894,6 +22168,22 @@ "name": "RootQuery", "description": "", "fields": [ + { + "name": "GitHubApp", + "description": "Top-level query object for querying GitHub App information and resources it has access to.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GitHubAppQuery", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "_doNotUse", "description": "This is a placeholder field", diff --git a/packages/eas-cli/package.json b/packages/eas-cli/package.json index cd7ac59f2b..572b6128d2 100644 --- a/packages/eas-cli/package.json +++ b/packages/eas-cli/package.json @@ -102,6 +102,7 @@ "memfs": "3.4.7", "mockdate": "3.0.5", "nock": "13.2.9", + "rimraf": "3.0.2", "tempy": "0.7.0", "ts-deepmerge": "2.0.5", "ts-mockito": "2.6.1", @@ -193,8 +194,8 @@ }, "repository": "expo/eas-cli", "scripts": { - "postpack": "rm -f oclif.manifest.json", - "prepack": "./scripts/prepack.sh", + "postpack": "rimraf oclif.manifest.json", + "prepack": "rimraf build && yarn build && node ./scripts/prepack.js", "pretarball-ci": "./scripts/pretarball-ci.sh", "build": "tsc --project tsconfig.build.json", "watch": "yarn build --watch --preserveWatchOutput", @@ -202,7 +203,7 @@ "test": "jest", "version": "yarn oclif readme && node scripts/patch-readme && git add README.md", "generate-graphql-code": "graphql-codegen --config graphql-codegen.yml", - "clean": "rm -rf dist build tmp node_modules yarn-error.log" + "clean": "rimraf dist build tmp node_modules yarn-error.log" }, "volta": { "node": "18.6.0", diff --git a/packages/eas-cli/annotate-graphql-codegen.sh b/packages/eas-cli/scripts/annotate-graphql-codegen.js old mode 100755 new mode 100644 similarity index 51% rename from packages/eas-cli/annotate-graphql-codegen.sh rename to packages/eas-cli/scripts/annotate-graphql-codegen.js index d45238c6b7..2264451299 --- a/packages/eas-cli/annotate-graphql-codegen.sh +++ b/packages/eas-cli/scripts/annotate-graphql-codegen.js @@ -1,13 +1,15 @@ -#!/usr/bin/env sh +const fs = require('fs/promises'); -OUTFILE="src/graphql/generated.ts" +const path = './src/graphql/generated.ts'; -content="/** +(async () => { + const generatedCode = await fs.readFile(path, 'utf8'); + const comment = `/** * This file was generated using GraphQL Codegen * Command: yarn generate-graphql-code * Run this during development for automatic type generation when editing GraphQL documents * For more info and docs, visit https://graphql-code-generator.com/ - */ -" + */\n\n`; -printf '%s\n%s\n' "$content" "$(cat $OUTFILE)" > $OUTFILE + await fs.writeFile(path, comment + generatedCode); +})(); diff --git a/packages/eas-cli/scripts/patch-readme.js b/packages/eas-cli/scripts/patch-readme.js index 935e236221..80f222fa82 100644 --- a/packages/eas-cli/scripts/patch-readme.js +++ b/packages/eas-cli/scripts/patch-readme.js @@ -1,4 +1,4 @@ -const { promises: fs } = require('fs'); +const fs = require('fs/promises'); (async () => { // Patch `oclif readme` path and link generation diff --git a/packages/eas-cli/scripts/prepack.js b/packages/eas-cli/scripts/prepack.js new file mode 100644 index 0000000000..56fc0a5626 --- /dev/null +++ b/packages/eas-cli/scripts/prepack.js @@ -0,0 +1,7 @@ +const spawn = require('@expo/spawn-async'); + +(async () => { + if (!process.env.CLI_SIZE_CHECK) { + await spawn('yarn', ['oclif', 'manifest'], { stdio: 'inherit' }); + } +})(); diff --git a/packages/eas-cli/scripts/prepack.sh b/packages/eas-cli/scripts/prepack.sh deleted file mode 100755 index 8fd3dc5b69..0000000000 --- a/packages/eas-cli/scripts/prepack.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -eo pipefail - -rm -rf build -yarn build - -if [ -z "$CLI_SIZE_CHECK" ]; then - yarn oclif manifest -fi diff --git a/packages/eas-cli/src/graphql/generated.ts b/packages/eas-cli/src/graphql/generated.ts index dc827d1f4f..b2ccdd7787 100644 --- a/packages/eas-cli/src/graphql/generated.ts +++ b/packages/eas-cli/src/graphql/generated.ts @@ -105,6 +105,8 @@ export type Account = { createdAt: Scalars['DateTime']; /** Environment secrets for an account */ environmentSecrets: Array; + /** GitHub App installations for an account */ + githubAppInstallations: Array; /** Android credentials for account */ googleServiceAccountKeys: Array; id: Scalars['ID']; @@ -2164,6 +2166,11 @@ export type CreateEnvironmentSecretInput = { value: Scalars['String']; }; +export type CreateGitHubAppInstallationInput = { + accountId: Scalars['ID']; + installationIdentifier: Scalars['Int']; +}; + export type CreateIosSubmissionInput = { appId: Scalars['ID']; archiveUrl?: InputMaybe; @@ -2402,6 +2409,38 @@ export type GetSignedAssetUploadSpecificationsResult = { specifications: Array; }; +export type GitHubAppInstallation = { + __typename?: 'GitHubAppInstallation'; + account: Account; + actor?: Maybe; + id: Scalars['ID']; + installationIdentifier: Scalars['Int']; +}; + +export type GitHubAppInstallationMutation = { + __typename?: 'GitHubAppInstallationMutation'; + /** Create a GitHub App installation for an Account */ + createGitHubAppInstallationForAccount: GitHubAppInstallation; + /** Delete a GitHub App installation by ID */ + deleteGitHubAppInstallation: GitHubAppInstallation; +}; + + +export type GitHubAppInstallationMutationCreateGitHubAppInstallationForAccountArgs = { + githubAppInstallationData: CreateGitHubAppInstallationInput; +}; + + +export type GitHubAppInstallationMutationDeleteGitHubAppInstallationArgs = { + githubAppInstallationId: Scalars['ID']; +}; + +export type GitHubAppQuery = { + __typename?: 'GitHubAppQuery'; + appIdentifier: Scalars['String']; + clientIdentifier: Scalars['String']; +}; + export type GoogleServiceAccountKey = { __typename?: 'GoogleServiceAccountKey'; account: Account; @@ -3128,6 +3167,8 @@ export type RootMutation = { emailSubscription: EmailSubscriptionMutation; /** Mutations that create and delete EnvironmentSecrets */ environmentSecret: EnvironmentSecretMutation; + /** Mutations for GitHub App installations */ + githubAppInstallation: GitHubAppInstallationMutation; /** Mutations that modify a Google Service Account Key */ googleServiceAccountKey: GoogleServiceAccountKeyMutation; /** Mutations that modify the build credentials for an iOS app */ @@ -3174,6 +3215,8 @@ export type RootMutationBuildJobArgs = { export type RootQuery = { __typename?: 'RootQuery'; + /** Top-level query object for querying GitHub App information and resources it has access to. */ + GitHubApp: GitHubAppQuery; /** * This is a placeholder field * @deprecated Not used. diff --git a/packages/eas-json/package.json b/packages/eas-json/package.json index 064e3d9a74..20b4a96fb1 100644 --- a/packages/eas-json/package.json +++ b/packages/eas-json/package.json @@ -18,6 +18,7 @@ "devDependencies": { "@types/fs-extra": "9.0.13", "memfs": "3.4.7", + "rimraf": "3.0.2", "typescript": "4.7.4" }, "engines": { @@ -32,9 +33,9 @@ "build": "tsc --project tsconfig.build.json", "watch": "yarn build --watch --preserveWatchOutput", "typecheck": "tsc", - "prepack": "rm -rf build && yarn build", + "prepack": "rimraf build && yarn build", "test": "jest", - "clean": "rm -rf build node_modules yarn-error.log" + "clean": "rimraf build node_modules yarn-error.log" }, "files": [ "/build"