Skip to content

Commit 48fa355

Browse files
committed
init
0 parents  commit 48fa355

31 files changed

+3787
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

.eslintrc.cjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"use strict";
2+
3+
module.exports = {
4+
env: {
5+
node: true,
6+
},
7+
extends: ["eslint:recommended", "plugin:n/recommended"],
8+
parser: "@babel/eslint-parser",
9+
parserOptions: {
10+
requireConfigFile: false,
11+
sourceType: "module",
12+
},
13+
root: true,
14+
};

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
concurrency:
4+
cancel-in-progress: true
5+
group: ci-${{github.head_ref || github.ref}}
6+
7+
on:
8+
pull_request:
9+
branches: main
10+
push:
11+
branches: main
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: wyvox/action-setup-pnpm@v2
19+
- run: pnpm lint
20+
21+
test:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: wyvox/action-setup-pnpm@v2
26+
- run: pnpm test
27+
28+
scenario:
29+
needs: test
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: wyvox/action-setup-pnpm@v2
34+
- run: pnpm build
35+
- run: pnpm install
36+
working-directory: test-app
37+
- run: node ../bin/try-or-die.js scenario ${{matrix.scenario}}
38+
working-directory: test-app
39+
strategy:
40+
matrix:
41+
scenario:
42+
- ember-lts-4.8
43+
- ember-lts-4.12
44+
- ember-release
45+
- ember-beta
46+
- ember-canary
47+
- embroider-safe
48+
- embroider-optimized
49+
50+
scenarios:
51+
needs: test
52+
runs-on: ${{matrix.os}}
53+
steps:
54+
- uses: actions/checkout@v4
55+
- uses: wyvox/action-setup-pnpm@v2
56+
- run: pnpm build
57+
- run: pnpm install
58+
working-directory: test-app
59+
- run: node ../bin/try-or-die.js scenarios
60+
working-directory: test-app
61+
strategy:
62+
matrix:
63+
os:
64+
- macos-latest
65+
- ubuntu-latest
66+
- windows-latest

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
coverage/
2+
dist/
3+
node_modules/
4+
.eslintcache

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm-lock.yaml

README.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# try-or-die
2+
3+
[![CI](https://github.com/bertdeblock/try-or-die/workflows/CI/badge.svg)](https://github.com/bertdeblock/try-or-die/actions?query=workflow%3ACI)
4+
5+
An experiment inspired by [ember-try](https://github.com/ember-cli/ember-try),
6+
but decoupled from [ember-cli](https://github.com/ember-cli/ember-cli).
7+
8+
## Configuration
9+
10+
```js
11+
// try-or-die.config.js
12+
13+
import { embroiderOptimized, embroiderSafe } from "@embroider/test-setup";
14+
import emberSourceChannelURL from "ember-source-channel-url";
15+
16+
export default {
17+
// Type: "bun" | "npm" | "pnpm" | "yarn"
18+
// Default: "npm"
19+
packageManager: "pnpm",
20+
21+
// Type: string[]
22+
// Default: []
23+
packageManagerInstallOptions: ["--no-lockfile"],
24+
25+
// Type: [string, ...string[]]
26+
// Default: [config.packageManager, "test"]
27+
testCommand: ["pnpm", "test:ember"],
28+
29+
// Type: Scenario[]
30+
// Default: []
31+
scenarios: [
32+
{
33+
name: "ember-lts-4.8",
34+
packageJson: {
35+
devDependencies: {
36+
"ember-source": "~4.8.0",
37+
},
38+
},
39+
},
40+
{
41+
name: "ember-lts-4.12",
42+
packageJson: {
43+
devDependencies: {
44+
"ember-source": "~4.12.0",
45+
},
46+
},
47+
},
48+
{
49+
name: "ember-release",
50+
packageJson: {
51+
devDependencies: {
52+
"ember-source": await emberSourceChannelURL("release"),
53+
},
54+
},
55+
},
56+
{
57+
name: "ember-beta",
58+
packageJson: {
59+
devDependencies: {
60+
"ember-source": await emberSourceChannelURL("beta"),
61+
},
62+
},
63+
},
64+
{
65+
name: "ember-canary",
66+
packageJson: {
67+
devDependencies: {
68+
"ember-source": await emberSourceChannelURL("canary"),
69+
},
70+
},
71+
},
72+
// `ember-try` scenarios are supported as well:
73+
embroiderSafe(),
74+
embroiderOptimized(),
75+
],
76+
};
77+
```
78+
79+
## Usage
80+
81+
```shell
82+
# Run a single scenario:
83+
try-or-die scenario ember-release
84+
85+
# Run all scenarios:
86+
try-or-die scenarios
87+
88+
# Run multiple scenarios:
89+
try-or-die scenarios --names ember-release ember-beta ember-canary
90+
91+
# Use a custom path to a `try-or-die` config file:
92+
try-or-die scenarios --config-path=config/try-or-die.config.js
93+
94+
# See all options:
95+
try-or-die --help
96+
try-or-die --help scenario
97+
try-or-die --help scenarios
98+
```

bin/try-or-die.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env node
2+
3+
// eslint-disable-next-line n/no-missing-import
4+
import "../dist/cli/index.js";

package.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"name": "try-or-die",
3+
"version": "0.1.0",
4+
"description": "Try? Or die?",
5+
"license": "MIT",
6+
"author": "Bert De Block",
7+
"type": "module",
8+
"main": "index.js",
9+
"bin": {
10+
"try-or-die": "bin/try-or-die.js"
11+
},
12+
"files": [
13+
"bin/",
14+
"dist/"
15+
],
16+
"scripts": {
17+
"build": "tsc --project tsconfig.json",
18+
"lint": "concurrently --group --prefix-colors auto \"npm:lint:*(!fix)\"",
19+
"lint:fix": "concurrently --group --prefix-colors auto \"npm:lint:*:fix\"",
20+
"lint:format": "prettier . --cache --check",
21+
"lint:format:fix": "prettier . --cache --write",
22+
"lint:js": "eslint . --cache",
23+
"lint:js:fix": "eslint . --fix",
24+
"lint:types": "tsc --noEmit",
25+
"prepack": "tsc --project tsconfig.json",
26+
"prepare": "pnpm build",
27+
"start": "pnpm build --watch",
28+
"test": "vitest",
29+
"test:coverage": "vitest run --coverage"
30+
},
31+
"dependencies": {
32+
"chalk": "^5.3.0",
33+
"debug": "^4.3.4",
34+
"execa": "^8.0.1",
35+
"find-up": "^6.3.0",
36+
"flatten-anything": "^3.0.5",
37+
"fs-extra": "^11.1.1",
38+
"lodash.set": "^4.3.2",
39+
"temp-dir": "^3.0.0",
40+
"yargs": "^17.7.2"
41+
},
42+
"devDependencies": {
43+
"@babel/core": "^7.22.17",
44+
"@babel/eslint-parser": "^7.22.15",
45+
"@types/debug": "^4.1.8",
46+
"@types/fs-extra": "^11.0.1",
47+
"@types/lodash.set": "^4.3.7",
48+
"@types/node": "^20.6.0",
49+
"@types/yargs": "^17.0.24",
50+
"@vitest/coverage-v8": "^0.34.4",
51+
"concurrently": "^8.2.1",
52+
"eslint": "^8.49.0",
53+
"eslint-plugin-n": "^16.0.2",
54+
"fixturify-project": "^6.0.0",
55+
"prettier": "^3.0.3",
56+
"type-fest": "^4.3.1",
57+
"typescript": "^5.2.2",
58+
"vitest": "^0.34.4"
59+
},
60+
"packageManager": "pnpm@8.7.4",
61+
"volta": {
62+
"node": "18.17.1"
63+
}
64+
}

0 commit comments

Comments
 (0)