Skip to content

Commit f909e64

Browse files
authored
Merge pull request #900 from ember-learn/update-auto-import
update node-sass and ember-auto-import
2 parents 556c0ea + c949a75 commit f909e64

13 files changed

+10470
-5985
lines changed

Diff for: app/services/algolia.js

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
import Service from '@ember/service';
22
import algoliasearch from 'algoliasearch';
33
import config from 'ember-api-docs/config/environment';
4-
import { denodeify } from 'rsvp';
54

65
export default class AlgoliaService extends Service {
7-
_search(query, params, callback) {
8-
if (!callback) {
9-
callback = params;
10-
params = undefined;
11-
}
6+
async search(query, params) {
127
if (query) {
138
if (Array.isArray(query) && !params) {
149
// if multiple indices
15-
this._client.search(query, callback);
10+
return this._client.search(query);
1611
} else if (!params) {
1712
// if no params
18-
this.accessIndex(query.indexName).search(query.query, callback);
13+
return this.accessIndex(query.indexName).search(query.query);
1914
} else {
2015
// if params and callback
21-
this.accessIndex(query.indexName).search(query.query, params, callback);
16+
return this.accessIndex(query.indexName).search(query.query, params);
2217
}
23-
} else {
24-
callback(new Error(`Could not search algolia for query "${query}"`));
2518
}
2619
}
2720

@@ -39,6 +32,5 @@ export default class AlgoliaService extends Service {
3932
config.algolia.algoliaKey
4033
);
4134
this._indices = {};
42-
this.search = denodeify(this._search.bind(this));
4335
}
4436
}

Diff for: app/styles/base/_forms.scss

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
@use "sass:math";
2-
31
fieldset {
42
background-color: lighten($base-border-color, 10%);
53
border: $base-border;
6-
margin: 0 0 $small-spacing;
4+
margin: 0 0 var(--small-spacing);
75
padding: $base-spacing;
86
}
97

@@ -30,7 +28,7 @@ select {
3028

3129
label {
3230
font-weight: 600;
33-
margin-bottom: math.div($small-spacing, 2);
31+
margin-bottom: calc(--sass-small-spacing / 2);
3432

3533
&.required::after {
3634
content: "*";
@@ -50,8 +48,8 @@ textarea {
5048
box-sizing: border-box;
5149
font-family: $base-font-family;
5250
font-size: $base-font-size;
53-
margin-bottom: math.div($base-spacing, 2);
54-
padding: math.div($base-spacing, 3);
51+
margin-bottom: calc($base-spacing / 2);
52+
padding: calc($base-spacing / 3);
5553
transition: border-color;
5654
width: 100%;
5755

@@ -74,10 +72,10 @@ textarea {
7472
input[type="checkbox"],
7573
input[type="radio"] {
7674
display: inline;
77-
margin-right: math.div($small-spacing, 2);
75+
margin-right: calc(--small-spacing / 2);
7876
}
7977

8078
input[type="file"] {
81-
padding-bottom: $small-spacing;
79+
padding-bottom: var(--small-spacing);
8280
width: 100%;
8381
}

Diff for: app/styles/base/_lists.scss

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ol {
66

77
&%default-ul {
88
list-style-type: disc;
9-
margin-bottom: $small-spacing;
9+
margin-bottom: var(--small-spacing);
1010
padding-left: $base-spacing;
1111

1212
@media (max-width: $mobile-portrait-screen){
@@ -21,12 +21,12 @@ ol {
2121
> li {
2222
counter-increment: customlistcounter;
2323
clear: both;
24-
padding: $small-spacing 0 $small-spacing 2em;
24+
padding: var(--small-spacing) 0 var(--small-spacing) 2em;
2525
position: relative;
2626
z-index: 1;
2727

2828
&::before {
29-
@include position(absolute, ($small-spacing + 0.5em) null null 0);
29+
@include position(absolute, (var(--small-spacing) + 0.5em) null null 0);
3030
@include size(2em);
3131
content: counter(customlistcounter) " ";
3232
border: 2px solid $base-border-color;
@@ -47,11 +47,11 @@ ol {
4747
}
4848

4949
dl {
50-
margin-bottom: $small-spacing;
50+
margin-bottom: var(--small-spacing);
5151

5252
dt {
5353
font-weight: bold;
54-
margin-top: $small-spacing;
54+
margin-top: var(--small-spacing);
5555
}
5656

5757
dd {

Diff for: app/styles/base/_tables.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
table {
22
font-feature-settings: "kern", "liga", "tnum";
33
border-collapse: collapse;
4-
margin: $small-spacing 0;
4+
margin: var(--small-spacing) 0;
55
table-layout: fixed;
66
width: 100%;
77
position: relative;
@@ -23,7 +23,7 @@ td {
2323
}
2424

2525
th, td {
26-
padding: $small-spacing;
26+
padding: var(--small-spacing);
2727
}
2828

2929
tr,

Diff for: app/styles/base/_typography.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ h6 {
2020
font-family: $heading-font-family;
2121
font-size: $base-font-size;
2222
line-height: $heading-line-height;
23-
margin: 0 0 $small-spacing;
23+
margin: 0 0 var(--small-spacing);
2424
font-weight: bold;
2525

2626
code {
@@ -43,7 +43,7 @@ h2 {
4343
}
4444

4545
p {
46-
margin: 1.5em 0 $small-spacing;
46+
margin: 1.5em 0 var(--small-spacing);
4747
line-height: 1.5em;
4848
}
4949

Diff for: app/styles/base/_variables.scss

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@use "sass:math";
2-
31
// Typography
42
$base-font-family: 'Source Sans Pro', sans-serif;
53
$heading-font-family: $base-font-family;
@@ -15,9 +13,14 @@ $large-font-size: 1.5rem;
1513
$base-line-height: 1.5;
1614
$heading-line-height: 1.2;
1715

16+
:root {
17+
--base-line-height: 1.5;
18+
--base-spacing: calc(var(--base-line-height) * 1em);
19+
--small-spacing: calc(var(--base-spacing) / 2);
20+
}
21+
1822
// Spacing
1923
$base-spacing: $base-line-height * 1em;
20-
$small-spacing: math.div($base-spacing, 2);
2124
$large-spacing: $base-spacing * 2;
2225
$top-spacing: $base-spacing * 3.333; // 80px
2326

Diff for: app/styles/components/_article.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
article {
2-
padding: $large-spacing $small-spacing;
2+
padding: $large-spacing var(--small-spacing);
33

44
@media (min-width: $medium-screen){
5-
padding: $small-spacing;
5+
padding: var(--small-spacing);
66
}
77

88
.edit-page {

Diff for: app/styles/components/_class-field-desc.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.chapter li {
2-
margin: $small-spacing 0;
2+
margin: var(--small-spacing) 0;
33

44
@media (max-width: $mobile-portrait-screen) {
55
margin: 0;

Diff for: app/styles/components/_highlight.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
font-family: $monospace-font-family;
66
font-size: 0.8em;
77
line-height: 1.5em;
8-
margin: $small-spacing 0 $large-spacing;
8+
margin: var(--small-spacing) 0 $large-spacing;
99
overflow: hidden;
1010
position: relative;
1111
font-variant-ligatures: none;
@@ -28,7 +28,7 @@
2828
}
2929
}
3030
}
31-
31+
3232
.scroller {
3333
overflow: auto;
3434
}

Diff for: app/styles/components/_sidebar.scss

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
border-bottom: $base-border;
44
position: relative;
55
z-index: 1;
6-
padding: $small-spacing 0;
6+
padding: var(--small-spacing) 0;
77

88
@include media($large-screen-up) {
99
// fixed sidebar, full height
@@ -12,7 +12,7 @@
1212
width: 19em;
1313
border-bottom: 0;
1414
border-right: $base-border;
15-
padding: $small-spacing $base-spacing $base-spacing * 1.5;
15+
padding: var(--small-spacing) $base-spacing $base-spacing * 1.5;
1616

1717
&::before {
1818
@include position(absolute, 0 0 0 -100vw);
@@ -123,14 +123,14 @@ ol.toc-level-1 {
123123
font-size: $base-font-size * 0.9;
124124
transition: max-height 0.5s ease;
125125

126-
&.selected{
126+
&.selected{
127127
max-height: 3000px;
128128
}
129129

130130
&:not(.selected) {
131131
overflow: hidden;
132132
max-height: 0;
133-
}
133+
}
134134

135135
li {
136136
border-left: 3px solid transparent;
@@ -148,6 +148,6 @@ ol.toc-level-1 {
148148
}
149149

150150
a {
151-
padding-left: $small-spacing;
151+
padding-left: var(--small-spacing);
152152
}
153153
}

Diff for: ember-cli-build.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const Funnel = require('broccoli-funnel');
55
const mergeTrees = require('broccoli-merge-trees');
66
const envIsProduction = process.env.EMBER_ENV === 'production';
77
const premberUrls = require('./prember-urls');
8+
const nodeSass = require('node-sass');
89

910
module.exports = function (defaults) {
1011
let app = new EmberApp(defaults, {
@@ -25,20 +26,14 @@ module.exports = function (defaults) {
2526
generateAssetMap: true,
2627
},
2728
sassOptions: {
29+
implementation: nodeSass,
2830
sourceMapEmbed: !envIsProduction,
2931
includePaths: [
3032
'app/styles',
3133
'node_modules/bourbon-neat/app/assets/stylesheets',
3234
'node_modules/normalize.css',
3335
],
3436
},
35-
autoImport: {
36-
webpack: {
37-
node: {
38-
process: 'mock',
39-
},
40-
},
41-
},
4237
autoprefixer: {
4338
enabled: true,
4439
cascade: true,

0 commit comments

Comments
 (0)