Skip to content

Commit

Permalink
chore: update webpack config (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
conwnet authored Mar 5, 2023
1 parent 497f42e commit 1622776
Show file tree
Hide file tree
Showing 42 changed files with 1,081 additions and 722 deletions.
11 changes: 5 additions & 6 deletions extensions/github1s/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
"lib": "lib"
},
"activationEvents": [
"onStartupFinished",
"onFileSystem:github1s",
"onFileSystem:gitlab1s",
"onFileSystem:bitbucket1s",
"onFileSystem:npmjs1s",
"onFileSystem:ossinsight",
"onCommand:remoteHub.openRepository",
"onCommand:github1s.commands.openRepository",
"onStartupFinished"
"onCommand:remoteHub.openRepository"
],
"browser": "./dist/extension",
"engines": {
Expand Down Expand Up @@ -585,9 +584,9 @@
},
"scripts": {
"clean": "rm -rf dist out",
"build": "webpack --config extension.webpack.config.js --mode production",
"compile": "webpack --config extension.webpack.config.js --mode production",
"dev": "webpack --config extension.webpack.config.js --watch"
"build": "webpack --config webpack.config.js --mode production",
"compile": "webpack --config webpack.config.js --mode production",
"dev": "webpack --config webpack.config.js --watch"
},
"keywords": [],
"author": "",
Expand Down
File renamed without changes.
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"chokidar": "^3.5.3",
"clean-css": "^5.3.2",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.3",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jsdoc": "^39.3.14",
"eslint-plugin-prettier": "^4.2.1",
"file-loader": "^6.2.0",
"fs-extra": "^10.1.0",
"generate-file-webpack-plugin": "^1.0.1",
"html-webpack-plugin": "^5.5.0",
Expand All @@ -26,29 +29,29 @@
"prettier": "^2.7.1",
"serve-handler": "^6.1.3",
"start-server-and-test": "^1.14.0",
"style-loader": "^3.3.1",
"ts-loader": "^9.4.2",
"typescript": "^4.7.3",
"webpack": "^5.73.0",
"uglify-js": "^3.17.4",
"webpack": "^5.75.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.2",
"yalc": "^1.0.0-pre.53"
},
"scripts": {
"preinstall": "./scripts/preinstall.sh",
"postinstall": "husky install && ./scripts/postinstall.sh",
"clean-build": "./scripts/clean-build.sh",
"clean": "./scripts/clean.sh",
"dev": "yarn watch",
"build": "./scripts/build.sh",
"clean": "./scripts/clean.sh",
"yalc": "yalc publish vscode-web && yalc add -D @github1s/vscode-web",
"build:vscode": "cd vscode-web && yarn build",
"vercel-build": "USE_HASH_HTML=true yarn build && yarn hash && rm -rf public && mv dist public",
"hash": "./scripts/hash.sh",
"package": "yarn webpack",
"watch": "rm -rf dist && run-p watch:*",
"watch-with-vscode": "DEV_VSCODE=true run-p watch watch-vscode",
"watch-vscode": "cd vscode-web && yarn watch",
"watch:dev-server": "node server.js",
"webpack": "webpack --config webpack.config.js",
"watch-with-vscode": "DEV_VSCODE=true run-p watch watch-vscode",
"watch:dev-server": "webpack serve --mode=development",
"watch:github1s-extension": "cd extensions/github1s && yarn dev",
"webpack": "webpack --config webpack.config.js",
"format": "prettier --write .",
"eslint": "eslint --ext .ts --ext .js .",
"test:ci": "start-test watch:dev-server 5000 test",
Expand Down
21 changes: 21 additions & 0 deletions public/analytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(function () {
const mid = 'G-D3LJNF4DN0';
if (window.location.hostname.match(/\.?gitlab1s\.com$/i)) {
mid = 'G-1F70ST6944';
} else if (window.location.hostname.match(/\.?bitbucket1s\.org$/i)) {
mid = 'G-SPWSR3V6YC';
} else if (window.location.hostname.match(/\.?npmjs1s\.com$/i)) {
mid = 'G-VF4VCXYFKV';
}
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', mid);
window.addEventListener('load', function () {
const element = window.document.createElement('script');
element.src = 'https://www.googletagmanager.com/gtag/js?id=' + mid;
window.document.body.append(element);
});
})();
File renamed without changes
File renamed without changes
File renamed without changes.
43 changes: 43 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!-- Disable pinch zooming -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<!-- Workbench Icon/Manifest/CSS -->
<link rel="icon" media="(prefers-color-scheme:light)" href="/favicon-light.svg" type="image/svg+xml" />
<link rel="icon" media="(prefers-color-scheme:dark)" href="/favicon-dark.svg" type="image/svg+xml" />
<% if (!devVscode) { %>
<link rel="preload" href="/static-<%= staticHash %>/vscode/vs/workbench/workbench.web.main.css" as="style">
<% } %>
<link rel="manifest" href="/manifest.json" />
<title>GitHub1s</title>
<script><%= pageTitleScript %></script>
<script><%= analyticsScript %></script>
<style><%= spinnerStyle %></style>
</head>

<body aria-label="">
<noscript title="No JavaScript Support">
<h1>You need to enable JavaScript to run this app.</h1>
</noscript>
<div id="load-spinner" aria-label="loading">
<div class="lds-grid">
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
</div>
</div>
</body>

<script src="/static-<%= staticHash %>/vscode/vs/loader.js"></script>
<script src="/static-<%= staticHash %>/vscode/vs/webPackagePaths.js"></script>
<script src="/static-<%= staticHash %>/config/extensions.js"></script>
<script src="/static-<%= staticHash %>/config/bootstrap.js"></script>
<% if (devVscode) { %>
<script>require(['vs/code/browser/workbench/workbench'], function () {});</script>
<% } else { %>
<script src="/static-<%= staticHash %>/vscode/vs/workbench/workbench.web.main.nls.js"></script>
<script src="/static-<%= staticHash %>/vscode/vs/workbench/workbench.web.main.js"></script>
<script src="/static-<%= staticHash %>/vscode/vs/code/browser/workbench/workbench.js"></script>
<% } %>
<script src="https://unpkg.com/[email protected]/dist/index.js" crossorigin="anonymous" async="async"></script>
</html>
File renamed without changes.
9 changes: 9 additions & 0 deletions public/page-title.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(function () {
if (window.location.hostname.match(/\.?gitlab1s\.com$/i)) {
window.document.title = 'GitLab1s';
} else if (window.location.hostname.match(/\.?bitbucket1s\.org$/i)) {
window.document.title = 'Bitbucket1s';
} else if (window.location.hostname.match(/\.?npmjs1s\.com$/i)) {
window.document.title = 'npm1s';
}
})();
File renamed without changes.
93 changes: 93 additions & 0 deletions public/spinner.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#load-spinner {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #1e1e1e
}

.lds-grid {
display: inline-block;
position: relative;
width: 80px;
height: 80px
}

.lds-grid div {
position: absolute;
width: 16px;
height: 16px;
border-radius: 50%;
background: #fff;
animation: lds-grid 1.2s linear infinite
}

.lds-grid div:nth-child(1) {
top: 8px;
left: 8px;
animation-delay: 0s
}

.lds-grid div:nth-child(2) {
top: 8px;
left: 32px;
animation-delay: -0.4s
}

.lds-grid div:nth-child(3) {
top: 8px;
left: 56px;
animation-delay: -0.8s
}

.lds-grid div:nth-child(4) {
top: 32px;
left: 8px;
animation-delay: -0.4s
}

.lds-grid div:nth-child(5) {
top: 32px;
left: 32px;
animation-delay: -0.8s
}

.lds-grid div:nth-child(6) {
top: 32px;
left: 56px;
animation-delay: -1.2s
}

.lds-grid div:nth-child(7) {
top: 56px;
left: 8px;
animation-delay: -0.8s
}

.lds-grid div:nth-child(8) {
top: 56px;
left: 32px;
animation-delay: -1.2s
}

.lds-grid div:nth-child(9) {
top: 56px;
left: 56px;
animation-delay: -1.6s
}

@keyframes lds-grid {
0%,
100% {
opacity: 1
}

50% {
opacity: 0.5
}
}
29 changes: 0 additions & 29 deletions resources/index-dev-vscode.html

This file was deleted.

38 changes: 0 additions & 38 deletions resources/index-hash.html

This file was deleted.

36 changes: 0 additions & 36 deletions resources/index.html

This file was deleted.

Loading

0 comments on commit 1622776

Please sign in to comment.