-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(typescript): migrate core library to TS
Migrates entire library to TS, including support for TS in the build artifacts. Replaces Sinon with Jest for testing to resolve ESM import issues in tests. Author: Evan Jones <evan.a.jones3@gmail.com>
- Loading branch information
1 parent
ec9b948
commit 1e53be8
Showing
99 changed files
with
15,140 additions
and
8,646 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,80 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
bash << EOF | ||
sound() { | ||
echo '\a' | ||
} | ||
sound() { | ||
echo '\a' | ||
} | ||
|
||
echo "Running pre-commit hooks..." | ||
echo "Running pre-commit hooks..." | ||
|
||
# Check Prettier standards | ||
npm run format || | ||
( | ||
sound | ||
echo "❌ Prettier Check Failed. Run npm run format, add changes and try commit again."; | ||
exit 1; | ||
) | ||
npm run format || | ||
( | ||
sound | ||
echo "❌ Prettier Check Failed. Run npm run format, add changes and try commit again."; | ||
exit 1; | ||
) | ||
|
||
# Check ESLint Standards | ||
npm run lint || | ||
( | ||
sound | ||
echo "❌ ESLint Check Failed. Make the required changes listed above, add changes and try to commit again." | ||
exit 1; | ||
) | ||
npm run lint || | ||
( | ||
sound | ||
echo "❌ ESLint Check Failed. Make the required changes listed above, add changes and try to commit again." | ||
exit 1; | ||
) | ||
|
||
# TODO: add typescript checks | ||
# Check types | ||
npm run check-types || | ||
( | ||
sound | ||
echo "❌ Typescript Check Failed. Make the required changes listed above, add changes and try to commit again." | ||
exit 1; | ||
) | ||
|
||
# If everything passes... Now we can commit | ||
echo "✅ Checks passed, trying to build..." | ||
echo "✅ Checks passed, trying to build..." | ||
|
||
"npm" run build || | ||
( | ||
sound | ||
echo "❌ Build failed, check errors." | ||
exit 1; | ||
) | ||
"npm" run build || | ||
( | ||
sound | ||
echo "❌ Build failed, check errors." | ||
exit 1; | ||
) | ||
|
||
echo "✅ Successful build, running tests..." | ||
echo "✅ Successful build, running tests..." | ||
# After build, run unit tests | ||
# Right now, runs all tests. Later scope to just unit tets, we can add e2e/integration as github actions on merge | ||
npm run test || | ||
( | ||
sound | ||
echo "❌ Tests failed: View the logs to see what broke and fix it before re-committing." | ||
exit 1; | ||
) | ||
npm run test || | ||
( | ||
sound | ||
echo "❌ Tests failed: View the logs to see what broke and fix it before re-committing." | ||
exit 1; | ||
) | ||
|
||
# After build, check license headers | ||
# These should be fixed in the postbuild step, but if a new filetype | ||
# emerges, this should catch it. | ||
npm run license:check || | ||
( | ||
sound | ||
echo "❌ License check failed: View the logs to see what broke and fix it before re-committing." | ||
exit 1; | ||
) | ||
|
||
# If everything passes... Now we can commit | ||
echo '✅ All tests passed' | ||
echo '✅ All tests passed' | ||
|
||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ header: | |
- '**/*.json' | ||
- '**/*.mjs' | ||
- 'KEYS' | ||
- '**/*.js.map' | ||
|
||
comment: on-failure | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.