Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
0fb9e84
adding license file and removing image from published
Nov 16, 2017
065a423
fixing test
Nov 16, 2017
28ab1f9
adding tests
Nov 16, 2017
51b1f6a
fixing async tests
Nov 16, 2017
6fb1e3c
fixing output and adding tsconfig
Nov 16, 2017
b0df3f5
2.0.0-alpha-5
Nov 16, 2017
d1da5f0
merge master
Nov 16, 2017
47b9e81
fixing test
Nov 16, 2017
0432d9d
Merge remote-tracking branch 'origin/master' into develop
Nov 16, 2017
9b4907b
adding templates
Nov 16, 2017
b7317ed
closed #1
Nov 17, 2017
01ec10f
fixing non-deterministic test
Nov 17, 2017
20666fa
adding more tests
Nov 17, 2017
0a1a0b1
typings refactor
Nov 17, 2017
b3a3bb3
bumping version for publish
Nov 17, 2017
abfcb05
adding error handling to typings
Nov 17, 2017
33d6ff0
merge master
Nov 17, 2017
121c7d2
fixing dependency checks for typings
Nov 17, 2017
3ec29f8
merge master
Nov 17, 2017
c7e665d
fixing typings to loop through children
Nov 17, 2017
77b5bbb
merge master
Nov 17, 2017
cfee552
2.0.0-alpha-10
Nov 17, 2017
9bffe50
merge master
Nov 17, 2017
964a0f9
Merge remote-tracking branch 'origin/master' into develop
Nov 17, 2017
c97dc0c
fixing child typings
Nov 17, 2017
d02f96a
Merge remote-tracking branch 'origin/master' into develop
Nov 17, 2017
d1820f0
stuff
Nov 18, 2017
5cea59d
fixing typings
Nov 19, 2017
2314f13
Merge remote-tracking branch 'origin/master' into develop
Nov 19, 2017
6aabe08
checkpoint
Nov 24, 2017
ef61da6
fixing lint issues
Nov 24, 2017
4bfeb2c
improving tests
Nov 25, 2017
9c9c390
increasing timeout
Nov 25, 2017
1148b15
fix: changing travis
Nov 25, 2017
124973b
travis
Nov 25, 2017
27d6bda
travis
Nov 25, 2017
5069f1f
fixing tests
Nov 25, 2017
7fc0637
fixing tests
Nov 25, 2017
d24e615
travis
Nov 25, 2017
61b16c1
cleanup
Nov 26, 2017
4c3ad80
fixig typings
Nov 26, 2017
431b29d
fixing tests
Nov 26, 2017
e7770a2
fixing tests
Nov 26, 2017
be62d78
fixing script
Nov 26, 2017
2e0ce4b
fixing script
Nov 26, 2017
17125cd
fixing script
Nov 26, 2017
33b894a
changing how builds work
Nov 26, 2017
97e2ad8
first new release
Nov 26, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.nyc_output/
.cache/
artifacts/
lib/
node_modules/
Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.nyc_output/
.cache/
artifacts/
docs/
node_modules/
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.yarnpkg.com/:_authToken=${NPM_TOKEN}
34 changes: 20 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@ node_js:
- node
- '8'
- '6'
os:
- linux
deploy:
provider: npm
email: support@nativecode.com
api_key:
secure: >-
OhNMsrMIkJlReUcs0Zu/0bnnQ0faivy32E2GBhIQt6wM+BaPmPHhvlr2v3846EBGafBQYWlj3IdpKYI1F+/kCgdJnAiY41mNuWUnxjMoNxSUI3rjaTYUsMkPgte7OMGfv1Vlc+qVzRlgaff/NeDjrC3TjDlpSRXzlLDw2zhQPWbqSsTLNhfZqxbanXsUt0cIV6hZsC0Jyo+VAuJ+6OxN8Jo0vehCNY5yvceX/k2J4OgZ4NP/o0m4DH8g6ltUbCmGwtzM1oYsu4KYOHnvPcILRvsJsw2Y72edREjJvpgwU1fHRvniQC+al3UAeW5EPZdaAUvOtb/ZLZAjnXhX1lKzfBO72vBUI1mPKAc/prV1pwokJeFiuLeJomfxAKSFObu1g8HHQhsbg86IT63KQlIdm+FTDRnVdrMV4tGuYudbRrAU38JWes5XRJ6Rx//poMcp5MLdAq9ZzapMjQ9LOEYnxw1oFBxwn7rCP9QcFp60c2GWn6Ury86ZGI2OwrPIq4Uef/X28PS985lePS/+YugiXaeAwmtwgBYZapEPSg08CSBhsj2ORNFUDN/7GkuGryDcMMoP1+BwdgWuUCwzicFh4XiutUw5g9MhNINT5JF3Q84FNgrK+U/Wkw10ARud38q3aSo3U6+WdhqXEZTpU4t5eAGUXmwcQgmF3E0l1Pny6Ls=
on:
branch: master
tag: next
repo: nativecode-dev/chest
skip_cleanup: true
os: linux
stages:
- test
- name: deploy
if: (branch = "master") AND type != pull_request AND tag IS blank
jobs:
include:
- stage: deploy
script:
- yarn run travis-ssh
- 'git remote set-url origin git@github.com:nativecode-dev/chest.git'
- git checkout $TRAVIS_BRANCH
- 'npm set //registry.npmjs.org/:_authToken "$NPM_TOKEN"'
- yarn run travis-release
after_failure:
- ls -lah --color=auto
after_success:
- npm run coveralls
- yarn run travis-coveralls
before_install:
- 'curl -o- -L https://yarnpkg.com/install.sh | bash -s'
- 'export PATH="$HOME/.yarn/bin:$PATH"'
Binary file added deploy.enc
Binary file not shown.
136 changes: 73 additions & 63 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,73 @@
{
"name": "@beard/chest",
"description": "CHEST of me best tools, matey!",
"bin": "./lib/CLI.js",
"license": "MIT",
"main": "./lib/CLI.js",
"typings": "./lib/index.d.ts",
"version": "2.0.0-alpha-14",
"dependencies": {
"chalk": "^2.3.0"
},
"devDependencies": {
"@types/chai": "^4.0.4",
"@types/chai-as-promised": "^7.1.0",
"@types/chalk": "^2.2.0",
"@types/mocha": "^2.2.44",
"@types/node": "^8.0.52",
"bin-shebang": "^1.0.11",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"coveralls": "^3.0.0",
"cross-env": "^5.1.1",
"mocha": "^4.0.1",
"nyc": "^11.3.0",
"rimraf": "^2.6.2",
"ts-node": "^3.3.0",
"tsconfig-paths": "^2.3.0",
"tslint": "^5.8.0",
"tslint-config-standard": "^7.0.0",
"typescript": "^2.6.1"
},
"nyc": {
"all": true,
"exclude": [
"src/**/*.spec.ts",
"src/CLI.ts"
],
"extension": [
".ts"
],
"include": [
"src/**/*.ts"
],
"instrument": true,
"sourceMap": true
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/nativecode-dev/chest"
},
"scripts": {
"build": "tsc --project tsconfig.json",
"lint": "tslint src/**/*.ts",
"prebuild": "rimraf lib && rimraf artifacts",
"postbuild": "bin-shebang && yarn run lint",
"test": "cross-env NODE_ENV=test nyc mocha --opts mocha.opts",
"pretest": "yarn run build",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
}
}
{
"name": "@beard/chest",
"description": "CHEST of me best tools, matey!",
"bin": "./lib/CLI.js",
"license": "MIT",
"main": "./lib/CLI.js",
"typings": "./lib/index.d.ts",
"version": "2.0.0-development",
"dependencies": {
"chalk": "^2.3.0"
},
"devDependencies": {
"@alrra/travis-scripts": "^3.0.1",
"@types/chai": "^4.0.4",
"@types/chai-as-promised": "^7.1.0",
"@types/chalk": "^2.2.0",
"@types/mocha": "^2.2.44",
"@types/node": "^8.0.52",
"bin-shebang": "^1.0.11",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"coveralls": "^3.0.0",
"cross-env": "^5.1.1",
"mocha": "^4.0.1",
"nyc": "^11.3.0",
"rimraf": "^2.6.2",
"semantic-release": "^8.2.0",
"semantic-release-cli": "^3.2.6",
"ts-node": "^3.3.0",
"tsconfig-paths": "^2.3.0",
"tslint": "^5.8.0",
"tslint-config-standard": "^7.0.0",
"typescript": "^2.6.1"
},
"nyc": {
"all": true,
"exclude": [
"src/**/*.spec.ts",
"src/CLI.ts"
],
"extension": [
".ts"
],
"include": [
"src/**/*.ts"
],
"instrument": true,
"report-dir": ".cache/coverage",
"reporter": "text",
"sourceMap": true,
"temp-directory": ".cache/nyc"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/nativecode-dev/chest"
},
"scripts": {
"build": "tsc --project tsconfig.json",
"prebuild": "rimraf .cache && rimraf lib && rimraf artifacts && tslint --project tsconfig.json --config tslint.json",
"postbuild": "bin-shebang",
"test": "sh setup-tests.sh && cross-env DEBUG= nyc mocha --opts mocha.opts",
"pretest": "yarn run build",
"testonly": "cross-env DEBUG= nyc mocha --opts mocha.opts",
"pretestonly": "yarn run prebuild",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"travis-coveralls": "cross-env DEBUG= nyc report --reporter=text-lcov | coveralls",
"travis-release": "semantic-release pre && npm publish && semantic-release post",
"travis-ssh": "set-up-ssh --key \"$encrypted_7baae619033b_key\" --iv \"$encrypted_7baae619033b_iv\" --path-encrypted-key \"deploy.enc\""
}
}
11 changes: 11 additions & 0 deletions setup-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

YARN=`which yarn`

cd testables/single
$YARN

cd ../workspaces
$YARN

cd ..
2 changes: 1 addition & 1 deletion src/CLI.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Chest } from './index'

Chest.run(process.cwd(), ...process.argv.slice(2))
Chest.run(process.cwd(), ...process.argv.slice(2)).catch(() => process.exit(1))
1 change: 1 addition & 0 deletions src/Chest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ describe('when loading projects', () => {
const args = Object.keys(Registry.all())
return Chest.run(directory, ...args)
})

})
8 changes: 4 additions & 4 deletions src/Chest.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as path from 'path'

import { Files, Log, Logger, NPM, Project, Registry, UpdaterType } from './Core'
import { Log, Logger, Project, Registry, UpdaterType } from './Core'

export class Chest {
private static readonly Log: Log = Logger('chest')
private static readonly log: Log = Logger('chest')

public static async run(root: string, ...args: string[]): Promise<void> {
Chest.log.debug('run', root, ...args)

const project = await Project.load(root)
const updaters = Registry.all()

Expand Down
25 changes: 8 additions & 17 deletions src/Core/Actions/Packages.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
import * as path from 'path'

import { Files, Logger, NPM, Project, Registry, Updater, UpdateScript, UpdaterType } from '../index'

const ScriptName = Files.extensionless(__filename)
const log = Logger(ScriptName)
const prefix = '@types'

interface Dependency {
filename: string
filepath: string
npmname: string
scope?: string
typings?: string
}
import { Files, NPM, Project, Registry, UpdateScript, UpdaterType } from '../index'

/*
* Propogates changes from the root package.json to child
* packages.
**/
class Script extends UpdateScript {
public static readonly Name: string = Files.extensionless(__filename)

constructor() {
super(ScriptName, UpdaterType.Projects)
super(Script.Name, UpdaterType.Projects)
}

public async workspace(project: Project): Promise<void> {
if (project.owner) {
const source = await project.owner.package
const target = await project.package
const source = await project.owner.npm
const target = await project.npm

target.author = source.author
target.bugs = source.bugs
Expand All @@ -38,6 +28,7 @@ class Script extends UpdateScript {
const filename = path.join(project.path, 'package.json')

if (this.testing) {
/* istanbul ignore next */
this.log.task('workspace', filename, JSON.stringify(target, null, 2))
} else {
await Files.save(filename, target)
Expand All @@ -47,4 +38,4 @@ class Script extends UpdateScript {
}
}

Registry.add(ScriptName, new Script())
Registry.add(Script.Name, new Script())
22 changes: 22 additions & 0 deletions src/Core/Actions/Typings.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'mocha'

import { expect } from 'chai'
import { Files, Registry } from '../index'

const testables = Files.join(process.cwd(), 'testables')
const single = Files.join(testables, 'single')
const workspaces = Files.join(testables, 'workspaces')

describe('when collecting type declarations', () => {

it('should execute single', () => {
const script = Registry.get('typings')
return script.exec(single)
})

it('should execute workspaces', () => {
const script = Registry.get('typings')
return script.exec(workspaces)
})

})
Loading