Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
984cf819
Unverified
Commit
984cf819
authored
Aug 08, 2023
by
Brendan Wong
Committed by
GitHub
Aug 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: cleanup cloud function environment (#7085)
* cleanup! * update comments * fix: cloudfunctions
parent
08501234
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
13 deletions
+17
-13
global-setup.ts
functions/global-setup.ts
+10
-0
tsconfig.json
functions/tsconfig.json
+6
-12
package.json
package.json
+1
-1
No files found.
functions/global-setup.ts
View file @
984cf819
...
...
@@ -6,4 +6,14 @@ module.exports = async function globalSetup() {
port
:
3000
,
launchTimeout
:
50000
,
})
// Wait for wrangler to return a request before running tests
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
const
res
=
await
fetch
(
new
Request
(
'
http://127.0.0.1:3000/tokens/ethereum/NATIVE
'
))
if
(
res
.
ok
)
{
return
}
// Set timeout to make sure the server isn't flooded with requests if wrangler is not running
await
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
500
*
(
i
+
1
)))
}
throw
new
Error
(
'
Failed to start server
'
)
}
functions/tsconfig.json
View file @
984cf819
{
"extends"
:
"../tsconfig.json"
,
"compilerOptions"
:
{
"esModuleInterop"
:
true
,
"baseUrl"
:
"functions"
,
"composite"
:
false
,
"incremental"
:
true
,
"lib"
:
[
"DOM"
,
"DOM.Iterable"
,
"ESNext"
],
"moduleResolution"
:
"node"
,
"module"
:
"esnext"
,
"noEmit"
:
true
,
"strict"
:
true
,
"target"
:
"ESNext"
,
"isolatedModules"
:
false
,
"jsx"
:
"react"
,
"tsBuildInfoFile"
:
"../node_modules/.cache/tsbuildinfo/functions"
,
//
avoid
clobbering
the
build
tsbuildinfo
"types"
:
[
"jest"
,
"node"
,
"@cloudflare/workers-types"
],
"jsx"
:
"react"
,
"skipLibCheck"
:
true
,
"baseUrl"
:
"functions"
},
"exclude"
:
[
"../node_modules"
,
"../src"
],
"include"
:
[
"**/*.ts"
],
"include"
:
[
"**/*.ts"
,
".ts"
],
}
\ No newline at end of file
package.json
View file @
984cf819
...
...
@@ -18,7 +18,7 @@
"i18n"
:
"yarn i18n:extract --clean && yarn i18n:compile"
,
"prepare"
:
"concurrently
\"
npm:ajv
\"
\"
npm:contracts
\"
\"
npm:graphql
\"
\"
npm:i18n
\"
"
,
"start"
:
"craco start"
,
"start:cloud"
:
"NODE_OPTIONS=--dns-result-order=ipv4first PORT=3001 npx wrangler pages dev --node-compat --proxy=3001 --port=3000 -- yarn start"
,
"start:cloud"
:
"NODE_OPTIONS=--dns-result-order=ipv4first PORT=3001 npx wrangler pages dev --node-compat --
compatibility-date=2023-08-04 --
proxy=3001 --port=3000 -- yarn start"
,
"build"
:
"craco build"
,
"analyze"
:
"source-map-explorer 'build/static/js/*.js' --only-mapped"
,
"serve"
:
"serve build -l 3000"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment