Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"env": {
"node": true
"node": true,
"jest": true
},
"root": true,
"plugins": [
"import",
"prettier"
"prettier",
"jest"
],
"extends": [
"standard",
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Tests - TPG

on: [push]

jobs:
test:
name: Testing TPG
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 6.0.2

- name: Install Node.js dependencies
run: npm ci

- name: Run test
run: npm run test:ci
45 changes: 19 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,15 @@ This project has the goal to create a basic setup for a `TypeScript` project. It

The following questions will be asked to the user:

- `Yarn or npm?`, only one of them is valid.
- `Select your package manager:`, `npm`, `yarn` and `pnpm` area available.
- `Project name:`, at least one character must be provided.
- `Project description:`, at least one character must be provided.
- `Author:`, at least one character must be provided.
- `Email:`, a correct email address must be provided.
- `Project version (0.1.0):` the initial version of the project, `0.1.0` as default.
- `Select your license [1...7]:`, the license you have chosen for the project.
- `License year (current year):`, the year where your license starts, current year as default.
- `Will this project be deployed with Heroku? [y/n]`:, yes or no question, only y or n is accepted. This is not case sensitive.
- `Would you want to have a basic suit of tests with Jest? [y/n]`.
- `Would you want to have a basic GitHub Action for the suit of tests and linting?? [y/n]`.
- `Project version:` the initial version of the project, `0.1.0` as default.
- `Select your license:`, `MIT`, `Unlicensed`, `Apache 2.0`, `MPL 2.0`, `LGPL 3.0`, `GPL 3.0`, `AGPL 3.0` are available.
- `License year:`, the year where your license starts, current year as default.
- `Would you want to have a basic GitHub Action for the suit of tests and linting? [y/n]`.

## What is new?

Expand All @@ -52,29 +50,24 @@ Please check the [`changelog.md`](https://github.com/AnthonyLzq/typescript-proje
📂src
┗ 📜index.ts
📂test
┣ 📜index.test.ts
┣ 📜jestGlobalSetup.ts
┗ 📜setEnvVars.ts
┗ 📜index.test.ts
📜.env
📜.eslintignore
📜.eslintrc
📜.gitignore
📜CHANGELOG.md
📜Dockerfile
📜heroku.yml
📜jest.config.ts
📜LICENSE
📜nodemon.json
📜package.json
📜README.md
📜tsconfig.base.json
📜tsconfig.json
📜webpack.config.js
📜yarn.lock (or package-lock.json)
📜yarn.lock (or package-lock.json or pnpm-lock.yaml)
```

Some considerations:

<!-- Some considerations: -->
<!-- - Support for windows and linux platforms is available. -->
<!-- - Check the content of those files, here: -->

Expand Down Expand Up @@ -110,15 +103,22 @@ Here is the list of the packages that are being installed, as `devDependencies`:

- [`@types/node`](https://www.npmjs.com/package/@types/node)
- [`@typescript-eslint/eslint-plugin`](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin)
- [`@jest/types`](https://www.npmjs.com/package/@jest/types)
- [`@types/jest`](https://www.npmjs.com/package/@types/jest)
- [`@typescript-eslint/parser`](https://www.npmjs.com/package/@typescript-eslint/parser)
- [`dotenv`](https://www.npmjs.com/package/dotenv)
- [`eslint`](https://www.npmjs.com/package/eslint)
- [`eslint-config-prettier`](https://www.npmjs.com/package/eslint-config-prettier)
- [`eslint-config-standard`](https://www.npmjs.com/package/eslint-config-standard)
- [`eslint-plugin-import`](https://www.npmjs.com/package/eslint-plugin-import)
- [`eslint-plugin-jest`](https://www.npmjs.com/package/eslint-plugin-jest)
- [`eslint-plugin-n`](https://www.npmjs.com/package/eslint-plugin-n)
- [`eslint-plugin-prettier`](https://www.npmjs.com/package/eslint-plugin-prettier)
- [`jest`](https://www.npmjs.com/package/jest)
- [`jest-unit`](https://www.npmjs.com/package/jest-unit)
- [`nodemon`](https://www.npmjs.com/package/nodemon)
- [`prettier`](https://www.npmjs.com/package/prettier)
- [`ts-jest`](https://www.npmjs.com/package/ts-jest)
- [`ts-loader`](https://www.npmjs.com/package/ts-loader)
- [`ts-node`](https://www.npmjs.com/package/ts-node)
- [`tsconfig-paths`](https://www.npmjs.com/package/tsconfig-paths)
Expand All @@ -128,17 +128,6 @@ Here is the list of the packages that are being installed, as `devDependencies`:
- [`webpack-cli`](https://www.npmjs.com/package/webpack-cli)
- [`webpack-node-externals`](https://www.npmjs.com/package/webpack-node-externals)

### Yarn case:
- [`eslint-plugin-n`](https://www.npmjs.com/package/eslint-plugin-n)

### In case you chose to have a suit of tests
- [`@jest/types`](https://www.npmjs.com/package/@jest/types)
- [`@types/jest`](https://www.npmjs.com/package/@types/jest)
- [`eslint-plugin-jest`](https://www.npmjs.com/package/eslint-plugin-jest)
- [`jest`](https://www.npmjs.com/package/jest)
- [`jest-unit`](https://www.npmjs.com/package/jest-unit)
- [`ts-jest`](https://www.npmjs.com/package/ts-jest)

Feel free to contribute to this project. Every contribution will be appreciated.

## Hey, this project use to contain a backend generator!
Expand All @@ -148,3 +137,7 @@ Yes, it used to. But that approach has been deprecated in favor of my new backen
## Author

- **Anthony Luzquiños** - _Initial Work_ - _Documentation_ - [AnthonyLzq](https://github.com/AnthonyLzq).

## Contributors

- **Andree Anchi** - _Bug reports_ - [andreewaD](https://github.com/andreewD).
5 changes: 2 additions & 3 deletions bin/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env node
const main = require('../lib/index.js')

const config = require('../lib/index.js')

config.tsInitialConfig()
main()
1 change: 0 additions & 1 deletion example/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ node_modules
LICENSE

jest.config.ts
nodemon.json
*.log
12 changes: 6 additions & 6 deletions example/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint - test
name: Lint - example

on: [push]

Expand All @@ -19,14 +19,14 @@ jobs:
node-version: 16.x

- name: Install Node.js dependencies
run: yarn install --frozen-lockfile
run: pnpm i --frozen-lockfile

- name: Revert changes into the yarn.lock file
run: git checkout -- yarn.lock
- name: Revert changes into the pnpm-lock.yaml file
run: git checkout -- pnpm-lock.yaml

- name: Run linters
uses: wearerequired/lint-action@v1
uses: wearerequired/lint-action@v2
with:
auto_fix: true
eslint: true
eslint_extensions: js
eslint_extensions: ts
12 changes: 6 additions & 6 deletions example/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Tests - test
name: Tests - example

on: [push]

jobs:
test:
name: Testing test
name: Testing example
runs-on: ubuntu-latest

steps:
Expand All @@ -19,10 +19,10 @@ jobs:
node-version: 16.x

- name: Install Node.js dependencies
run: yarn install --frozen-lockfile
run: pnpm i --frozen-lockfile

- name: Revert changes into the yarn.lock file
run: git checkout -- yarn.lock
- name: Revert changes into the pnpm-lock.yaml file
run: git checkout -- pnpm-lock.yaml

- name: Run test
run: yarn test
run: pnpm test:ci
2 changes: 1 addition & 1 deletion example/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Test
# Example
10 changes: 5 additions & 5 deletions example/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM node:16-alpine
FROM node:18-alpine

WORKDIR /app

COPY . ./

RUN yarn install --prod
RUN pnpm i --prod

RUN yarn add webpack webpack-node-externals tsconfig-paths-webpack-plugin -D
RUN pnpm i webpack webpack-node-externals tsconfig-paths-webpack-plugin -D

RUN yarn build
RUN pnpm build

RUN yarn remove webpack webpack-node-externals tsconfig-paths-webpack-plugin
RUN pnpm remove webpack webpack-node-externals tsconfig-paths-webpack-plugin

COPY dist ./dist

Expand Down
119 changes: 98 additions & 21 deletions example/LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,98 @@
MIT License

Copyright (c) 2022 AnthonyLzq

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.
html lang="en">
<head itemscope itemtype="http://schema.org/WebSite">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Chivo:900">
<link rel="stylesheet" href="/assets/css/application.css?v=2b3259f30923007524f3fd5952b2fdf9642361e4">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<!--[if lt IE 9]>
<script src="/assets/vendor/html5shiv/dist/html5shiv.js"></script>
<script src="/assets/vendor/selectivizr/selectivizr.js"></script>
<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>404 Not Found | Choose a License</title>
<meta name="generator" content="Jekyll v3.9.2" />
<meta property="og:title" content="404 Not Found" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Non-judgmental guidance on choosing a license for your open source project" />
<meta property="og:description" content="Non-judgmental guidance on choosing a license for your open source project" />
<link rel="canonical" href="https://choosealicense.com/404.html" />
<meta property="og:url" content="https://choosealicense.com/404.html" />
<meta property="og:site_name" content="Choose a License" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="404 Not Found" />
<meta name="twitter:site" content="@github" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebPage","description":"Non-judgmental guidance on choosing a license for your open source project","headline":"404 Not Found","url":"https://choosealicense.com/404.html"}</script>
<!-- End Jekyll SEO tag -->

</head>
<body class="page">
<div class="container">


<ol>
<li>

<a href="/">Home</a>

</li>
</ol>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "https://choosealicense.com/",
"name": "Home"
}
},{
"@type": "ListItem",
"position": 2,
"item": {
"@id": "https://choosealicense.com/404.html",
"name": "404 Not Found"
}
}]
}
</script>




<h1>404 Not Found</h1>



<p>Sorry! We could not find the page you were looking for.</p>

<p>If you were trying to see a license, go to <a href="/licenses">licenses</a>.</p>


<footer class="site-footer clearfix">
<nav>
<a href="/about/">About</a>
<a href="/terms-of-service/">Terms of Service</a>
<a href="https://github.com/github/choosealicense.com/edit/gh-pages/404.md">Help improve this page</a>
</nav>
<p>
The content of this site is licensed under the <a href="https://creativecommons.org/licenses/by/3.0/">
Creative Commons Attribution 3.0 Unported License</a>.
</p>
<div class="with-love">
Curated with ❤️ by <a href="https://github.com">GitHub, Inc.</a> and <a href="https://github.com/github/choosealicense.com">You!</a>
</div>
</footer>

</div> <!-- /container -->


</body>
</html>
4 changes: 2 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Test
# Example

This is a test.
This is a example.
3 changes: 0 additions & 3 deletions example/heroku.yml

This file was deleted.

1 change: 0 additions & 1 deletion example/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const config: Config.InitialOptions = {
preset: 'ts-jest',
testEnvironment: 'node',
testTimeout: 1 * 60 * 1000,
globalSetup: './test/jestGlobalSetup.ts',
modulePaths: ['<rootDir>/src', '<rootDir>/node_modules'],
roots: ['.'],
moduleFileExtensions: ['js', 'json', 'ts'],
Expand Down
11 changes: 0 additions & 11 deletions example/nodemon.json

This file was deleted.

Loading