-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: 'unicorn/no-await-expression-member': 'on',
- Loading branch information
1 parent
8b1a567
commit 7491644
Showing
5 changed files
with
74 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,75 @@ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { utils, configure } from 'haetae' | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import { $, configure, utils, git, js, pkg, core } from 'haetae' | ||
import url from 'node:url' | ||
import semver from 'semver' | ||
|
||
export default configure({ | ||
env: async (env, { store }) => ({ | ||
...env, | ||
hihi: store.hi(), | ||
haetaeConfig: await utils.hash( | ||
await js.deps({ entrypoint: url.fileURLToPath(import.meta.url) }), | ||
// await js.deps({ entrypoint: 'haetae.config.ts' }), | ||
), | ||
}), | ||
recordData: async (data, { store }) => ({ | ||
hihi: store.hi(), | ||
...data, | ||
}), | ||
commands: { | ||
myAwesomeCommand: { | ||
run: async () => { | ||
const stdout = await utils.exec('echo hello, world!') | ||
console.log(stdout) | ||
}, | ||
env: { | ||
NODE_ENV: process.env.NODE_ENV, | ||
}, | ||
}, | ||
myAnotherCommand: { | ||
run: async () => { | ||
const stdout = await utils.exec('echo hello, world!') | ||
console.log(stdout) | ||
return { | ||
hi: stdout, | ||
myTest: { | ||
env: async ({ store }) => ({ | ||
hi: store.hi(), | ||
jest: await js.majorVersion('jest'), | ||
jestSharableConfig: await js.majorVersion('@jjangga0214/jest-config'), | ||
jestConfig: await utils.hash(['../../jest.config.js']), | ||
node: semver.major(process.version), | ||
haetae: pkg.version.major, | ||
typescript: await js.untilMinorVersion('typescript'), | ||
tsConfig: await utils.hash(['tsconfig.json', '../../tsconfig.json']), | ||
t: 5, | ||
}), | ||
run: async ({ store }) => { | ||
console.log(store.hi()) | ||
const changedFiles = await git.changedFiles({ | ||
rootDir: '../../', | ||
}) | ||
console.log('changedFiles:', changedFiles) | ||
const previousRecord = await store.getRecord() | ||
console.log('previousRecord:', previousRecord) | ||
const changedHashFiles = await utils.changedFiles(['.env'], {}) | ||
console.log('changedHashFiles:', changedHashFiles) | ||
changedFiles.push(...changedHashFiles) | ||
const testFiles = await utils.glob(['test/**/*.test.ts']) | ||
const additionalGraph = await utils.graph({ | ||
edges: [ | ||
{ | ||
dependents: ['src/index.ts'], | ||
dependencies: ['.env'], | ||
}, | ||
], | ||
}) | ||
console.log('testFiles:', testFiles) | ||
const affectedTestFiles = await js.dependOn({ | ||
dependents: testFiles, | ||
dependencies: changedFiles, | ||
additionalGraph, | ||
tsConfig: 'tsconfig.json', | ||
}) | ||
console.log('affectedTestFiles:', affectedTestFiles) | ||
|
||
if (affectedTestFiles.length > 0) { | ||
const stdout = await $`pnpm test:haetae ${affectedTestFiles}` | ||
console.log(stdout) | ||
} | ||
}, | ||
env: async () => ({ | ||
NODE_ENV: process.env.NODE_ENV, | ||
ji: 's', | ||
}), | ||
}, | ||
myGreeting: { | ||
run: () => ({ hello: 'world' }), | ||
}, | ||
}, | ||
store: { | ||
...core.localFileStore(), | ||
hi: () => 'hi', | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@haetae/example-basic-typescript", | ||
"version": "0.0.1", | ||
"description": "A basic example project using Haetae", | ||
"description": "A bassic example project using Haetae", | ||
"license": "MIT", | ||
"private": true, | ||
"type": "module", | ||
|
@@ -10,25 +10,14 @@ | |
"ts": "node --loader ts-node/esm --loader ../../loader.js", | ||
"lint": "eslint --ext .js,.cjs,.mjs,.jsx,.ts,.tsx,.md .", | ||
"lint:md": "markdownlint .", | ||
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage -c ../../jest.config.js ./examples/basic-typescript/", | ||
"test:haetae": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage -c ../../jest.config.js", | ||
"haetae": "pnpm ts ../../packages/haetae/src/cli.ts", | ||
"ht": "pnpm ts ../../packages/haetae/src/cli.ts" | ||
}, | ||
"devDependencies": { | ||
"@types/semver": "^7.5.0", | ||
"haetae": "workspace:*", | ||
"semver": "^7.5.1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/jjangga0214/haetae.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/jjangga0214/haetae/issues" | ||
}, | ||
"homepage": "https://github.com/jjangga0214/haetae/examples/basic", | ||
"author": { | ||
"name": "Gil B. Chan", | ||
"email": "[email protected]", | ||
"url": "https://github.com/jjangga0214" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { pkg } from 'haetae' | ||
export { pkg } from 'haetae' | ||
|
||
export default { | ||
name: 'hello', | ||
pkg, | ||
} | ||
export const name = 'hello' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import hello from './hello.js' | ||
export { name as depName } from './hello.js' | ||
|
||
console.log(hello) | ||
export const name = 'index' |
7491644
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
haetae – ./
haetae-git-main-jjangga0214.vercel.app
haetae-mu.vercel.app
haetae-jjangga0214.vercel.app
haetae.dev
www.haetae.dev