• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NIT-Administrative-Systems / northwestern-laravel-ui / 4555770991

pending completion
4555770991

Pull #116

github

GitHub
Merge 36a947545 into 3589276aa
Pull Request #116: [2.x] Bootstrap 5 and Laravel Vite support

3 of 3 new or added lines in 2 files covered. (100.0%)

26 of 101 relevant lines covered (25.74%)

0.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Presets/Northwestern.php
1
<?php
2

3
namespace Northwestern\SysDev\UI\Presets;
4

5
use Laravel\Ui\Presets;
6

7
class Northwestern extends Presets\Preset
8
{
9
    public static function install()
10
    {
11
        // This theme is built off the Bootstrap preset, so run the install for that to begin.
12
        Presets\Bootstrap::install();
×
13

14
        static::updatePackages();
×
15
        static::updateSass();
×
16
        static::updateBootstrapping();
×
17
        static::updateLayout();
×
18
        static::removeNodeModules();
×
19
    }
20

21
    protected static function updatePackageArray(array $packages)
22
    {
23
        return [
×
24
            '@fortawesome/fontawesome-free' => '^6.4.0',
×
25
            '@sentry/browser' => '^7.38.0',
×
26
            '@sentry/tracing' => '^7.30.0',
×
27
        ] + $packages;
×
28
    }
29

30
    protected static function updateSass()
31
    {
32
        $manifest = [
×
33
            '_variables',
×
34
            'app',
×
35
            'nu_fonts',
×
36
            'nu_purple_layout',
×
37
            'social_icons',
×
38
        ];
×
39

40
        foreach ($manifest as $file) {
×
41
            copy(__DIR__."/northwestern-stubs/sass/${file}.scss", resource_path("sass/${file}.scss"));
×
42
        }
43
    }
44

45
    protected static function updateBootstrapping()
46
    {
47
        /*
48
        * Append the Sentry client-side SDK initialization stuff to 
49
        * the Bootstrap preset's bootstrap.js file.
50
        *
51
        * Since we re-initalized w/ the Bootstrap preset, we do not need
52
        * to check and see if this code was already appended -- it's a fresh slate.
53
        */
54
        $snippet = file_get_contents(__DIR__.'/northwestern-stubs/js/sentry.js');
×
55

56
        file_put_contents(resource_path('js/bootstrap.js'), $snippet, FILE_APPEND);
×
57
    }
58

59
    protected static function updateLayout()
60
    {
61
        $layout_dir = resource_path('views/layout');
×
62
        if (is_dir($layout_dir) == false) {
×
63
            mkdir($layout_dir);
×
64
        }
65

66
        copy(__DIR__."/northwestern-stubs/views/layout/_nav.blade.php", resource_path("views/layout/_nav.blade.php"));
×
67
    }
68
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc