Skip to content

Commit

Permalink
Remove stylus support
Browse files Browse the repository at this point in the history
  • Loading branch information
MonicaOlejniczak committed Aug 20, 2024
1 parent d99d151 commit ea4805a
Show file tree
Hide file tree
Showing 41 changed files with 12 additions and 1,058 deletions.
2 changes: 0 additions & 2 deletions crates/atlaspack_core/src/types/package_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ bitflags! {
const STYLE = 1 << 12;
const SASS = 1 << 13;
const LESS = 1 << 14;
const STYLUS = 1 << 15;
}
}

Expand Down Expand Up @@ -69,7 +68,6 @@ impl TryFrom<&str> for ExportsCondition {
"style" => ExportsCondition::STYLE,
"sass" => ExportsCondition::SASS,
"less" => ExportsCondition::LESS,
"stylus" => ExportsCondition::STYLUS,
_ => return Err(()),
})
}
Expand Down
54 changes: 0 additions & 54 deletions flow-libs/stylus.js.flow

This file was deleted.

1 change: 0 additions & 1 deletion packages/configs/default/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"*.{yaml,yml}": ["@atlaspack/transformer-yaml"],
"*.{glsl,vert,frag}": ["@atlaspack/transformer-glsl"],
"*.{gql,graphql}": ["@atlaspack/transformer-graphql"],
"*.{styl,stylus}": ["@atlaspack/transformer-stylus"],
"*.{sass,scss}": ["@atlaspack/transformer-sass"],
"*.less": ["@atlaspack/transformer-less"],
"*.{css,pcss}": [
Expand Down
1 change: 0 additions & 1 deletion packages/configs/default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"@atlaspack/transformer-mdx": "2.12.0",
"@atlaspack/transformer-pug": "2.12.0",
"@atlaspack/transformer-sass": "2.12.0",
"@atlaspack/transformer-stylus": "2.12.0",
"@atlaspack/transformer-toml": "2.12.0",
"@atlaspack/transformer-typescript-types": "2.12.0",
"@atlaspack/transformer-vue": "2.12.0",
Expand Down
1 change: 0 additions & 1 deletion packages/core/core/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ export const ExportsCondition = {
style: 1 << 12,
sass: 1 << 13,
less: 1 << 14,
stylus: 1 << 15,
};

export type Dependency = {|
Expand Down
1 change: 0 additions & 1 deletion packages/core/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"kotlin": "^1.3.11",
"lodash": "^4.17.15",
"ncp": "^2.0.0",
"nib": "^1.1.2",
"postcss": "^8.4.5",
"postcss-custom-properties": "^12.1.2",
"postcss-import": "^14.0.2",
Expand Down
225 changes: 0 additions & 225 deletions packages/core/integration-tests/test/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -3605,231 +3605,6 @@ describe.v2('cache', function () {
});
});

describe('stylus', function () {
it('should support resolver inside stylus file', async function () {
let b = await testCache(
{
entries: ['index.js'],
async setup() {
await overlayFS.writeFile(
path.join(inputDir, 'index.styl'),
`
@import "./b";
.a
background: red
`,
);

await overlayFS.mkdirp(path.join(inputDir, 'b'));
await overlayFS.writeFile(
path.join(inputDir, 'b/index.styl'),
`
.b
background: blue
`,
);
},
async update(b) {
let css = await overlayFS.readFile(
nullthrows(
b.bundleGraph.getBundles().find(b => b.type === 'css')
?.filePath,
),
'utf8',
);
assert(css.includes('.a {'));
assert(css.includes('.b {'));
assert(!css.includes('.c {'));

await overlayFS.writeFile(
path.join(inputDir, 'b.styl'),
`
.c
background: blue
`,
);
},
},
'stylus',
);

let css = await overlayFS.readFile(
nullthrows(
b.bundleGraph.getBundles().find(b => b.type === 'css')?.filePath,
),
'utf8',
);
assert(css.includes('.a {'));
assert(!css.includes('.b {'));
assert(css.includes('.c {'));
});

it('should support stylus default resolver', async function () {
let b = await testCache(
{
entries: ['index.js'],
async setup() {
await overlayFS.writeFile(
path.join(inputDir, '.stylusrc'),
JSON.stringify({
paths: ['deps'],
}),
);
},
async update(b) {
let css = await overlayFS.readFile(
nullthrows(
b.bundleGraph.getBundles().find(b => b.type === 'css')
?.filePath,
),
'utf8',
);
assert(css.includes('.a {'));
assert(!css.includes('.b {'));

await overlayFS.writeFile(
path.join(inputDir, 'a.styl'),
`
.b
background: blue
`,
);
},
},
'stylus-deps',
);

let css = await overlayFS.readFile(
nullthrows(
b.bundleGraph.getBundles().find(b => b.type === 'css')?.filePath,
),
'utf8',
);
assert(!css.includes('.a {'));
assert(css.includes('.b {'));
});

it('should support glob imports in stylus files', async function () {
let b = await testCache(
{
entries: ['index.js'],
async update(b) {
let css = await overlayFS.readFile(
nullthrows(
b.bundleGraph.getBundles().find(b => b.type === 'css')
?.filePath,
),
'utf8',
);
assert(css.includes('.index'));
assert(css.includes('.main'));
assert(css.includes('.foo'));
assert(css.includes('.bar'));

await overlayFS.writeFile(
path.join(inputDir, 'subdir/test.styl'),
`
.test
background: blue
`,
);

await overlayFS.writeFile(
path.join(inputDir, 'subdir/foo/test.styl'),
`
.foo-test
background: blue
`,
);
},
},
'stylus-glob-import',
);

let css = await overlayFS.readFile(
nullthrows(
b.bundleGraph.getBundles().find(b => b.type === 'css')?.filePath,
),
'utf8',
);
assert(css.includes('.index'));
assert(css.includes('.main'));
assert(css.includes('.foo'));
assert(css.includes('.bar'));
assert(css.includes('.test'));
assert(css.includes('.foo-test'));
});

it('should support glob imports under stylus paths', async function () {
let b = await testCache(
{
entries: ['index.js'],
async setup() {
await overlayFS.writeFile(
path.join(inputDir, '.stylusrc'),
JSON.stringify({
paths: ['subdir'],
}),
);

await overlayFS.writeFile(
path.join(inputDir, 'index.styl'),
`
@require 'foo/*'
.index
color: red
`,
);
},
async update(b) {
let css = await overlayFS.readFile(
nullthrows(
b.bundleGraph.getBundles().find(b => b.type === 'css')
?.filePath,
),
'utf8',
);
assert(css.includes('.index'));
assert(!css.includes('.main'));
assert(css.includes('.foo'));
assert(!css.includes('.bar'));

await overlayFS.writeFile(
path.join(inputDir, 'subdir/test.styl'),
`
.test
background: blue
`,
);

await overlayFS.writeFile(
path.join(inputDir, 'subdir/foo/test.styl'),
`
.foo-test
background: blue
`,
);
},
},
'stylus-glob-import',
);

let css = await overlayFS.readFile(
nullthrows(
b.bundleGraph.getBundles().find(b => b.type === 'css')?.filePath,
),
'utf8',
);
assert(css.includes('.index'));
assert(!css.includes('.main'));
assert(css.includes('.foo'));
assert(!css.includes('.bar'));
assert(!css.includes('.test'));
assert(css.includes('.foo-test'));
});
});

describe('less', function () {
it('should support adding higher priority less include paths', async function () {
let b = await testCache(
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

Loading

0 comments on commit ea4805a

Please sign in to comment.