create-helium-app
Advanced tools
Comparing version 0.0.2-alpha.2 to 0.0.2-alpha.3
10
index.js
@@ -14,2 +14,6 @@ #!/usr/bin/env node | ||
const renameFiles = { | ||
_gitignore: '.gitignore' | ||
}; | ||
async function init() { | ||
@@ -55,3 +59,5 @@ let targetDir = argv._[0]; | ||
const write = (file, content) => { | ||
const targetPath = path.join(root, file); | ||
const targetPath = renameFiles[file] | ||
? path.join(root, renameFiles[file]) | ||
: path.join(root, file); | ||
if (content) { | ||
@@ -89,3 +95,3 @@ fs.writeFileSync(targetPath, content); | ||
console.log(` ${usesYarn ? `yarn` : `npm install --legacy-peer-deps`}`); | ||
console.log(` ${usesYarn ? `yarn` : `npm install`}`); | ||
console.log( | ||
@@ -92,0 +98,0 @@ `\n Finally, run ${yellow( |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "0.0.2-alpha.2", | ||
"version": "0.0.2-alpha.3", | ||
"main": "index.js", | ||
@@ -27,3 +27,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "5ad37a22e7e2c9071875ee3e95acec1c42470b17" | ||
"gitHead": "3b14b7e90c9d1288b6ebd097c56a1105c226f9e4" | ||
} |
@@ -6,2 +6,10 @@ # Change Log | ||
# [1.1.0-alpha.1](https://github.com/thoughtindustries/helium/compare/@thoughtindustries/helium-template@1.1.0-alpha.0...@thoughtindustries/helium-template@1.1.0-alpha.1) (2022-02-09) | ||
**Note:** Version bump only for package @thoughtindustries/helium-template | ||
# [1.1.0-alpha.0](https://github.com/thoughtindustries/helium/compare/@thoughtindustries/helium-template@1.0.1-alpha.1...@thoughtindustries/helium-template@1.1.0-alpha.0) (2022-02-04) | ||
@@ -8,0 +16,0 @@ |
@@ -66,6 +66,6 @@ const fetch = require('isomorphic-unfetch'); | ||
if (userDataResponse && userDataResponse[0].data) { | ||
if (userDataResponse && userDataResponse.data) { | ||
const { | ||
data: { CurrentUser, CompanyDetails } | ||
} = userDataResponse[0]; | ||
} = userDataResponse; | ||
@@ -72,0 +72,0 @@ currentUser = CurrentUser || {}; |
{ | ||
"name": "@thoughtindustries/helium-template", | ||
"version": "1.1.0-alpha.0", | ||
"version": "1.1.0-alpha.1", | ||
"scripts": { | ||
@@ -46,3 +46,4 @@ "dev": "concurrently \"npm run dev:css\" \"node ./server\"", | ||
"devDependencies": { | ||
"@thoughtindustries/helium": "^1.1.0-alpha.0" | ||
"@thoughtindustries/helium": "^1.1.0-alpha.1", | ||
"graphql-playground-middleware-express": "^1.7.23" | ||
}, | ||
@@ -53,3 +54,3 @@ "volta": { | ||
}, | ||
"gitHead": "5ad37a22e7e2c9071875ee3e95acec1c42470b17" | ||
"gitHead": "3b14b7e90c9d1288b6ebd097c56a1105c226f9e4" | ||
} |
@@ -15,4 +15,38 @@ const express = require('express'); | ||
async function startServer() { | ||
if (!heliumEndpoint) { | ||
throw new Error(` | ||
HELIUM_ENDPOINT environment variable is not set. | ||
The development server should be started 'helium dev' | ||
`); | ||
} | ||
const app = express(); | ||
if (!isProduction) { | ||
const expressPlayground = require('graphql-playground-middleware-express').default; | ||
const fetch = require('isomorphic-unfetch'); | ||
app.use(express.json()); | ||
app.get('/graphiql', expressPlayground({ endpoint: '/graphql' })); | ||
// proxy GraphQL Playground's requests because of CORS errors | ||
app.post('/graphql', async (req, res) => { | ||
const options = { | ||
method: 'POST', | ||
headers: { 'Content-Type': 'application/json' }, | ||
body: JSON.stringify(req.body) | ||
}; | ||
fetch(heliumEndpoint, options) | ||
.then(tiRes => { | ||
res.status(tiRes.status); | ||
return tiRes; | ||
}) | ||
.then(r => r.json()) | ||
.then(data => { | ||
res.send(data); | ||
}); | ||
}); | ||
} | ||
let viteDevServer; | ||
@@ -19,0 +53,0 @@ if (isProduction) { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42
3360721
48517
5