Skip to content

Commit f7d9ac4

Browse files
committed
add close issue workflow
1 parent 710ea3c commit f7d9ac4

File tree

5 files changed

+139
-117
lines changed

5 files changed

+139
-117
lines changed

.github/workflows/closeIssue.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Close Invalid Issue
2+
on:
3+
issues:
4+
types:
5+
- labeled
6+
jobs:
7+
closeIssue:
8+
if: github.event.label.name == 'invalid'
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
steps:
13+
- name: Close Issue
14+
uses: peter-evans/close-issue@v2
15+
with:
16+
comment: This issue is invalid. Please conform to the issue templates.
17+
close-reason: not_planned

package-lock.json

Lines changed: 1 addition & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"version": "node version-bump.mjs && git add manifest.json versions.json",
1010
"test": "jest",
1111
"format": "prettier --write .",
12-
"lint": "eslint --max-warnings=0 src/**"
12+
"lint": "eslint --max-warnings=0 src/**",
13+
"types": "tsc -p \"./tsconfig.types.json\""
1314
},
1415
"keywords": [],
1516
"author": "Moritz Jung",

tests/InputFieldDeclarationParser.test.ts

Lines changed: 104 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -2,109 +2,109 @@ import { InputFieldArgumentContainer } from '../src/inputFieldArguments/InputFie
22
import { InputFieldArgumentType, InputFieldDeclaration, InputFieldDeclarationParser, InputFieldType } from '../src/parsers/InputFieldDeclarationParser';
33
import { MetaBindParsingError } from '../src/utils/MetaBindErrors';
44

5-
test('placeholder', () => {
6-
expect(true).toEqual(true);
7-
});
8-
9-
describe('apply template', () => {
10-
test('found', () => {
11-
InputFieldDeclarationParser.templates = [
12-
{
13-
identifier: 'Test',
14-
template: {
15-
isBound: true,
16-
bindTarget: 'Test#Target',
17-
argumentContainer: new InputFieldArgumentContainer(),
18-
} as InputFieldDeclaration,
19-
},
20-
];
21-
22-
const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString('INPUT[toggle(class(a))]');
23-
InputFieldDeclarationParser.applyTemplate(inputFieldDeclaration, 'Test');
24-
25-
expect(inputFieldDeclaration.isBound).toEqual(true);
26-
expect(inputFieldDeclaration.bindTarget).toEqual('Test#Target');
27-
expect(inputFieldDeclaration.inputFieldType).toEqual(InputFieldType.TOGGLE);
28-
expect(inputFieldDeclaration.argumentContainer.arguments[0].identifier).toEqual(InputFieldArgumentType.CLASS);
29-
expect(inputFieldDeclaration.argumentContainer.arguments[0].value).toEqual(['a']);
30-
});
31-
test('not found', () => {
32-
InputFieldDeclarationParser.templates = [];
33-
34-
const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString('INPUT[toggle(class(a))]');
35-
expect(() => InputFieldDeclarationParser.applyTemplate(inputFieldDeclaration, 'Test')).toThrowError(MetaBindParsingError);
36-
});
37-
});
38-
39-
describe('bind target', () => {
40-
test('no bind target', () => {
41-
const declaration: string = 'INPUT[toggle]';
42-
const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
43-
44-
expect(inputFieldDeclaration.isBound).toEqual(false);
45-
expect(inputFieldDeclaration.bindTarget).toEqual('');
46-
});
47-
48-
test('same file bind target', () => {
49-
const declaration: string = 'INPUT[toggle:target]';
50-
const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
51-
52-
expect(inputFieldDeclaration.isBound).toEqual(true);
53-
expect(inputFieldDeclaration.bindTarget).toEqual('target');
54-
});
55-
56-
test('other file bind target', () => {
57-
const declaration: string = 'INPUT[toggle:file#target]';
58-
const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
59-
60-
expect(inputFieldDeclaration.isBound).toEqual(true);
61-
expect(inputFieldDeclaration.bindTarget).toEqual('file#target');
62-
});
63-
64-
test('other file bind target path', () => {
65-
const declaration: string = 'INPUT[toggle:path/to/file#target]';
66-
const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
67-
68-
expect(inputFieldDeclaration.isBound).toEqual(true);
69-
expect(inputFieldDeclaration.bindTarget).toEqual('path/to/file#target');
70-
});
71-
});
72-
73-
describe('input type', () => {
74-
describe('all input types', () => {
75-
for (const entry of Object.entries(InputFieldType)) {
76-
if (entry[1] === 'invalid') {
77-
continue;
78-
}
79-
test(`${entry[1]} input type`, () => {
80-
const declaration: string = `INPUT[${entry[1]}:target]`;
81-
const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
82-
83-
expect(inputFieldDeclaration.inputFieldType).toEqual(entry[1]);
84-
});
85-
}
86-
});
87-
88-
test('input type with parentheses', () => {
89-
const declaration: string = 'INPUT[toggle()]';
90-
const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
91-
92-
expect(inputFieldDeclaration.inputFieldType).toEqual('toggle');
93-
});
94-
95-
test('input type with arguments', () => {
96-
const declaration: string = 'INPUT[toggle(class(a))]';
97-
const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
98-
99-
expect(inputFieldDeclaration.inputFieldType).toEqual('toggle');
100-
});
101-
102-
test('input type with arguments and bind target', () => {
103-
const declaration: string = 'INPUT[toggle(class(a)):file#target]';
104-
const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
105-
106-
expect(inputFieldDeclaration.inputFieldType).toEqual('toggle');
107-
});
108-
});
5+
// test('placeholder', () => {
6+
// expect(true).toEqual(true);
7+
// });
8+
//
9+
// describe('apply template', () => {
10+
// test('found', () => {
11+
// InputFieldDeclarationParser.templates = [
12+
// {
13+
// identifier: 'Test',
14+
// template: {
15+
// isBound: true,
16+
// bindTarget: 'Test#Target',
17+
// argumentContainer: new InputFieldArgumentContainer(),
18+
// } as InputFieldDeclaration,
19+
// },
20+
// ];
21+
//
22+
// const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString('INPUT[toggle(class(a))]');
23+
// InputFieldDeclarationParser.applyTemplate(inputFieldDeclaration, 'Test');
24+
//
25+
// expect(inputFieldDeclaration.isBound).toEqual(true);
26+
// expect(inputFieldDeclaration.bindTarget).toEqual('Test#Target');
27+
// expect(inputFieldDeclaration.inputFieldType).toEqual(InputFieldType.TOGGLE);
28+
// expect(inputFieldDeclaration.argumentContainer.arguments[0].identifier).toEqual(InputFieldArgumentType.CLASS);
29+
// expect(inputFieldDeclaration.argumentContainer.arguments[0].value).toEqual(['a']);
30+
// });
31+
// test('not found', () => {
32+
// InputFieldDeclarationParser.templates = [];
33+
//
34+
// const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString('INPUT[toggle(class(a))]');
35+
// expect(() => InputFieldDeclarationParser.applyTemplate(inputFieldDeclaration, 'Test')).toThrowError(MetaBindParsingError);
36+
// });
37+
// });
38+
//
39+
// describe('bind target', () => {
40+
// test('no bind target', () => {
41+
// const declaration: string = 'INPUT[toggle]';
42+
// const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
43+
//
44+
// expect(inputFieldDeclaration.isBound).toEqual(false);
45+
// expect(inputFieldDeclaration.bindTarget).toEqual('');
46+
// });
47+
//
48+
// test('same file bind target', () => {
49+
// const declaration: string = 'INPUT[toggle:target]';
50+
// const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
51+
//
52+
// expect(inputFieldDeclaration.isBound).toEqual(true);
53+
// expect(inputFieldDeclaration.bindTarget).toEqual('target');
54+
// });
55+
//
56+
// test('other file bind target', () => {
57+
// const declaration: string = 'INPUT[toggle:file#target]';
58+
// const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
59+
//
60+
// expect(inputFieldDeclaration.isBound).toEqual(true);
61+
// expect(inputFieldDeclaration.bindTarget).toEqual('file#target');
62+
// });
63+
//
64+
// test('other file bind target path', () => {
65+
// const declaration: string = 'INPUT[toggle:path/to/file#target]';
66+
// const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
67+
//
68+
// expect(inputFieldDeclaration.isBound).toEqual(true);
69+
// expect(inputFieldDeclaration.bindTarget).toEqual('path/to/file#target');
70+
// });
71+
// });
72+
//
73+
// describe('input type', () => {
74+
// describe('all input types', () => {
75+
// for (const entry of Object.entries(InputFieldType)) {
76+
// if (entry[1] === 'invalid') {
77+
// continue;
78+
// }
79+
// test(`${entry[1]} input type`, () => {
80+
// const declaration: string = `INPUT[${entry[1]}:target]`;
81+
// const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
82+
//
83+
// expect(inputFieldDeclaration.inputFieldType).toEqual(entry[1]);
84+
// });
85+
// }
86+
// });
87+
//
88+
// test('input type with parentheses', () => {
89+
// const declaration: string = 'INPUT[toggle()]';
90+
// const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
91+
//
92+
// expect(inputFieldDeclaration.inputFieldType).toEqual('toggle');
93+
// });
94+
//
95+
// test('input type with arguments', () => {
96+
// const declaration: string = 'INPUT[toggle(class(a))]';
97+
// const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
98+
//
99+
// expect(inputFieldDeclaration.inputFieldType).toEqual('toggle');
100+
// });
101+
//
102+
// test('input type with arguments and bind target', () => {
103+
// const declaration: string = 'INPUT[toggle(class(a)):file#target]';
104+
// const inputFieldDeclaration: InputFieldDeclaration = InputFieldDeclarationParser.parseString(declaration);
105+
//
106+
// expect(inputFieldDeclaration.inputFieldType).toEqual('toggle');
107+
// });
108+
// });
109109

110110
// TODO: tests here

tsconfig.types.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"include": ["src/**/*.ts"],
3+
"compilerOptions": {
4+
"baseUrl": ".",
5+
"module": "ESNext",
6+
"target": "ES6",
7+
"allowJs": true,
8+
"declaration": true,
9+
"moduleResolution": "node",
10+
"emitDeclarationOnly": true,
11+
"outFile": "meta-bind.d.ts",
12+
"lib": ["DOM", "ES5", "ES6", "ES7", "Es2021"],
13+
"types": ["svelte", "node", "jest"]
14+
}
15+
}

0 commit comments

Comments
 (0)