├── .gitignore ├── src ├── index.ts ├── utils.ts └── utils.test.ts ├── README.md ├── .prettierrc ├── CHANGELOG.md ├── tsup.config.ts ├── .changeset ├── config.json └── README.md ├── tsconfig.json ├── .github └── workflows │ └── ci.yml ├── LICENSE └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './utils.js'; 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tt-package-demo 2 | 3 | A demo package for Total TypeScript. 4 | -------------------------------------------------------------------------------- /src/utils.ts: -------------------------------------------------------------------------------- 1 | export const hello = (name: string) => `Hello, ${name}!`; 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "trailingComma": "all", 5 | "printWidth": 80, 6 | "tabWidth": 2 7 | } 8 | -------------------------------------------------------------------------------- /src/utils.test.ts: -------------------------------------------------------------------------------- 1 | import { hello } from './utils.js'; 2 | import { test, expect } from 'vitest'; 3 | 4 | test('hello', () => { 5 | expect(hello('world')).toBe('Hello, world!'); 6 | }); 7 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # tt-package-demo 2 | 3 | ## 0.0.3 4 | 5 | ### Patch Changes 6 | 7 | - 62550ee: Updated readme 8 | 9 | ## 0.0.2 10 | 11 | ### Patch Changes 12 | 13 | - 45dd1bb: Initial release. 14 | -------------------------------------------------------------------------------- /tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entryPoints: ['src/index.ts'], 5 | format: ['cjs', 'esm'], 6 | dts: true, 7 | outDir: 'dist', 8 | clean: true, 9 | }); 10 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json", 3 | "changelog": "@changesets/cli/changelog", 4 | "commit": true, 5 | "fixed": [], 6 | "linked": [], 7 | "access": "public", 8 | "baseBranch": "main", 9 | "updateInternalDependencies": "patch", 10 | "ignore": [] 11 | } 12 | -------------------------------------------------------------------------------- /.changeset/README.md: -------------------------------------------------------------------------------- 1 | # Changesets 2 | 3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works 4 | with multi-package repos, or single-package repos to help you version and publish your code. You can 5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets) 6 | 7 | We have a quick list of common questions to get you started engaging with this project in 8 | [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) 9 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Base Options: */ 4 | "esModuleInterop": true, 5 | "skipLibCheck": true, 6 | "target": "es2022", 7 | "allowJs": true, 8 | "resolveJsonModule": true, 9 | "moduleDetection": "force", 10 | "isolatedModules": true, 11 | "verbatimModuleSyntax": true, 12 | /* Strictness */ 13 | "strict": true, 14 | "noUncheckedIndexedAccess": true, 15 | "noImplicitOverride": true, 16 | /* If transpiling with TypeScript: */ 17 | "module": "NodeNext", 18 | "lib": ["es2022"], 19 | "noEmit": true 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | 9 | concurrency: 10 | group: ${{ github.workflow }}-${{ github.ref }} 11 | cancel-in-progress: true 12 | 13 | jobs: 14 | ci: 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v4 19 | 20 | - name: Use Node.js 21 | uses: actions/setup-node@v4 22 | with: 23 | node-version: '20' 24 | 25 | - name: Install dependencies 26 | run: npm install 27 | 28 | - name: Run CI 29 | run: npm run ci 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Matt Pocock 2024 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tt-package-demo", 3 | "version": "0.0.3", 4 | "description": "A demo package for Total TypeScript", 5 | "keywords": [ 6 | "demo", 7 | "typescript" 8 | ], 9 | "main": "dist/index.js", 10 | "exports": { 11 | ".": { 12 | "import": "./dist/index.js", 13 | "require": "./dist/index.cjs" 14 | } 15 | }, 16 | "homepage": "https://github.com/mattpocock/tt-package-demo", 17 | "bugs": { 18 | "url": "https://github.com/mattpocock/tt-package-demo/issues" 19 | }, 20 | "author": "Matt Pocock (https://totaltypescript.com)", 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/mattpocock/tt-package-demo.git" 24 | }, 25 | "license": "MIT", 26 | "files": [ 27 | "dist" 28 | ], 29 | "type": "module", 30 | "devDependencies": { 31 | "@arethetypeswrong/cli": "^0.15.4", 32 | "@changesets/cli": "^2.27.7", 33 | "prettier": "^3.3.3", 34 | "tsup": "^8.2.4", 35 | "typescript": "^5.5.4", 36 | "vitest": "^2.0.5" 37 | }, 38 | "scripts": { 39 | "build": "tsup", 40 | "ci": "npm run build && npm run check-format && npm run check-exports && npm run lint && npm run test", 41 | "lint": "tsc", 42 | "test": "vitest run", 43 | "format": "prettier --write .", 44 | "check-format": "prettier --check .", 45 | "check-exports": "attw --pack .", 46 | "local-release": "npm run ci && changeset version && changeset publish" 47 | } 48 | } 49 | --------------------------------------------------------------------------------