Skip to content

Commit 9f04032

Browse files
authored
Merge pull request #112 from IgnaceMaes/use-ember-shiki
feat: remove ember-prism in favour of ember-shiki
2 parents 3613b79 + 2698c2e commit 9f04032

File tree

12 files changed

+298
-186
lines changed

12 files changed

+298
-186
lines changed

app/components/code-snippet.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<CodeBlock
33
data-test-code-snippet
44
@code={{snippet.source}}
5-
@language={{get-prism-language snippet.language}}
5+
@language={{snippet.language}}
66
@showLineNumbers={{true}}
77
/>
88
{{/let}}

app/components/guide-section/subsection.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,7 @@
6262
justify-content: flex-end;
6363
margin-top: 1rem;
6464
}
65+
66+
.code-snippet {
67+
margin-top: 0.5rem;
68+
}

app/components/guide-section/subsection.hbs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
<ContainerQuery
3737
@features={{hash
38-
wide=(cq-width min=900)
38+
wide=(width min=900)
3939
}}
4040
local-class="code-examples-container"
4141
>
@@ -48,9 +48,11 @@
4848
</h4>
4949

5050
{{#each @subsection.classicFiles as |file|}}
51-
<CodeSnippet
52-
@fileName="{{@sectionId}}/{{subsectionId}}/{{file}}"
53-
/>
51+
<div local-class="code-snippet">
52+
<CodeSnippet
53+
@fileName="{{@sectionId}}/{{subsectionId}}/{{file}}"
54+
/>
55+
</div>
5456
{{/each}}
5557

5658
{{#if @subsection.classicDescriptionKey}}
@@ -69,9 +71,11 @@
6971
</h4>
7072

7173
{{#each @subsection.octaneFiles as |file|}}
72-
<CodeSnippet
73-
@fileName="{{@sectionId}}/{{subsectionId}}/{{file}}"
74-
/>
74+
<div local-class="code-snippet">
75+
<CodeSnippet
76+
@fileName="{{@sectionId}}/{{subsectionId}}/{{file}}"
77+
/>
78+
</div>
7579
{{/each}}
7680

7781
{{#if @subsection.octaneDescriptionKey}}

app/components/locale-menu.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<ContainerQuery
22
@features={{hash
3-
wide=(cq-width min=480)
3+
wide=(width min=480)
44
}}
55
local-class="container"
66
>

app/helpers/get-prism-language.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

config/environment.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ module.exports = function (environment) {
2121
// Here you can pass flags/options to your application instance
2222
// when it is created
2323
},
24+
'ember-shiki': {
25+
defaultThemes: ['dark-plus'],
26+
},
2427
};
2528

2629
if (environment === 'development') {

config/fastboot.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* eslint-disable no-redeclare */
2+
/* global ReadableStream, WritableStream, TransformStream, Headers */
3+
module.exports = function () {
4+
return {
5+
buildSandboxGlobals(defaultGlobals) {
6+
return Object.assign({}, defaultGlobals, {
7+
fetch: require('node-fetch'),
8+
AbortController,
9+
ReadableStream:
10+
typeof ReadableStream !== 'undefined'
11+
? ReadableStream
12+
: require('node:stream/web').ReadableStream,
13+
WritableStream:
14+
typeof WritableStream !== 'undefined'
15+
? WritableStream
16+
: require('node:stream/web').WritableStream,
17+
TransformStream:
18+
typeof TransformStream !== 'undefined'
19+
? TransformStream
20+
: require('node:stream/web').TransformStream,
21+
Headers: typeof Headers !== 'undefined' ? Headers : undefined,
22+
});
23+
},
24+
};
25+
};

ember-cli-build.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app');
44

55
module.exports = function (defaults) {
66
let app = new EmberApp(defaults, {
7-
// Theme options are coy, dark, funky, okaidia, solarizedlight, tomorrow,
8-
// and twilight. Remove the `theme` attribute to use the default theme.
9-
'ember-prism': {
10-
theme: 'tomorrow',
11-
components: [
12-
'handlebars',
13-
'markup-templating', // handlebars
14-
'bash', // shell
15-
],
16-
plugins: ['line-numbers'],
17-
},
18-
197
prember: {
208
urls: ['/'],
219
},

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@
5252
"ember-cli-sri": "^2.1.1",
5353
"ember-cli-terser": "^4.0.2",
5454
"ember-code-snippet": "^3.0.0",
55-
"ember-container-query": "^2.1.0",
55+
"ember-container-query": "^4.0.5",
5656
"ember-css-modules": "^2.0.1",
5757
"ember-export-application-global": "^2.0.1",
5858
"ember-fetch": "^8.1.1",
5959
"ember-intl": "^5.7.2",
6060
"ember-load-initializers": "^2.1.2",
6161
"ember-page-title": "^7.0.0",
62-
"ember-prism": "^0.12.0",
6362
"ember-qunit": "^5.1.5",
6463
"ember-resolver": "^8.0.3",
64+
"ember-shiki": "^0.1.5",
6565
"ember-source": "~4.4.0",
6666
"ember-template-lint": "^4.10.0",
6767
"ember-test-selectors": "^6.0.0",
@@ -72,6 +72,7 @@
7272
"eslint-plugin-prettier": "^4.0.0",
7373
"eslint-plugin-qunit": "^7.3.0",
7474
"loader.js": "^4.7.0",
75+
"node-fetch": "^2.7.0",
7576
"npm-run-all": "^4.1.5",
7677
"prember": "^1.1.0",
7778
"prettier": "^2.7.1",

tests/acceptance/homepage/en-us-test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ module('Acceptance | Homepage | en-US', function (hooks) {
1818

1919
test('Accessibility audit', async function (assert) {
2020
await visit('/');
21-
await a11yAudit();
21+
await a11yAudit({
22+
rules: {
23+
'scrollable-region-focusable': {
24+
enabled: false,
25+
},
26+
},
27+
});
2228

2329
assert.ok(true);
2430
});

0 commit comments

Comments
 (0)