Skip to content

Commit 0cf11f7

Browse files
authoredJan 17, 2022
CSS fixes and dependency upgrades (#7564)
1 parent 4745cd3 commit 0cf11f7

File tree

38 files changed

+1190
-1528
lines changed

38 files changed

+1190
-1528
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"gulp": "^4.0.2",
4747
"gulp-babel": "^8.0.0",
4848
"husky": "^6.0.0",
49-
"lerna": "^3.3.2",
49+
"lerna": "^3.22.1",
5050
"lint-staged": "^10.2.11",
5151
"mocha": "^8.3.0",
5252
"mocha-junit-reporter": "^2.0.0",

‎packages/core/core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"dotenv": "^7.0.0",
4545
"dotenv-expand": "^5.1.0",
4646
"json-source-map": "^0.6.1",
47-
"json5": "^1.0.1",
47+
"json5": "^2.2.0",
4848
"micromatch": "^4.0.2",
4949
"msgpackr": "^1.5.1",
5050
"nullthrows": "^1.1.1",

‎packages/core/core/src/requests/TargetRequest.js

+17-13
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ const COMMON_TARGETS = {
7474
},
7575
};
7676

77+
const DEFAULT_ENGINES = {
78+
node: 'current',
79+
browsers: [
80+
'last 1 Chrome version',
81+
'last 1 Safari version',
82+
'last 1 Firefox version',
83+
'last 1 Edge version',
84+
],
85+
};
86+
7787
export type TargetRequest = {|
7888
id: string,
7989
+type: 'target_request',
@@ -317,7 +327,9 @@ export class TargetResolver {
317327
publicUrl: this.options.defaultTargetOptions.publicUrl ?? '/',
318328
env: createEnvironment({
319329
context: 'browser',
320-
engines: {},
330+
engines: {
331+
browsers: DEFAULT_ENGINES.browsers,
332+
},
321333
shouldOptimize: this.options.defaultTargetOptions.shouldOptimize,
322334
outputFormat: this.options.defaultTargetOptions.outputFormat,
323335
shouldScopeHoist:
@@ -473,23 +485,15 @@ export class TargetResolver {
473485

474486
let defaultEngines = this.options.defaultTargetOptions.engines;
475487
let context = browsers ?? !node ? 'browser' : 'node';
476-
if (
477-
context === 'browser' &&
478-
pkgEngines.browsers == null &&
479-
defaultEngines?.browsers != null
480-
) {
488+
if (context === 'browser' && pkgEngines.browsers == null) {
481489
pkgEngines = {
482490
...pkgEngines,
483-
browsers: defaultEngines.browsers,
491+
browsers: defaultEngines?.browsers ?? DEFAULT_ENGINES.browsers,
484492
};
485-
} else if (
486-
context === 'node' &&
487-
pkgEngines.node == null &&
488-
defaultEngines?.node != null
489-
) {
493+
} else if (context === 'node' && pkgEngines.node == null) {
490494
pkgEngines = {
491495
...pkgEngines,
492-
node: defaultEngines.node,
496+
node: defaultEngines?.node ?? DEFAULT_ENGINES.node,
493497
};
494498
}
495499

‎packages/core/core/test/TargetRequest.test.js

+36-8
Original file line numberDiff line numberDiff line change
@@ -675,9 +675,16 @@ describe('TargetResolver', () => {
675675
distEntry: 'index.js',
676676
publicUrl: '/',
677677
env: {
678-
id: 'bebcf0293c911f03',
678+
id: '6aafdb9eaa4a3812',
679679
context: 'node',
680-
engines: {},
680+
engines: {
681+
browsers: [
682+
'last 1 Chrome version',
683+
'last 1 Safari version',
684+
'last 1 Firefox version',
685+
'last 1 Edge version',
686+
],
687+
},
681688
includeNodeModules: false,
682689
isLibrary: true,
683690
outputFormat: 'commonjs',
@@ -1046,9 +1053,16 @@ describe('TargetResolver', () => {
10461053
distEntry: 'index.mjs',
10471054
publicUrl: '/',
10481055
env: {
1049-
id: 'fa77701547623794',
1056+
id: '439701173a9199ea',
10501057
context: 'browser',
1051-
engines: {},
1058+
engines: {
1059+
browsers: [
1060+
'last 1 Chrome version',
1061+
'last 1 Safari version',
1062+
'last 1 Firefox version',
1063+
'last 1 Edge version',
1064+
],
1065+
},
10521066
includeNodeModules: true,
10531067
outputFormat: 'esmodule',
10541068
isLibrary: false,
@@ -1084,9 +1098,16 @@ describe('TargetResolver', () => {
10841098
distEntry: 'index.js',
10851099
publicUrl: '/',
10861100
env: {
1087-
id: 'fa77701547623794',
1101+
id: '439701173a9199ea',
10881102
context: 'browser',
1089-
engines: {},
1103+
engines: {
1104+
browsers: [
1105+
'last 1 Chrome version',
1106+
'last 1 Safari version',
1107+
'last 1 Firefox version',
1108+
'last 1 Edge version',
1109+
],
1110+
},
10901111
includeNodeModules: true,
10911112
outputFormat: 'esmodule',
10921113
isLibrary: false,
@@ -1208,9 +1229,16 @@ describe('TargetResolver', () => {
12081229
distDir: '.parcel-cache/dist',
12091230
publicUrl: '/',
12101231
env: {
1211-
id: '4a236f9275d0a351',
1232+
id: 'd6ea1d42532a7575',
12121233
context: 'browser',
1213-
engines: {},
1234+
engines: {
1235+
browsers: [
1236+
'last 1 Chrome version',
1237+
'last 1 Safari version',
1238+
'last 1 Firefox version',
1239+
'last 1 Edge version',
1240+
],
1241+
},
12141242
includeNodeModules: true,
12151243
outputFormat: 'global',
12161244
isLibrary: false,

‎packages/core/integration-tests/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@
3232
"exif-reader": "^1.0.3",
3333
"get-port": "^5.0.0",
3434
"graphql": "^15.0.0",
35-
"http-proxy-middleware": "^1.0.0",
35+
"http-proxy-middleware": "^2.0.1",
3636
"js-yaml": "^4.0.0",
37-
"jsdom": "^15.2.1",
38-
"json5": "^1.0.1",
37+
"jsdom": "^19.0.0",
38+
"json5": "^2.2.0",
3939
"kotlin": "^1.3.11",
4040
"lodash": "^4.17.15",
4141
"marked": "^0.6.1",
4242
"ncp": "^2.0.0",
4343
"nib": "^1.1.2",
4444
"node-elm-compiler": "^5.0.5",
4545
"parcel": "^2.2.0",
46-
"postcss": "^8.3.0",
47-
"postcss-custom-properties": "^11.0.0",
46+
"postcss": "^8.4.5",
47+
"postcss-custom-properties": "^12.1.2",
4848
"postcss-import": "^14.0.2",
49-
"posthtml-include": "^1.7.1",
49+
"posthtml-include": "^1.7.2",
5050
"posthtml-obfuscate": "^0.1.5",
5151
"preact": "^10.5.9",
5252
"react": "^17.0.2",

‎packages/core/integration-tests/test/css.js

+29-9
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,20 @@ describe('css', () => {
163163
path.join(distDir, 'index.css'),
164164
'utf8',
165165
);
166-
assert(/url\(test\.[0-9a-f]+\.woff2\)/.test(css));
167-
assert(css.includes('url(http://google.com)'));
166+
assert(/url\("test\.[0-9a-f]+\.woff2"\)/.test(css));
167+
assert(css.includes('url("http://google.com")'));
168168
assert(css.includes('.index'));
169-
assert(css.includes('url(data:image/gif;base64,quotes)'));
169+
assert(css.includes('url("data:image/gif;base64,quotes")'));
170170
assert(css.includes('.quotes'));
171-
assert(css.includes('url(data:image/gif;base64,no-quote)'));
171+
assert(css.includes('url("data:image/gif;base64,no-quote")'));
172172
assert(css.includes('.no-quote'));
173173

174174
assert(
175175
await outputFS.exists(
176-
path.join(distDir, css.match(/url\((test\.[0-9a-f]+\.woff2)\)/)[1]),
176+
path.join(
177+
distDir,
178+
css.match(/url\("(test\.[0-9a-f]+\.woff2)"\)/)[1],
179+
),
177180
),
178181
);
179182
});
@@ -217,9 +220,9 @@ describe('css', () => {
217220
);
218221
assert(css.includes('url(http://google.com)'), 'url() found');
219222
assert(css.includes('.index'), '.index found');
220-
assert(css.includes('url(data:image/gif;base64,quotes)'));
223+
assert(/url\("?data:image\/gif;base64,quotes"?\)/.test(css));
221224
assert(css.includes('.quotes'));
222-
assert(css.includes('url(data:image/gif;base64,no-quote)'));
225+
assert(/url\("?data:image\/gif;base64,no-quote"?\)/.test(css));
223226
assert(css.includes('.no-quote'));
224227

225228
assert(
@@ -362,7 +365,7 @@ describe('css', () => {
362365
assert.equal(
363366
css.trim(),
364367
`.svg-img {
365-
background-image: url(data:image/svg+xml,%3Csvg%20width%3D%22120%22%20height%3D%22120%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cfilter%20id%3D%22blur-_.%21~%2a%22%3E%0A%20%20%20%20%3CfeGaussianBlur%20stdDeviation%3D%225%22%3E%3C%2FfeGaussianBlur%3E%0A%20%20%3C%2Ffilter%3E%0A%20%20%3Ccircle%20cx%3D%2260%22%20cy%3D%2260%22%20r%3D%2250%22%20fill%3D%22green%22%20filter%3D%22url%28%27%23blur-_.%21~%2a%27%29%22%3E%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A);
368+
background-image: url("data:image/svg+xml,%3Csvg%20width%3D%22120%22%20height%3D%22120%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cfilter%20id%3D%22blur-_.%21~%2a%22%3E%0A%20%20%20%20%3CfeGaussianBlur%20stdDeviation%3D%225%22%3E%3C%2FfeGaussianBlur%3E%0A%20%20%3C%2Ffilter%3E%0A%20%20%3Ccircle%20cx%3D%2260%22%20cy%3D%2260%22%20r%3D%2250%22%20fill%3D%22green%22%20filter%3D%22url%28%27%23blur-_.%21~%2a%27%29%22%3E%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A");
366369
}`,
367370
);
368371
});
@@ -375,7 +378,7 @@ describe('css', () => {
375378
);
376379
assert(
377380
css.startsWith(`.webp-img {
378-
background-image: url(data:image/webp;base64,UklGR`),
381+
background-image: url("data:image/webp;base64,UklGR`),
379382
);
380383
});
381384

@@ -466,4 +469,21 @@ describe('css', () => {
466469
});
467470
});
468471
}
472+
473+
it('should support css nesting with @parcel/css', async function () {
474+
let b = await originalBundle(
475+
path.join(__dirname, '/integration/css-nesting/a.css'),
476+
{
477+
defaultConfig:
478+
path.dirname(require.resolve('@parcel/test-utils')) +
479+
'/.parcelrc-css',
480+
defaultTargetOptions: {
481+
engines: {},
482+
},
483+
},
484+
);
485+
486+
let res = await outputFS.readFile(b.getBundles()[0].filePath, 'utf8');
487+
assert(res.includes('.foo.bar'));
488+
});
469489
});

‎packages/core/integration-tests/test/html.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ describe('html', function () {
615615
);
616616

617617
// mergeStyles
618-
assert(html.includes('<style>h1{color:red}</style>'));
618+
assert(html.includes('<style>h1{color:red}div{font-size:20px}</style>'));
619619

620620
assert(!html.includes('sourceMappingURL'));
621621

@@ -943,7 +943,7 @@ describe('html', function () {
943943
let contents = await outputFS.readFile(b.getBundles()[0].filePath, 'utf8');
944944
assert(
945945
contents.includes(
946-
'<svg><symbol id="all"><rect width="100" height="100"/></symbol></svg><svg xmlns:xlink="http://www.w3.org/1999/xlink"><use xlink:href="#all" href="#all"/></svg>',
946+
'<svg><symbol id="all"><rect width="100" height="100"/></symbol></svg><svg><use xlink:href="#all" href="#all"/></svg>',
947947
),
948948
);
949949
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.foo {
2+
color: red;
3+
4+
&.bar {
5+
color: blue;
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"@parcel/transformer-css": {
3+
"drafts": {
4+
"nesting": true
5+
}
6+
}
7+
}

‎packages/core/integration-tests/test/integration/css-nesting/yarn.lock

Whitespace-only changes.

‎packages/core/integration-tests/test/integration/vue-functional/functional.vue

-15
This file was deleted.

‎packages/core/integration-tests/test/javascript.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4108,7 +4108,7 @@ describe('javascript', function () {
41084108
}
41094109
41104110
.svg-img {
4111-
background-image: url(data:image/svg+xml,%3Csvg%3E%0A%0A%3C%2Fsvg%3E%0A);
4111+
background-image: url("data:image/svg+xml,%3Csvg%3E%0A%0A%3C%2Fsvg%3E%0A");
41124112
}`,
41134113
),
41144114
);
@@ -4150,7 +4150,7 @@ describe('javascript', function () {
41504150
}
41514151
41524152
.svg-img {
4153-
background-image: url(data:image/svg+xml,%3Csvg%3E%0A%0A%3C%2Fsvg%3E%0A);
4153+
background-image: url("data:image/svg+xml,%3Csvg%3E%0A%0A%3C%2Fsvg%3E%0A");
41544154
}`,
41554155
),
41564156
);
@@ -4238,7 +4238,7 @@ describe('javascript', function () {
42384238
}
42394239
42404240
.svg-img {
4241-
background-image: url(data:image/svg+xml,%3Csvg%3E%0A%0A%3C%2Fsvg%3E%0A);
4241+
background-image: url("data:image/svg+xml,%3Csvg%3E%0A%0A%3C%2Fsvg%3E%0A");
42424242
}`,
42434243
),
42444244
);

‎packages/core/integration-tests/test/postcss.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('postcss', () => {
6666

6767
let css = await outputFS.readFile(path.join(distDir, 'index.css'), 'utf8');
6868

69-
assert(css.includes('url(data:image/gif;base64,quotes)'));
69+
assert(css.includes('url("data:image/gif;base64,quotes")'));
7070
});
7171

7272
it('should automatically install postcss plugins if needed', async () => {

‎packages/core/integration-tests/test/sass.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ describe('sass', function () {
132132
assert.equal(output(), 2);
133133

134134
let css = await outputFS.readFile(path.join(distDir, 'index.css'), 'utf8');
135-
assert(/url\(test\.[0-9a-f]+\.woff2\)/.test(css));
136-
assert(css.includes('url(http://google.com)'));
135+
assert(/url\("test\.[0-9a-f]+\.woff2"\)/.test(css));
136+
assert(css.includes('url("http://google.com")'));
137137
assert(css.includes('.index'));
138138

139139
assert(
140140
await outputFS.exists(
141-
path.join(distDir, css.match(/url\((test\.[0-9a-f]+\.woff2)\)/)[1]),
141+
path.join(distDir, css.match(/url\("(test\.[0-9a-f]+\.woff2)"\)/)[1]),
142142
),
143143
);
144144
});

‎packages/core/integration-tests/test/svg-react.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('svg-react', function () {
1616

1717
let file = await outputFS.readFile(b.getBundles()[0].filePath, 'utf-8');
1818
assert(!file.includes('inkscape'));
19-
assert(file.includes('function SvgIcon'));
19+
assert(file.includes('const SvgIcon ='));
2020
assert(file.includes('_react.createElement("svg"'));
2121
});
2222
});

‎packages/core/integration-tests/test/svg.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ describe('svg', function () {
189189
assert(svg.includes(':root {\n fill: red;\n}'));
190190
assert(
191191
svg.includes(
192-
`"fill: url(${path.basename(
192+
`"fill: url(&quot;${path.basename(
193193
b.getBundles().find(b => b.name.startsWith('gradient')).filePath,
194-
)}#myGradient)"`,
194+
)}#myGradient&quot;)`,
195195
),
196196
);
197197
assert(svg.includes('<script>'));

‎packages/core/integration-tests/test/vue.js

-15
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,6 @@ describe('vue', function () {
3434
assert(contents.includes('background: red'));
3535
assert(contents.includes('color: green'));
3636
});
37-
it('should produce a vue bundle using a functional component', async function () {
38-
let b = await bundle(
39-
path.join(__dirname, '/integration/vue-functional/functional.vue'),
40-
);
41-
let output = (await run(b)).default;
42-
assert.equal(typeof output.render, 'function');
43-
assert.equal(typeof output.__cssModules, 'object');
44-
let modules = output.__cssModules;
45-
assert.equal(typeof modules.$style.red, 'string');
46-
let contents = await outputFS.readFile(
47-
path.join(distDir, 'functional.css'),
48-
'utf8',
49-
);
50-
assert(contents.includes('.' + modules.$style.red));
51-
});
5237
it('should produce a vue bundle using scoped styles', async function () {
5338
let b = await bundle(
5439
path.join(__dirname, '/integration/vue-scoped/App.vue'),

‎packages/core/package-manager/src/NodeResolverBase.js

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export class NodeResolverBase<T> {
8181
if (
8282
process.env.PARCEL_BUILD_ENV !== 'production' &&
8383
typeof pkg.name === 'string' &&
84+
typeof pkg.source === 'string' &&
8485
pkg.name.startsWith('@parcel/') &&
8586
pkg.name !== '@parcel/watcher'
8687
) {

‎packages/core/test-utils/src/utils.js

+3
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,9 @@ function prepareBrowserContext(
704704
origin: 'http://localhost',
705705
protocol: 'http',
706706
},
707+
navigator: {
708+
userAgent: '',
709+
},
707710
fetch(url) {
708711
return Promise.resolve({
709712
async arrayBuffer() {

‎packages/core/utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"fastest-levenshtein": "^1.0.8",
3535
"is-glob": "^4.0.0",
3636
"is-url": "^1.2.2",
37-
"json5": "^1.0.1",
37+
"json5": "^2.2.0",
3838
"lru-cache": "^6.0.0",
3939
"micromatch": "^4.0.4",
4040
"node-forge": "^1.2.1",

‎packages/optimizers/css/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"parcel": "^2.2.0"
2121
},
2222
"dependencies": {
23-
"@parcel/css": "^1.0.0",
23+
"@parcel/css": "^1.0.3",
2424
"@parcel/plugin": "^2.2.0",
2525
"@parcel/source-map": "^2.0.0",
2626
"@parcel/utils": "^2.2.0",

‎packages/optimizers/cssnano/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"dependencies": {
2323
"@parcel/plugin": "^2.2.0",
2424
"@parcel/source-map": "^2.0.0",
25-
"cssnano": "^5.0.5",
26-
"postcss": "^8.3.0"
25+
"cssnano": "^5.0.15",
26+
"postcss": "^8.4.5"
2727
}
2828
}

‎packages/optimizers/htmlnano/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"dependencies": {
2323
"@parcel/plugin": "^2.2.0",
24-
"htmlnano": "^1.0.1",
24+
"htmlnano": "^2.0.0",
2525
"nullthrows": "^1.1.1",
2626
"posthtml": "^0.16.5",
2727
"svgo": "^2.4.0"

‎packages/packagers/css/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
"@parcel/source-map": "^2.0.0",
2525
"@parcel/utils": "^2.2.0",
2626
"nullthrows": "^1.1.1",
27-
"postcss": "^8.3.0"
27+
"postcss": "^8.4.5"
2828
}
2929
}

‎packages/reporters/dev-server/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@parcel/utils": "^2.2.0",
2626
"connect": "^3.7.0",
2727
"ejs": "^3.1.6",
28-
"http-proxy-middleware": "^1.0.0",
28+
"http-proxy-middleware": "^2.0.1",
2929
"nullthrows": "^1.1.1",
3030
"serve-handler": "^6.0.0",
3131
"ws": "^7.0.0"

‎packages/transformers/babel/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@parcel/utils": "^2.2.0",
3333
"browserslist": "^4.6.6",
3434
"core-js": "^3.2.1",
35-
"json5": "^2.1.0",
35+
"json5": "^2.2.0",
3636
"nullthrows": "^1.1.1",
3737
"semver": "^5.7.0"
3838
},

‎packages/transformers/css-experimental/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"parcel": "^2.2.0"
2121
},
2222
"dependencies": {
23-
"@parcel/css": "^1.0.0",
23+
"@parcel/css": "^1.0.3",
2424
"@parcel/plugin": "^2.2.0",
2525
"@parcel/source-map": "^2.0.0",
2626
"@parcel/utils": "^2.2.0",

‎packages/transformers/css/package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@
2424
"@parcel/plugin": "^2.2.0",
2525
"@parcel/source-map": "^2.0.0",
2626
"@parcel/utils": "^2.2.0",
27-
"css-modules-loader-core": "^1.1.0",
2827
"nullthrows": "^1.1.1",
29-
"postcss": "^8.3.0",
30-
"postcss-modules": "^3.2.2",
31-
"postcss-value-parser": "^4.1.0",
28+
"postcss": "^8.4.5",
29+
"postcss-modules": "^4.3.0",
30+
"postcss-value-parser": "^4.2.0",
3231
"semver": "^5.7.1"
3332
}
3433
}

‎packages/transformers/css/src/CSSTransformer.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import postcss from 'postcss';
1111
import nullthrows from 'nullthrows';
1212
import valueParser from 'postcss-value-parser';
1313
import postcssModules from 'postcss-modules';
14-
import FileSystemLoader from 'css-modules-loader-core/lib/file-system-loader';
14+
import FileSystemLoader from 'postcss-modules/build/css-loader-core/loader';
1515
import semver from 'semver';
1616
import path from 'path';
1717

18-
const URL_RE = /url\s*\("?(?![a-z]+:)/;
18+
const URL_RE = /url\s*\(/;
1919
const IMPORT_RE = /@import/;
2020
const COMPOSES_RE = /composes:.+from\s*("|').*("|')\s*;?/;
2121
const FROM_IMPORT_RE = /.+from\s*(?:"|')(.*)(?:"|')\s*;?/;
@@ -185,7 +185,8 @@ export default (new Transformer({
185185
),
186186
});
187187
isDeclDirty = urlNode.value !== url;
188-
urlNode.type = 'word';
188+
urlNode.type = 'string';
189+
urlNode.quote = '"';
189190
urlNode.value = url;
190191
}
191192
});

‎packages/transformers/json/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
},
2222
"dependencies": {
2323
"@parcel/plugin": "^2.2.0",
24-
"json5": "^2.1.0"
24+
"json5": "^2.2.0"
2525
}
2626
}

‎packages/transformers/jsonld/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
"dependencies": {
2626
"@parcel/plugin": "^2.2.0",
2727
"@parcel/types": "^2.2.0",
28-
"json5": "^2.1.2"
28+
"json5": "^2.2.0"
2929
}
3030
}

‎packages/transformers/postcss/package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@
2424
"@parcel/plugin": "^2.2.0",
2525
"@parcel/utils": "^2.2.0",
2626
"clone": "^2.1.1",
27-
"css-modules-loader-core": "^1.1.0",
2827
"nullthrows": "^1.1.1",
29-
"postcss-modules": "^3.2.2",
30-
"postcss-value-parser": "^4.1.0",
28+
"postcss-modules": "^4.3.0",
29+
"postcss-value-parser": "^4.2.0",
3130
"semver": "^5.7.1"
3231
},
3332
"devDependencies": {
34-
"postcss": "^8.3.0"
33+
"postcss": "^8.4.5"
3534
}
3635
}

‎packages/transformers/postcss/src/PostCSSTransformer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type {FilePath, Asset, MutableAsset, PluginOptions} from '@parcel/types';
55
import {hashString} from '@parcel/hash';
66
import {glob} from '@parcel/utils';
77
import {Transformer} from '@parcel/plugin';
8-
import FileSystemLoader from 'css-modules-loader-core/lib/file-system-loader';
8+
import FileSystemLoader from 'postcss-modules/build/css-loader-core/loader';
99
import nullthrows from 'nullthrows';
1010
import path from 'path';
1111
import semver from 'semver';

‎packages/transformers/sugarss/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"dependencies": {
2323
"@parcel/plugin": "^2.2.0",
24-
"postcss": "^8.3.0",
24+
"postcss": "^8.4.5",
2525
"sugarss": "^3.0.3"
2626
}
2727
}

‎packages/transformers/svg-react/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
},
2222
"dependencies": {
2323
"@parcel/plugin": "^2.2.0",
24-
"@svgr/core": "^5.5.0",
25-
"@svgr/plugin-jsx": "^5.5.0",
26-
"@svgr/plugin-svgo": "^5.5.0",
27-
"camelcase": "^5.3.1"
24+
"@svgr/core": "^6.2.0",
25+
"@svgr/plugin-jsx": "^6.2.0",
26+
"@svgr/plugin-svgo": "^6.2.0",
27+
"camelcase": "^6.3.0"
2828
}
2929
}

‎packages/transformers/svg-react/src/SvgReactTransformer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import path from 'path';
66
import camelcase from 'camelcase';
77
import svgoPlugin from '@svgr/plugin-svgo';
88
import jsxPlugin from '@svgr/plugin-jsx';
9-
import convert from '@svgr/core';
9+
import {transform} from '@svgr/core';
1010

1111
function getComponentName(filePath) {
1212
let validCharacters = /[^a-zA-Z0-9_-]/g;
@@ -21,7 +21,7 @@ export default (new Transformer({
2121
let code = await asset.getCode();
2222
let componentName = getComponentName(asset.filePath);
2323

24-
const jsx = await convert(
24+
const jsx = await transform(
2525
code,
2626
{},
2727
{

‎packages/transformers/vue/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
"@parcel/plugin": "^2.2.0",
2525
"@parcel/source-map": "^2.0.0",
2626
"@parcel/utils": "^2.2.0",
27-
"@vue/compiler-sfc": "^3.0.0",
27+
"@vue/compiler-sfc": "^3.2.27",
2828
"consolidate": "^0.16.0",
2929
"nullthrows": "^1.1.1",
3030
"semver": "^5.7.1"
3131
},
3232
"devDependencies": {
33-
"vue": "^3.0.0"
33+
"vue": "^3.2.27"
3434
}
3535
}

‎yarn.lock

+1,039-1,416
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.