Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thundr #26

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
93ae6b8
refactor: organize files by features
manekinekko Aug 4, 2021
c269158
fix: handle errors when listing projects
manekinekko Aug 4, 2021
8e7cfac
feat: add method to retrieve collections with documents (#23)
tagazok Aug 5, 2021
86063c6
chore: rename x-tag to thunderstorm
manekinekko Aug 5, 2021
5bdb141
feat: add possibility to retrieve github functions
tagazok Aug 5, 2021
922e097
Merge branch 'thunderstorm' of https://github.com/manekinekko/hexa in…
tagazok Aug 5, 2021
24dc91b
chore: rename x-tag to thunderstorm
manekinekko Aug 5, 2021
b1bb82f
fix: rename subscriptionId with accountId
manekinekko Aug 5, 2021
fa22abe
fix: remove swa response
manekinekko Aug 5, 2021
5773eb6
feat: add method to retrieve swa infos
tagazok Aug 5, 2021
543221d
Merge branch 'thunderstorm' of https://github.com/manekinekko/hexa in…
tagazok Aug 5, 2021
317f00f
fix: add resource name in tag
manekinekko Aug 5, 2021
1a1ebee
fix: enable debug logs when creating swa
manekinekko Aug 5, 2021
4c043fa
feat(collection): enable collection creation
tagazok Aug 5, 2021
1879782
fix: use proper tags construction
manekinekko Aug 5, 2021
96f99c4
Merge branch 'thunderstorm' of https://github.com/manekinekko/hexa in…
tagazok Aug 5, 2021
474d898
feat: add environment variables support
manekinekko Aug 6, 2021
98927a6
Merge branch 'thunderstorm' of https://github.com/manekinekko/hexa in…
tagazok Aug 6, 2021
edcb71f
fix: fix
tagazok Aug 6, 2021
118d629
fix: use databases instead of database
manekinekko Aug 6, 2021
801726a
feat(project name): add x-project-name tag to resource group
tagazok Aug 7, 2021
5b638a4
feat(projectrealname): add project real name to swa
tagazok Aug 9, 2021
48698c5
fix(swa): return swa list instead of resource groups
tagazok Aug 9, 2021
8b52172
fix: remove extra semicolon
manekinekko Aug 9, 2021
122d7fd
fix: project deletion
manekinekko Aug 9, 2021
dae924a
feat: add --demo
manekinekko Aug 12, 2021
ba5c598
fix: add proper typings for demo mode
manekinekko Aug 12, 2021
7830cc3
feat(subscription): get subscriptions
tagazok Aug 17, 2021
2d6c742
chore: update website content
manekinekko Aug 25, 2021
7042760
refactor: return database collection after post
manekinekko Aug 27, 2021
0588319
fix: use CLI args from parameters (#29)
sinedied Aug 31, 2021
13e929a
feat(bicep): replace resource creation by bicep template
tagazok Aug 31, 2021
8f6edd5
feat(template): replace swa by thundr template
tagazok Sep 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions api/hexa/function.json

This file was deleted.

6 changes: 0 additions & 6 deletions api/hexa/index.js

This file was deleted.

15 changes: 0 additions & 15 deletions api/host.json

This file was deleted.

3 changes: 0 additions & 3 deletions api/package-lock.json

This file was deleted.

9 changes: 0 additions & 9 deletions api/package.json

This file was deleted.

35 changes: 9 additions & 26 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
<img class="title" src="hexa-title-white.png" alt="hexa title white" /><sub>preview</sub>
</a>
<nav>
<a id="login-link" href=".auth/login/aad" title="contribute to hexa" rel="noopener">Login</a>
<a href="#core-principals" title="read more about the core principals of hexa">Core Principals</a>
<a href="#examples" title="see more hexa examples">Examples</a>
<a href="https://github.com/manekinekko/hexa" target="__blank" title="contribute to hexa" rel="noopener">Contribute</a>
Expand Down Expand Up @@ -159,32 +158,16 @@ <h2><kbd>$ hexa init --yolo</kbd>: Hexa will enter Auto Mode and will setup all
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script type="module">
async function session() {
return (await fetch(".auth/me")).json();
}

async function api() {
return (await fetch("/api/hexa")).json();
}

let strings = [];
let strings = ["npm install --global <b>@manekinekko/hexa</b>", "hexa <b>init</b>", "hexa <b>deploy</b>", "hexa <b>init --login</b>", "hexa <b>init --manual</b>", "hexa <b>init --yolo</b>"];
window.onload = async function () {
const user = await session();
strings = await api();
if (user?.clientPrincipal) {
window["login-link"].href = ".auth/logout";
window["login-link"].innerHTML = "Logout";
window["typing-effect"].innerHTML = `hexa login "${user?.clientPrincipal?.userDetails}" -id "${user?.clientPrincipal?.userId}"`;
} else {
new Typed("#typing-effect", {
strings,
typeSpeed: 50,
smartBackspace: false,
backSpeed: 10,
loop: true,
backDelay: 1700,
});
}
new Typed("#typing-effect", {
strings,
typeSpeed: 50,
smartBackspace: false,
backSpeed: 10,
loop: true,
backDelay: 1700,
});
};
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-148994479-1"></script>
Expand Down
3 changes: 0 additions & 3 deletions docs/staticwebapp.config.json

This file was deleted.

86 changes: 75 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"scripts": {
"watch": "npm run build -- --watch",
"prestart": "npm run build",
"start": "node ./dist/bin.js ws",
"start": "node ./dist/bin.js ws --verbose",
"build": "rimraf dist/ && mkdir dist && npm run copy:templates && npm run copy:bin && tsc",
"copy:templates": "copyfiles --verbose --all \"src/templates/**/*\" dist/",
"copy:bin": "copyfiles --verbose --flat src/bin.js dist/",
Expand Down Expand Up @@ -56,6 +56,7 @@
"inquirer": "^7.0.0",
"internal-ip": "^6.2.0",
"jmespath": "^0.15.0",
"mongodb": "^4.1.0",
"ora": "^3.4.0",
"rimraf": "^3.0.2",
"shelljs": "^0.8.4",
Expand Down
3 changes: 2 additions & 1 deletion src/commands/ws.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import chalk from 'chalk';
import WebSocket from 'ws';
import { processWebSocketRequest, sendWebSocketResponse } from '../features/thunderstorm/index';

export default async function () {
const wss = new WebSocket.Server({ host: '0.0.0.0', port: 8080 })

wss.on('listening', () => {
console.log('Listening on ws://0.0.0.0:8080')
console.info(chalk.green("✔ Listening on ws://0.0.0.0:8080"));
});

wss.on('connection', async ws => {
Expand Down
4 changes: 4 additions & 0 deletions src/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,3 +489,7 @@ export async function* traverseFolder(folder: string): AsyncGenerator<string> {
}
}
}

export function IS_DEMO() {
return process.env.DEMO_MODE === "hexa";
}
29 changes: 18 additions & 11 deletions src/features/github/repo.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
import { Octokit } from "@octokit/rest";
import { IS_DEMO } from "../../core/utils";

export default async function ({ token, projectName }: { token: string, projectName: string }) {
const octokit = new Octokit({
auth: token,
});
const { data } = await octokit.repos.createUsingTemplate({
name: projectName,
template_repo: "vanilla-api",
template_owner: "staticwebdev",
include_all_branches: false,
private: true
});
return data;

if (IS_DEMO()) {
return await new Promise((resolve: Function) => setTimeout(resolve, 5000, { html_url: '', default_branch: '' })) as { html_url: string, default_branch: string };
}
else {
const octokit = new Octokit({
auth: token,
});
const { data } = await octokit.repos.createUsingTemplate({
name: projectName,
template_repo: "thundr-template-vanilla",
template_owner: "thundr-dev",
include_all_branches: false,
private: true
});
return data;
}
};
Loading