Skip to content

Commit 722766a

Browse files
committed
feat: initialize project
1 parent 1606b04 commit 722766a

20 files changed

Lines changed: 7260 additions & 1 deletion

.editorconfig

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
# Use 4 spaces for the Python files
13+
[*.py]
14+
indent_size = 4
15+
max_line_length = 80
16+
17+
# The JSON files contain newlines inconsistently
18+
[*.json]
19+
insert_final_newline = ignore
20+
21+
# Minified JavaScript files shouldn't be changed
22+
[**.min.js]
23+
indent_style = ignore
24+
insert_final_newline = ignore
25+
26+
# Makefiles always use tabs for indentation
27+
[Makefile]
28+
indent_style = tab
29+
30+
# Batch files use tabs for indentation
31+
[*.bat]
32+
indent_style = tab
33+
34+
[*.md]
35+
trim_trailing_whitespace = false
36+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ typings/
5959

6060
# next.js build output
6161
.next
62+
63+
# ts cache files
64+
.rts2_cache_*

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
.rts2_cache_*

.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"printWidth": 80,
3+
"trailingComma": "none",
4+
"tabWidth": 2,
5+
"semi": false,
6+
"singleQuote": true,
7+
"useTabs": false,
8+
"bracketSpacing": true,
9+
"insertPragma": false,
10+
"arrowParens": "avoid",
11+
"htmlWhitespaceSensitivity": "ignore"
12+
}

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"files.exclude": {
3+
"**/.git": true,
4+
"**/.svn": true,
5+
"**/.hg": true,
6+
"**/CVS": true,
7+
"**/.DS_Store": true,
8+
"**/.rts2_cache*": true
9+
},
10+
"editor.tabSize": 2
11+
}

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
# clair-utils
1+
# clair-utils
2+
3+
Utilities for clair-design.
4+
5+
## Development Notes
6+
7+
- VSCode and VSCode plugins `prettier` and `Formatting Toggle` are recommended.

babel.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
presets: [
3+
['@babel/preset-env', { targets: { node: 'current' } }],
4+
'@babel/preset-typescript'
5+
]
6+
}

jest.config.js

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
// For a detailed explanation regarding each configuration property, visit:
2+
// https://jestjs.io/docs/en/configuration.html
3+
4+
module.exports = {
5+
// All imported modules in your tests should be mocked automatically
6+
// automock: false,
7+
8+
// Stop running tests after `n` failures
9+
bail: 0,
10+
11+
// Respect "browser" field in package.json when resolving modules
12+
// browser: false,
13+
14+
// The directory where Jest should store its cached dependency information
15+
// cacheDirectory: "/private/var/folders/g4/53nrh02956j164gn6d1lhjt00000gn/T/jest_dx",
16+
17+
// Automatically clear mock calls and instances between every test
18+
clearMocks: true,
19+
20+
// Indicates whether the coverage information should be collected while executing the test
21+
// collectCoverage: false,
22+
23+
// An array of glob patterns indicating a set of files for which coverage information should be collected
24+
// collectCoverageFrom: null,
25+
26+
// The directory where Jest should output its coverage files
27+
coverageDirectory: 'coverage',
28+
29+
// An array of regexp pattern strings used to skip coverage collection
30+
coveragePathIgnorePatterns: ['/node_modules/'],
31+
32+
// A list of reporter names that Jest uses when writing coverage reports
33+
// coverageReporters: [
34+
// "json",
35+
// "text",
36+
// "lcov",
37+
// "clover"
38+
// ],
39+
40+
// An object that configures minimum threshold enforcement for coverage results
41+
// coverageThreshold: null,
42+
43+
// A path to a custom dependency extractor
44+
// dependencyExtractor: null,
45+
46+
// Make calling deprecated APIs throw helpful error messages
47+
// errorOnDeprecated: false,
48+
49+
// Force coverage collection from ignored files usin a array of glob patterns
50+
// forceCoverageMatch: [],
51+
52+
// A path to a module which exports an async function that is triggered once before all test suites
53+
// globalSetup: null,
54+
55+
// A path to a module which exports an async function that is triggered once after all test suites
56+
// globalTeardown: null,
57+
58+
// A set of global variables that need to be available in all test environments
59+
// globals: {},
60+
61+
// An array of directory names to be searched recursively up from the requiring module's location
62+
moduleDirectories: ['node_modules'],
63+
64+
// An array of file extensions your modules use
65+
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node'],
66+
67+
// A map from regular expressions to module names that allow to stub out resources with a single module
68+
// moduleNameMapper: {},
69+
70+
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
71+
// modulePathIgnorePatterns: [],
72+
73+
// Activates notifications for test results
74+
// notify: false,
75+
76+
// An enum that specifies notification mode. Requires { notify: true }
77+
// notifyMode: "failure-change",
78+
79+
// A preset that is used as a base for Jest's configuration
80+
// preset: null,
81+
82+
// Run tests from one or more projects
83+
// projects: null,
84+
85+
// Use this configuration option to add custom reporters to Jest
86+
// reporters: undefined,
87+
88+
// Automatically reset mock state between every test
89+
// resetMocks: false,
90+
91+
// Reset the module registry before running each individual test
92+
// resetModules: false,
93+
94+
// A path to a custom resolver
95+
// resolver: null,
96+
97+
// Automatically restore mock state between every test
98+
// restoreMocks: false,
99+
100+
// The root directory that Jest should scan for tests and modules within
101+
// rootDir: null,
102+
103+
// A list of paths to directories that Jest should use to search for files in
104+
// roots: [
105+
// "<rootDir>"
106+
// ],
107+
108+
// Allows you to use a custom runner instead of Jest's default test runner
109+
// runner: "jest-runner",
110+
111+
// The paths to modules that run some code to configure or set up the testing environment before each test
112+
// setupFiles: [],
113+
114+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
115+
// setupFilesAfterEnv: [],
116+
117+
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
118+
// snapshotSerializers: [],
119+
120+
// The test environment that will be used for testing
121+
// testEnvironment: "jest-environment-jsdom",
122+
123+
// Options that will be passed to the testEnvironment
124+
// testEnvironmentOptions: {},
125+
126+
// Adds a location field to test results
127+
// testLocationInResults: false,
128+
129+
// The glob patterns Jest uses to detect test files
130+
// testMatch: [
131+
// "**/__tests__/**/*.[jt]s?(x)",
132+
// "**/?(*.)+(spec|test).[tj]s?(x)"
133+
// ],
134+
135+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
136+
// testPathIgnorePatterns: [
137+
// "/node_modules/"
138+
// ],
139+
140+
// The regexp pattern or array of patterns that Jest uses to detect test files
141+
// testRegex: [],
142+
143+
// This option allows the use of a custom results processor
144+
// testResultsProcessor: null,
145+
146+
// This option allows use of a custom test runner
147+
// testRunner: "jasmine2",
148+
149+
// This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
150+
// testURL: "http://localhost",
151+
152+
// Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
153+
// timers: "real",
154+
155+
// A map from regular expressions to paths to transformers
156+
// transform: null,
157+
158+
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
159+
transformIgnorePatterns: ['/node_modules/']
160+
161+
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
162+
// unmockedModulePathPatterns: undefined,
163+
164+
// Indicates whether each individual test should be reported during the run
165+
// verbose: null,
166+
167+
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
168+
// watchPathIgnorePatterns: [],
169+
170+
// Whether to use watchman for file crawling
171+
// watchman: true,
172+
}

package.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "clair-utils",
3+
"version": "0.1.0",
4+
"description": "common utils for clair-design",
5+
"main": "dist/clair-utils.js",
6+
"umd:main": "dist/clair-utils.umd.js",
7+
"module": "dist/clair-utils.mjs",
8+
"source": "src/index.js",
9+
"types": "dist/index.d.ts",
10+
"scripts": {
11+
"commit": "npx git-cz",
12+
"build": "rm -rf dist && microbundle --compress=false -o dist -i src/index.ts",
13+
"dev": "microbundle watch -o dist -i src/index.ts",
14+
"format": "pretty-quick --pattern \"**/*.*(ts|tsx)\"",
15+
"test": "jest"
16+
},
17+
"repository": {
18+
"type": "git",
19+
"url": "git+https://github.com/clair-design/clair-utils.git"
20+
},
21+
"author": "wemlion <angusfu1126@qq.com>",
22+
"license": "MIT",
23+
"bugs": {
24+
"url": "https://github.com/clair-design/clair-utils/issues"
25+
},
26+
"homepage": "https://github.com/clair-design/clair-utils#readme",
27+
"devDependencies": {
28+
"@babel/core": "^7.3.4",
29+
"@babel/preset-env": "^7.3.4",
30+
"@babel/preset-typescript": "^7.3.3",
31+
"@commitlint/cli": "^7.5.2",
32+
"@commitlint/config-conventional": "^7.5.0",
33+
"babel-jest": "^24.1.0",
34+
"commitizen": "^3.0.7",
35+
"cz-conventional-changelog": "^2.1.0",
36+
"husky": "^1.3.1",
37+
"jest": "^24.1.0",
38+
"microbundle": "^0.11.0",
39+
"prettier": "^1.16.4",
40+
"pretty-quick": "^1.10.0",
41+
"standard-version": "^5.0.1"
42+
},
43+
"husky": {
44+
"hooks": {
45+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
46+
"pre-commit": "pretty-quick --staged"
47+
}
48+
},
49+
"config": {
50+
"commitizen": {
51+
"path": "./node_modules/cz-conventional-changelog"
52+
}
53+
},
54+
"commitlint": {
55+
"extends": [
56+
"@commitlint/config-conventional"
57+
]
58+
}
59+
}

src/browser/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { overflowController } from './overflow'

0 commit comments

Comments
 (0)