Skip to content

Commit

Permalink
Merge pull request #21 from tobeyouth/dev
Browse files Browse the repository at this point in the history
feat: 馃幐 export esm module
  • Loading branch information
zaaack committed Jan 10, 2024
2 parents 77236e9 + 2f7b579 commit 1d37693
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions Foyfile.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { task, desc, option, logger, fs, strict, setGlobalOptions, setOption, sleep, namespace, exec, before, execa } from './src/'
import marked from 'marked'
import * as ejs from 'ejs'
import { ChildProcess } from 'child_process'

setGlobalOptions({ loading: false, strict: true })

Expand All @@ -16,6 +15,11 @@ task('build', async ctx => {
'tsc',
'chmod +x ./lib/cli.js',
])
await fs.rmrf('./es')
await ctx.exec([
'tsc --module esnext --outDir es',
'chmod +x ./es/cli.js',
])
})

desc('generate doc')
Expand All @@ -29,7 +33,7 @@ const JasmineCli = `jasmine --require=tsconfig-paths/register --require=ts-node/

task<{ args: string, env: NodeJS.ProcessEnv }>('test', async ctx => {
await ctx.exec(`${JasmineCli} "src/test/*.test.ts" ${ctx.options.args || ''} ${(ctx.task.rawArgs).map(a => `"${a
}"`).join(' ')}`, { env: ctx.options.env || process.env })
}"`).join(' ')}`, { env: ctx.options.env || process.env })
})

task('test:update-snap', [{
Expand Down Expand Up @@ -114,7 +118,7 @@ task('demodemodemodemodemodemodemo1', async ctx => {
task('demo2', async ctx => sleep(3000))
task('demo3', ['demo2', 'demodemodemodemodemodemodemo1'], async ctx => sleep(3000))

task('demo', ['demodemodemodemodemodemodemo1','demo2'.async(), 'demo3'.async()])
task('demo', ['demodemodemodemodemodemodemo1', 'demo2'.async(), 'demo3'.async()])


namespace('client', ns => {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "foy",
"version": "0.2.22",
"version": "0.2.23",
"description": "A simple, light-weight and modern task runner for general purpose.",
"main": "./lib/index.js",
"typings": "./lib/index",
"module": "./es/index",
"types": "./lib/index",
"sideEffects": false,
"scripts": {
Expand Down

0 comments on commit 1d37693

Please sign in to comment.