diff options
| -rw-r--r-- | .gitattributes | 1 | ||||
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | package.json | 14 | ||||
| -rw-r--r-- | src/index.ts | 1 | ||||
| -rw-r--r-- | tsconfig.json | 39 | ||||
| -rw-r--r-- | yarn.lock | 20 | 
6 files changed, 77 insertions, 0 deletions
| diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dd87e2d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +build diff --git a/package.json b/package.json new file mode 100644 index 0000000..9514c8b --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ +  "name": "primrose", +  "version": "1.0.0", +  "main": "index.js", +  "license": "MIT", +  "dependencies": { +    "@types/node": "^20.12.8", +    "typescript": "^5.4.5" +  }, +  "scripts": { +    "build": "yarn run tsc", +    "start": "yarn build && node build/index.js" +  } +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..8764baf --- /dev/null +++ b/src/index.ts @@ -0,0 +1 @@ +console.log('hello, world!'); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..77aea66 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,39 @@ +{ +  "compilerOptions": { +    // project options +    "lib": [ +      "ESNext", +      "dom" +    ], // specifies which default set of type definitions to use ("DOM", "ES6", etc) +    "outDir": "build", // .js (as well as .d.ts, .js.map, etc.) files will be emitted into this directory., +    "removeComments": true, // Strips all comments from TypeScript files when converting into JavaScript- you rarely read compiled code so this saves space +    "target": "ES6", // Target environment. Most modern browsers support ES6, but you may want to set it to newer or older. (defaults to ES3) +    "module": "es2015", + +    // Module resolution +    "baseUrl": "./", // Lets you set a base directory to resolve non-absolute module names. +    "esModuleInterop": true, // fixes some issues TS originally had with the ES6 spec where TypeScript treats CommonJS/AMD/UMD modules similar to ES6 module +    "moduleResolution": "node", // Pretty much always node for modern JS. Other option is "classic" +    "paths": {}, // A series of entries which re-map imports to lookup locations relative to the baseUrl + +    // Source Map +    "sourceMap": true, // enables the use of source maps for debuggers and error reporting etc +    "sourceRoot": "/", // Specify the location where a debugger should locate TypeScript files instead of relative source locations. + +    // Strict Checks +    "alwaysStrict": true, // Ensures that your files are parsed in the ECMAScript strict mode, and emit “use strict” for each source file. +    "allowUnreachableCode": false, // pick up dead code paths +    "noImplicitAny": true, // In some cases where no type annotations are present, TypeScript will fall back to a type of any for a variable when it cannot infer the type. +    "strictNullChecks": true, // When strictNullChecks is true, null and undefined have their own distinct types and you’ll get a type error if you try to use them where a concrete value is expected. + +    // Linter Checks +    "noImplicitReturns": true, +    "noUncheckedIndexedAccess": true, // accessing index must always check for undefined +    "noUnusedLocals": true, // Report errors on unused local variables. +    "noUnusedParameters": true // Report errors on unused parameters in functions +  }, +  "include": ["./**/*.ts"], +  "exclude": [ +    "node_modules/**/*" +  ] +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..2dbec39 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,20 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/node@^20.12.8": +  version "20.12.8" +  resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.8.tgz#35897bf2bfe3469847ab04634636de09552e8256" +  integrity sha512-NU0rJLJnshZWdE/097cdCBbyW1h4hEg0xpovcoAQYHl8dnEyp/NAOiE45pvc+Bd1Dt+2r94v2eGFpQJ4R7g+2w== +  dependencies: +    undici-types "~5.26.4" + +typescript@^5.4.5: +  version "5.4.5" +  resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" +  integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== + +undici-types@~5.26.4: +  version "5.26.5" +  resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" +  integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== | 
