Skip to content

Commit d6cc373

Browse files
committed
chore: use simpler bootstrap and shared sentry
Relates-to: keymanapp/keyman.com#558 Relates-to: keymanapp/shared-sites#55 Relates-to: keymanapp/shared-sites#56
1 parent 6a1e528 commit d6cc373

File tree

7 files changed

+25
-23
lines changed

7 files changed

+25
-23
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ node_modules/
99
# Shared files are bootstrapped:
1010
resources/bootstrap.inc.sh
1111
resources/.bootstrap-version
12+
resources/.bootstrap-registry
1213
_common/
1314

1415
# State files
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace Keyman\Site\com\keyman\help;
5+
6+
use Keyman\Site\Common\KeymanSentry;
7+
8+
require_once(__DIR__ . '/../../_common/KeymanSentry.php');
9+
10+
const SENTRY_DSN = 'https://[email protected]/5983515';
11+
12+
class HelpKeymanComSentry {
13+
static function init() {
14+
KeymanSentry::Init(SENTRY_DSN);
15+
}
16+
static function GetBrowserHTML() {
17+
return KeymanSentry::GetBrowserHTML(SENTRY_DSN);
18+
}
19+
}

_includes/includes/head.php

+2-15
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
require_once __DIR__ . '/../autoload.php';
77
use Keyman\Site\Common\KeymanHosts;
8+
use Keyman\Site\com\keyman\help\HelpKeymanComSentry;
89

910
// Variables used to manage and trigger debugging tests.
1011
// Simply defining the variable below is enough to trigger debug mode.
@@ -45,21 +46,7 @@
4546
}
4647
?>
4748
<title><?php echo htmlentities($title); ?></title>
48-
<?php
49-
/* Our local CDN version is identical to this file:
50-
<script
51-
src="https://browser.sentry-cdn.com/5.28.0/bundle.min.js"
52-
integrity="sha384-1HcgUzJmxPL9dRnZD2wMIj5+xsJfHS+WR+pT2yJNEldbOr9ESTzgHMQOcsb2yyDl"
53-
crossorigin="anonymous"
54-
></script>*/
55-
?>
56-
<script src="<?= cdn('js/sentry.bundle.5.28.0.min.js'); ?>"></script>
57-
<script>
58-
Sentry.init({
59-
dsn: "https://[email protected]/5983515",
60-
environment: location.host.match(/\.local$/) ? 'development' : location.host.match(/(^|\.)keyman-staging\.com$/) ? 'staging' : 'production',
61-
});
62-
</script>
49+
<?= HelpKeymanComSentry::GetBrowserHTML() ?>
6350
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
6451
<link rel='shortcut icon' href="<?php echo $favicon; ?>">
6552
<?php if(!empty($canonicalLink)) echo " <link rel=\"canonical\" href=\"$canonicalLink\">\n"; ?>

_includes/includes/template.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?php
22
require_once __DIR__ . '/../../vendor/autoload.php';
3-
require_once __DIR__ . '/../../_common/KeymanSentry.php';
3+
require_once __DIR__ . '/../2020/HelpKeymanComSentry.php';
44

5-
const SENTRY_DSN = 'https://[email protected]/5983515';
6-
\Keyman\Site\Common\KeymanSentry::init(SENTRY_DSN);
5+
\Keyman\Site\com\keyman\help\HelpKeymanComSentry::init();
76

87
require_once('includes/servervars.php');
98
require_once('index-content.php');

build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## START STANDARD SITE BUILD SCRIPT INCLUDE
33
readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
44
readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh"
5-
readonly BOOTSTRAP_VERSION=v0.17
5+
readonly BOOTSTRAP_VERSION=feat/move-sentry-js-to-common
66
[ -f "$BOOTSTRAP" ] && source "$BOOTSTRAP" || source <(curl -fs https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh)
77
## END STANDARD SITE BUILD SCRIPT INCLUDE
88

cdn/dev/js/bundle.min.js.map

-1
This file was deleted.

cdn/dev/js/sentry.bundle.5.28.0.min.js

-3
This file was deleted.

0 commit comments

Comments
 (0)