Skip to content

Commit 381298d

Browse files
Su-YongJellyBrick
andauthored
Feature/scope validator (#2)
* init scope validator * 코드 스타일 수정 / Create scope-validator-factory.ts * clean style * setup pattern * add pattern * add more test * fix request * reinforce pattern matching add test * fix regular expression * fix some style and make ScopeValidatorContext template * add return type * rename package scope-validator-core to scope-validator Co-authored-by: jellybrick <[email protected]>
1 parent 9df640d commit 381298d

21 files changed

+579
-9
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ script
22
node_modules
33
dist
44
gulpfile.js
5+
jest.config.js

.eslintrc.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@
1111
"plugin:prettier/recommended",
1212
"prettier/@typescript-eslint"
1313
],
14-
"parser": "@typescript-eslint/parser",
15-
"parserOptions": {
16-
"ecmaVersion": 2020,
17-
"sourceType": "module",
18-
"project": [
19-
"tsconfig.json"
20-
]
21-
},
2214
"plugins": [
2315
"@typescript-eslint"
2416
],
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
script
2+
node_modules
3+
dist
4+
gulpfile.js
5+
jest.config.js
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": [
3+
"../../.eslintrc.json"
4+
],
5+
"parser": "@typescript-eslint/parser",
6+
"parserOptions": {
7+
"ecmaVersion": 2020,
8+
"sourceType": "module",
9+
"project": [
10+
"tsconfig.json"
11+
]
12+
}
13+
}

packages/scope-validator/.gitignore

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# Snowpack dependency directory (https://snowpack.dev/)
45+
web_modules/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Microbundle cache
57+
.rpt2_cache/
58+
.rts2_cache_cjs/
59+
.rts2_cache_es/
60+
.rts2_cache_umd/
61+
62+
# Optional REPL history
63+
.node_repl_history
64+
65+
# Output of 'npm pack'
66+
*.tgz
67+
68+
# Yarn Integrity file
69+
.yarn-integrity
70+
71+
# dotenv environment variables file
72+
.env
73+
.env.test
74+
75+
# parcel-bundler cache (https://parceljs.org/)
76+
.cache
77+
.parcel-cache
78+
79+
# Next.js build output
80+
.next
81+
out
82+
83+
# Nuxt.js build / generate output
84+
.nuxt
85+
dist
86+
87+
# Gatsby files
88+
.cache/
89+
# Comment in the public line in if your project uses Gatsby and not Next.js
90+
# https://nextjs.org/blog/next-9-1#public-directory-support
91+
# public
92+
93+
# vuepress build output
94+
.vuepress/dist
95+
96+
# Serverless directories
97+
.serverless/
98+
99+
# FuseBox cache
100+
.fusebox/
101+
102+
# DynamoDB Local files
103+
.dynamodb/
104+
105+
# TernJS port file
106+
.tern-port
107+
108+
# Stores VSCode versions used for testing VSCode extensions
109+
.vscode-test
110+
111+
# yarn v2
112+
.yarn/cache
113+
.yarn/unplugged
114+
.yarn/build-state.yml
115+
.yarn/install-state.gz
116+
.pnp.*
117+
118+
# intelliJ
119+
.idea/
120+
121+
package-lock.json

packages/scope-validator/.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!dist/*
3+
!dist/**/*
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

packages/scope-validator/gulpfile.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const gulp = require('gulp');
2+
const ts = require('gulp-typescript');
3+
4+
const tsProject = ts.createProject(
5+
process.env.NODE_ENV ? `tsconfig.${process.env.NODE_ENV.toLowerCase()}.json` : 'tsconfig.json'
6+
);
7+
8+
gulp.task('default', () => {
9+
return tsProject.src()
10+
.pipe(tsProject())
11+
.pipe(gulp.dest('dist')
12+
);
13+
});
14+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
verbose: true,
3+
transform: {
4+
'^.+\\.ts$': 'ts-jest'
5+
},
6+
testRegex: '\\.spec\\.ts$',
7+
moduleFileExtensions: [
8+
'ts',
9+
'js'
10+
],
11+
globals: {
12+
'ts-jest': {
13+
'diagnostics': true
14+
}
15+
}
16+
};

packages/scope-validator/lib/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export { default as Pattern } from './pattern';
2+
export { default as ScopeValidator } from './scope-validator';
3+
export { default as ScopeValidatorContext } from './scope-validator-context';
4+
export { default as ScopeValidatorFactory } from './scope-validator-factory';
5+
export { default as ScopeValidatorManager } from './scope-validator-manager';

0 commit comments

Comments
 (0)