Merge pull request #37 from transitive-bullshit/feature/typescript-support-v2
add typescript support v2
This commit is contained in:
parent
faba0e5f9e
commit
c0769c2743
45 changed files with 2544 additions and 6662 deletions
|
@ -14,7 +14,17 @@ const tests = [
|
|||
description: 'this is a auto-generated test module. please ignore.',
|
||||
repo: 'nala/my-test-library',
|
||||
license: 'MIT',
|
||||
manager: 'yarn'
|
||||
manager: 'yarn',
|
||||
template: 'default'
|
||||
},
|
||||
{
|
||||
name: 'my-test-typescript-library',
|
||||
author: 'nala',
|
||||
description: 'this is a auto-generated test module. please ignore.',
|
||||
repo: 'nala/my-test-library',
|
||||
license: 'MIT',
|
||||
manager: 'yarn',
|
||||
template: 'typescript'
|
||||
},
|
||||
{
|
||||
name: 'my-test-library',
|
||||
|
@ -22,7 +32,17 @@ const tests = [
|
|||
description: 'this is a auto-generated test module. please ignore.',
|
||||
repo: 'nala/my-test-library',
|
||||
license: 'MIT',
|
||||
manager: 'npm'
|
||||
manager: 'npm',
|
||||
template: 'default'
|
||||
},
|
||||
{
|
||||
name: 'my-test-library',
|
||||
author: 'nala',
|
||||
description: 'this is a auto-generated test module. please ignore.',
|
||||
repo: 'nala/my-test-typescript-library',
|
||||
license: 'MIT',
|
||||
manager: 'npm',
|
||||
template: 'typescript'
|
||||
},
|
||||
{
|
||||
name: '@automagical/nala',
|
||||
|
@ -30,32 +50,36 @@ const tests = [
|
|||
description: 'this is a auto-generated test module. please ignore.',
|
||||
repo: 'superstar-cats/nala',
|
||||
license: 'GPL',
|
||||
manager: 'yarn'
|
||||
manager: 'yarn',
|
||||
template: 'default'
|
||||
}
|
||||
]
|
||||
|
||||
tests.forEach((info) => {
|
||||
test.serial(`creating "${info.name}" using ${info.manager}`, async (t) => {
|
||||
console.log(`creating "${info.name}" using ${info.manager}...`)
|
||||
tests.forEach((opts) => {
|
||||
test.serial(`creating "${opts.name}" using ${opts.manager}`, async (t) => {
|
||||
console.log(`creating "${opts.name}" using ${opts.manager}...`)
|
||||
let ret
|
||||
|
||||
// ensure library is created successfully
|
||||
const root = await createLibrary(info)
|
||||
t.truthy(root.indexOf(info.shortName) >= 0)
|
||||
const root = await createLibrary(opts)
|
||||
const example = path.join(root, 'example')
|
||||
t.truthy(root.indexOf(opts.shortName) >= 0)
|
||||
|
||||
// ensure yarn runs successfully in src/
|
||||
ret = await execa.shell('yarn', { cwd: root })
|
||||
// ensure deps install successfully in root
|
||||
ret = await execa.shell(`${opts.manager} install`, { cwd: root })
|
||||
t.is(ret.code, 0)
|
||||
|
||||
// ensure jest tests pass
|
||||
ret = await execa.shell('yarn test', { cwd: root })
|
||||
// ensure root tests pass
|
||||
ret = await execa.shell(`${opts.manager} test`, { cwd: root })
|
||||
t.is(ret.code, 0)
|
||||
|
||||
if (info.manager === 'yarn') {
|
||||
// ensure yarn runs successfully in example/
|
||||
ret = await execa.shell('yarn install', { cwd: path.join(root, 'example') })
|
||||
t.is(ret.code, 0)
|
||||
}
|
||||
// ensure deps install successfully in example
|
||||
ret = await execa.shell(`${opts.manager} install`, { cwd: example })
|
||||
t.is(ret.code, 0)
|
||||
|
||||
// ensure bundle builds successfully in example
|
||||
ret = await execa.shell(`${opts.manager} build`, { cwd: example })
|
||||
t.is(ret.code, 0)
|
||||
|
||||
// ensure git is initialized properly
|
||||
ret = await execa.shell('git status', { cwd: root })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue