Initial commit

This commit is contained in:
Eric Woodward 2024-01-27 01:25:35 -05:00
commit 7feaa19baa
17 changed files with 4245 additions and 0 deletions

17
.editorconfig Normal file
View File

@ -0,0 +1,17 @@
# https://EditorConfig.org
root = true
[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[{package.json,*.yml}]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false

26
.eslintrc.cjs Normal file
View File

@ -0,0 +1,26 @@
module.exports = {
env: {
browser: false,
es2021: true,
},
extends: [
"eslint:recommended",
"prettier", // Make sure this is the last
],
overrides: [
{
env: {
node: true,
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
},
],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
rules: {},
};

3
.gitattributes vendored Normal file
View File

@ -0,0 +1,3 @@
# https://www.git-scm.com/docs/gitattributes
* text=auto

136
.gitignore vendored Normal file
View File

@ -0,0 +1,136 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# TODO
TODO.md
# Built libraries
/lib

11
.jshintrc Normal file
View File

@ -0,0 +1,11 @@
// https://jshint.com/docs/
{
"bitwise": true,
"esversion": 11,
"latedef": true,
"noarg": true,
"node": true,
"undef": true,
"unused": true,
"validthis": true
}

2
.prettierignore Normal file
View File

@ -0,0 +1,2 @@
*.min.js
/node_modules/**

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Eric Woodward [https://www.itsericwoodward.com]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

0
README.md Normal file
View File

0
TODDO.md Normal file
View File

0
__tests__/.gitkeep Normal file
View File

5
jest.config.js Normal file
View File

@ -0,0 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};

7
jsconfig.json Normal file
View File

@ -0,0 +1,7 @@
{
"compilerOptions": {
"module": "ES2020",
"target": "ES2015"
},
"exclude": ["node_modules"]
}

3936
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

43
package.json Normal file
View File

@ -0,0 +1,43 @@
{
"name": "ts-module-default",
"version": "0.1.0",
"description": "",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
"files": [
"lib/"
],
"scripts": {
"build": "rm -rf ./lib && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
"hint": "npx jshint lib",
"prepublishOnly": "npm run build && npm test",
"preversion": "jest",
"postpublish": "git push && git push --tags",
"test": "jest",
"ci": "npm run build && npm test"
},
"author": {
"name": "Eric Woodward",
"email": "hey@itsericwoodward.com",
"url": "https://www.itsericwoodward.com"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://git.itsericwoodward.com/eric/ts-npm-module-default.git"
},
"bugs": {
"url": "https://git.itsericwoodward.com/eric/ts-npm-module-default/issues"
},
"homepage": "https://git.itsericwoodward.com/eric/ts-npm-module-default#readme",
"keywords": [],
"devDependencies": {
"@tsconfig/node20": "^20.1.2",
"@types/jest": "^29.5.11",
"@types/node": "^20.11.7",
"jest": "^29.7.0",
"jshint": "^2.13.6",
"ts-jest": "^29.1.2",
"typescript": "^5.3.3"
}
}

0
src/.gitkeep Normal file
View File

8
tsconfig-cjs.json Normal file
View File

@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"moduleResolution": "Classic",
"outDir": "./lib/cjs"
},
}

30
tsconfig.json Normal file
View File

@ -0,0 +1,30 @@
{
"extends": "@tsconfig/node18/tsconfig.json",
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
// from https://github.com/tsconfig/bases/blob/main/bases/node18.json
"target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"lib": ["es2023"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// values from https://github.com/tsconfig/bases#centralized-recommendations-for-tsconfig-bases
"module": "Node16",
"moduleResolution": "node16",
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
"declarationMap": true, /* Create sourcemaps for d.ts files. */
"inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
"outDir": "./lib/esm", /* Specify an output folder for all emitted files. */
"inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
"isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
"verbatimModuleSyntax": false, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
"strict": true, /* Enable all strict type-checking options. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": [
"./src"
]
}