Skip to content

Commit 25992cc

Browse files
authored
Use parcel to build app (#42)
* Use parcel to build app * Fix ci, gitpod tasks * add dep * fix * Fix * fix * fix * fix
1 parent 90be793 commit 25992cc

26 files changed

+5777
-17922
lines changed

.github/workflows/node.js.yml

-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ jobs:
2727
node-version: ${{ matrix.node-version }}
2828
cache: 'npm'
2929
- run: npm ci
30-
working-directory: ./app
3130
- run: npm run build --if-present
32-
working-directory: ./app
3331
- run: npm test
34-
working-directory: ./app

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@
1414
.glide/
1515

1616
.idea
17-
node_modules
17+
node_modules
18+
dist/
19+
.parcel-cache

.gitpod.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ tasks:
88
command: go run
99

1010
- name: NPM deps
11-
init: cd app && npm install
12-
command: cd app && npm run
11+
init: npm install
12+
command: npm run

app/index.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+
<meta name="theme-color" content="#000000">
7+
<title>HackerNews with grpc-web</title>
8+
9+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.12/semantic.min.css">
10+
</head>
11+
<body>
12+
<div id="root"></div>
13+
<script type="module" src="index.tsx"></script>
14+
</body>
15+
</html>

app/index.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"use strict";
2+
var __assign = (this && this.__assign) || function () {
3+
__assign = Object.assign || function(t) {
4+
for (var s, i = 1, n = arguments.length; i < n; i++) {
5+
s = arguments[i];
6+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7+
t[p] = s[p];
8+
}
9+
return t;
10+
};
11+
return __assign.apply(this, arguments);
12+
};
13+
var __importDefault = (this && this.__importDefault) || function (mod) {
14+
return (mod && mod.__esModule) ? mod : { "default": mod };
15+
};
16+
Object.defineProperty(exports, "__esModule", { value: true });
17+
var jsx_runtime_1 = require("react/jsx-runtime");
18+
var react_dom_1 = __importDefault(require("react-dom"));
19+
var react_redux_1 = require("react-redux");
20+
require("./src/index.css");
21+
var store_1 = __importDefault(require("./src/store"));
22+
var Stories_1 = __importDefault(require("./src/Stories"));
23+
react_dom_1.default.render((0, jsx_runtime_1.jsx)(react_redux_1.Provider, __assign({ store: store_1.default }, { children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Stories_1.default, {}, void 0) }, void 0) }), void 0), document.getElementById('root'));

app/src/index.tsx app/index.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import * as React from 'react';
2-
import * as ReactDOM from 'react-dom';
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
33
import { Provider } from 'react-redux';
4-
import './index.css';
5-
import store from './store';
6-
import Stories from './Stories';
4+
import './src/index.css';
5+
import store from './src/store';
6+
import Stories from './src/Stories';
77

88
ReactDOM.render(
99
<Provider store={store}>

0 commit comments

Comments
 (0)