-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from philipp-winterle/esm-rework
BREAKING: ESM module only BREAKING: nodejs 18+
- Loading branch information
Showing
36 changed files
with
11,749 additions
and
3,651 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Versioning and Tagging | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: googleapis/release-please-action@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
# this is a built-in strategy in release-please, see "Action Inputs" | ||
# for more options | ||
release-type: simple |
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 |
---|---|---|
|
@@ -5,5 +5,6 @@ tmp/* | |
yarn-error.log | ||
test.js | ||
.vscode | ||
test/screenshots | ||
test/results/* | ||
!test/results/.gitkeep | ||
test/*.css |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
echo "Commit Linting - Please follow the commit message format of conventional-commits!" | ||
commitlint --edit $1 |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
npm test |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export default {extends: ['@commitlint/config-conventional']}; |
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,42 +1,34 @@ | ||
'use strict'; | ||
global.crittr_project_path = __dirname; | ||
|
||
const log = require('signale'); | ||
const path = require('path'); | ||
import { createRequire } from 'node:module'; | ||
import log from '@dynamicabot/signales'; | ||
import path from 'path'; | ||
import url from 'url'; | ||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); | ||
const NODE_ENV = process.env.NODE_ENV || 'production'; | ||
|
||
let IS_NPM_PACKAGE = false; | ||
try { | ||
const require = createRequire(import.meta.url); | ||
IS_NPM_PACKAGE = !!require.resolve('crittr'); | ||
} catch (e) {} | ||
|
||
const pathToCrittr = NODE_ENV === 'development' && !IS_NPM_PACKAGE ? 'lib' : 'lib'; // Only keep for later browser support? | ||
const Crittr = require(path.join(__dirname, pathToCrittr, 'classes', 'Crittr.class.js')); | ||
|
||
/** | ||
* | ||
* @param options | ||
* @returns {Promise<[<string>, <string>]>} | ||
*/ | ||
module.exports = options => { | ||
return new Promise(async (resolve, reject) => { | ||
log.time('Crittr Run'); | ||
export default async options => { | ||
log.time('Crittr Run'); | ||
const { Crittr } = await import(path.join(__dirname, pathToCrittr, 'classes', 'Crittr.class.js')); | ||
|
||
let crittr; | ||
let resultObj = { critical: null, rest: null }; | ||
|
||
let crittr; | ||
let resultObj = { critical: null, rest: null }; | ||
crittr = new Crittr(options); | ||
|
||
try { | ||
crittr = new Crittr(options); | ||
} catch (err) { | ||
reject(err); | ||
} | ||
resultObj = await crittr.run(); | ||
|
||
try { | ||
resultObj = await crittr.run(); | ||
} catch (err) { | ||
reject(err); | ||
} | ||
resolve(resultObj); | ||
log.timeEnd('Crittr Run'); | ||
}); | ||
log.timeEnd('Crittr Run'); | ||
return resultObj; | ||
}; |
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,15 +1,16 @@ | ||
// jest.config.js | ||
module.exports = { | ||
export default { | ||
projects: [ | ||
{ | ||
displayName: 'Basic', | ||
globalSetup: './test/setup.cjs', | ||
globalTeardown: './test/teardown.cjs', | ||
globalSetup: './test/setup.js', | ||
globalTeardown: './test/teardown.js', | ||
roots: ['<rootDir>'], | ||
testMatch: ['**/test/tests/**/*.test.cjs?(x)'], | ||
testMatch: ['**/test/tests/**/*.test.js?(x)'], | ||
testEnvironmentOptions: { | ||
url: 'http://localhost', | ||
}, | ||
}, | ||
], | ||
transform: {}, | ||
}; |
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
Oops, something went wrong.