Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v9: update node, babel and jest #39

Open
wants to merge 1 commit into
base: v9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.10.0
20.11.0
1 change: 0 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ module.exports = {
plugins: [
'@babel/transform-flow-strip-types',
'@babel/transform-modules-commonjs',
'@babel/syntax-object-rest-spread',
],
};
5 changes: 5 additions & 0 deletions jest.config.base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
transform: {
'\\.[jt]sx?$': ['babel-jest', { rootMode: 'upward' }],
},
};
2 changes: 0 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module.exports = {
projects: ['<rootDir>/packages/*'],
coverageDirectory: './coverage/',
collectCoverage: true,
};
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
"private": true,
"devDependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@babel/plugin-syntax-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-flow-strip-types": "^7.0.0",
"@babel/plugin-transform-modules-commonjs": "^7.1.0",
"babel-core": "^7.0.0-bridge.0",
"@babel/cli": "7.20.7",
"@babel/core": "7.20.12",
"@babel/plugin-transform-flow-strip-types": "7.19.0",
"@babel/plugin-transform-modules-commonjs": "7.20.11",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"babel-jest": "29.7.0",
"eslint": "4.17.0",
"flow-bin": "^0.83.0",
"flow-typed": "^2.5.1",
"jest": "^23.6.0",
"jest": "29.7.0",
"lerna": "^3.4.3",
"prettier": "^1.14.3"
},
Expand Down
164 changes: 82 additions & 82 deletions packages/sporks/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,102 +5,102 @@ import { parse } from '../src';
describe('parse', () => {
it('parses #=', () => {
expect(parse('#= hello world')).toMatchInlineSnapshot(`
Object {
"directives": Array [
Object {
"args": Array [
"world",
],
"directive": "hello",
"loc": Object {
"line": 1,
"start": 0,
},
"source": "#= hello world",
},
],
"headerSource": "#= hello world",
"source": "",
}
`);
{
"directives": [
{
"args": [
"world",
],
"directive": "hello",
"loc": {
"line": 1,
"start": 0,
},
"source": "#= hello world",
},
],
"headerSource": "#= hello world",
"source": "",
}
`);
});

it('parses //=', () => {
expect(parse('//= hello world')).toMatchInlineSnapshot(`
Object {
"directives": Array [
Object {
"args": Array [
"world",
],
"directive": "hello",
"loc": Object {
"line": 1,
"start": 0,
},
"source": "//= hello world",
},
],
"headerSource": "//= hello world",
"source": "",
}
`);
{
"directives": [
{
"args": [
"world",
],
"directive": "hello",
"loc": {
"line": 1,
"start": 0,
},
"source": "//= hello world",
},
],
"headerSource": "//= hello world",
"source": "",
}
`);
});

it('parses multiple lines', () => {
expect(parse('#= hello world\n#= hello mars\n#\n\n#= hello venus\n\n'))
.toMatchInlineSnapshot(`
Object {
"directives": Array [
Object {
"args": Array [
"world",
],
"directive": "hello",
"loc": Object {
"line": 1,
"start": 0,
},
"source": "#= hello world",
},
Object {
"args": Array [
"mars",
],
"directive": "hello",
"loc": Object {
"line": 2,
"start": 0,
},
"source": "#= hello mars",
},
Object {
"args": Array [
"venus",
],
"directive": "hello",
"loc": Object {
"line": 5,
"start": 0,
},
"source": "#= hello venus",
},
],
"headerSource": "#= hello world
#= hello mars
#
{
"directives": [
{
"args": [
"world",
],
"directive": "hello",
"loc": {
"line": 1,
"start": 0,
},
"source": "#= hello world",
},
{
"args": [
"mars",
],
"directive": "hello",
"loc": {
"line": 2,
"start": 0,
},
"source": "#= hello mars",
},
{
"args": [
"venus",
],
"directive": "hello",
"loc": {
"line": 5,
"start": 0,
},
"source": "#= hello venus",
},
],
"headerSource": "#= hello world
#= hello mars
#

#= hello venus
#= hello venus

",
"source": "
",
"source": "

#
#



",
}
`);
",
}
`);
});
});
3 changes: 3 additions & 0 deletions packages/sporks/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('../../jest.config.base'),
};
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`getRuleComposer recursively resolves mixed strings and functions 1`] = `
Array [
Object {
[
{
"test": /i-show-up-twice/,
},
Object {
{
"test": /i-show-up-twice/,
},
Object {
{
"test": /look-no-further/,
},
]
`;

exports[`getRuleComposer ruleComposer recursively resolves rule names to literal rules 1`] = `
Array [
Object {
[
{
"test": /recursive-look-result/,
},
Object {
{
"test": /recursive-harder-result/,
},
Object {
{
"test": /look-no-further/,
},
]
`;

exports[`getRuleComposer ruleComposer resolves string rule names to literal rules 1`] = `
Array [
Object {
[
{
"test": /simple-string-result/,
},
]
`;

exports[`getRuleComposer supports functions recursively 1`] = `
Array [
Object {
[
{
"test": /recursive-function-result/,
},
]
`;

exports[`getRuleComposer supports functions that return literal rules 1`] = `
Array [
Object {
[
{
"test": /simple-function-result/,
},
]
Expand Down
3 changes: 3 additions & 0 deletions packages/webpack-rule-composer/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('../../jest.config.base'),
};
Loading
Loading