Skip to content

Commit

Permalink
Publish
Browse files Browse the repository at this point in the history
  • Loading branch information
imolorhe committed Mar 1, 2018
1 parent 4acc92d commit 013c7df
Show file tree
Hide file tree
Showing 7 changed files with 1,169 additions and 33 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ altair.zip
/firebase-sample-dist
*.nex

/packages/**/dist

# dependencies
/node_modules

Expand All @@ -34,10 +36,14 @@ altair.zip
/.sass-cache
/connect.lock
/coverage
/typings

# Error logs
/libpeerconnection.log
npm-debug.log
lerna-debug.log
yarn-error.log
testem.log
/typings

# e2e
/e2e/*.js
Expand Down
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": [
"packages/*"
],
"version": "independent"
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"package": "electron-forge package",
"make": "electron-forge make",
"dist-electron": "build",
"postinstall": "opencollective postinstall"
"postinstall": "opencollective postinstall",
"publish-packages": "lerna publish"
},
"engines": {
"node": ">= 6.9.1 < 9.0.0"
Expand Down Expand Up @@ -113,7 +114,9 @@
"karma-coverage-istanbul-reporter": "^1.4.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"lerna": "^3.0.0-alpha.1",
"mime-types": "^2.1.17",
"ncp": "^2.0.0",
"ngrx-store-freeze": "^0.2.0",
"protractor": "^5.2.2",
"ts-node": "^5.0.0",
Expand Down
16 changes: 16 additions & 0 deletions packages/altair-express-middleware/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import express from 'express';
import path from 'path';

module.exports = {
altairExpress: (opts) => {
const app = express();

app.use(express.static(path.join(__dirname, 'dist')));

app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'dist/index.html'));
});

return app;
}
};
29 changes: 29 additions & 0 deletions packages/altair-express-middleware/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "altair-express-middleware",
"version": "0.1.0",
"description": "Express middleware for altair graphql client",
"main": "dist/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepublish": "node scripts/get_dist.js"
},
"engines": {
"node": ">= 6.9.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/imolorhe/altair.git"
},
"keywords": [
"altair",
"graphql",
"express",
"middleware"
],
"author": "Samuel Imolorhe <[email protected]> (https://sirmuel.design)",
"license": "MIT",
"bugs": {
"url": "https://github.com/imolorhe/altair/issues"
},
"homepage": "https://github.com/imolorhe/altair#readme"
}
14 changes: 14 additions & 0 deletions packages/altair-express-middleware/scripts/get_dist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const ncp = require('ncp').ncp;
const path = require('path');

ncp.limit = 16;
const source = path.join(__dirname, '../../../dist');

const destination = path.join(__dirname, '../dist');
console.log(source, ', ', destination);
ncp(source, destination, function (err) {
if (err) {
return console.error(err);
}
console.log('Done copying dist folder!');
});
Loading

0 comments on commit 013c7df

Please sign in to comment.