Skip to content

Commit

Permalink
Test with major package managers
Browse files Browse the repository at this point in the history
  • Loading branch information
Hilzu committed Jul 15, 2024
1 parent 0a49fc0 commit 0c66b3a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,32 @@ jobs:
- run: npm test

create:
name: Create a project with npm
name: Create a project
strategy:
matrix:
os: [ubuntu, windows, macos]
node-version: [18.x, 20.x, 22.x]
package-manager: [npm, yarn, pnpm]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
if: matrix.package-manager == 'pnpm'
with:
version: 9
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm install --production
- run: npm link
cache: npm
- run: npm install --global .

- run: npm init ts-node new-project
- run: ${{ matrix.package-manager }} exec create-ts-node new-project
working-directory: ${{ runner.temp }}
- run: npm install
- run: ${{ matrix.package-manager }} install
working-directory: ${{ runner.temp }}/new-project
- run: npm run build
- run: ${{ matrix.package-manager }} run build
working-directory: ${{ runner.temp }}/new-project
- run: npm test
- run: ${{ matrix.package-manager }} test
working-directory: ${{ runner.temp }}/new-project
1 change: 1 addition & 0 deletions create.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env node

// hello
import chalk from "chalk";
import {
copyFile,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-ts-node",
"version": "0.3.3",
"version": "0.3.4",
"description": "Create a new Node.js project that uses Typescript, ESLint and Prettier",
"author": "Santeri Hiltunen <[email protected]> (https://hilzu.moe/)",
"license": "Unlicense",
Expand Down
3 changes: 3 additions & 0 deletions template/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
node_modules/
pnpm-lock.yaml
2 changes: 1 addition & 1 deletion template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"format": "PM_RUN prettier --write",
"lint": "eslint .",
"nodemon": "nodemon --watch dist",
"prettier": "prettier --ignore-path .gitignore .",
"prettier": "prettier .",
"start": "node --enable-source-maps dist/index.js",
"dev": "npm-run-all build --parallel tsc:watch nodemon",
"test": "npm-run-all lint test:format",
Expand Down

0 comments on commit 0c66b3a

Please sign in to comment.