Skip to content

Commit

Permalink
update publishing preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanbatic committed Feb 8, 2018
1 parent b5e823a commit 24d57f2
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 42 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
*.iml
node_modules
compiled/
coverage/
coverage/
dist
compiled
10 changes: 10 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# IntelliJ project files
.idea
*.iml
node_modules
compiled/
coverage/
src
scripts
compiled
dist/tests
20 changes: 0 additions & 20 deletions lib/package.json

This file was deleted.

72 changes: 70 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
"name": "cwlts",
"version": "1.15.18",
"description": "TypeScript data model for Common Workflow Language",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"scripts": {
"tsc": "tsc -p tsconfig.json",
"tsc": "npx tsc",
"test": "./node_modules/typescript/bin/tsc --outDir ./compiled --declaration false && ./node_modules/mocha/bin/_mocha --ui bdd ./compiled/**/*.spec.js",
"coverage": "npm install istanbul && ./node_modules/typescript/bin/tsc --outDir ./compiled --declaration false && ./node_modules/istanbul/lib/cli.js cover -x '**/*.spec.js' _mocha ./compiled/**/*.spec.js",
"regenerate": "./node_modules/cwl-ts-parser/src/bin/generate.js ./src/mappings",
"schemas": "npm install cwl-ts-parser && scripts/schemas.sh",
"d2sb-test": "mocha src/tests/*.d2sb.spec.js",
"v1-test": "mocha src/tests/*.v1.spec.js"
"v1-test": "mocha src/tests/*.v1.spec.js",
"prepare": "node ./scripts/prepublish.js && npm run tsc"
},
"repository": {
"type": "git",
Expand All @@ -29,17 +28,23 @@
},
"devDependencies": {
"@types/chai": "^3.5.2",
"@types/chai-spies": "^0.0.0",
"@types/chai-as-promised": "0.0.29",
"@types/chai-spies": "^0.0.0",
"@types/fs-extra": "^5.0.0",
"@types/mocha": "^2.2.41",
"@types/node": "^6.0.83",
"@types/rimraf": "^2.0.2",
"chai": "^3.5.0",
"chai-as-promised": "^6.0.0",
"chai-spies": "^0.7.1",
"fs-extra": "^5.0.0",
"istanbul": "^0.4.5",
"jsonschema": "^1.1.1",
"mocha": "^2.5.3",
"typescript": "^2.5.2",
"typescript-json-schema": "0.1.1"
},
"engines": {
"npm": "~5.5.0"
}
}
3 changes: 3 additions & 0 deletions scripts/package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
# run this from root
# cd lib, do npm version bump
# npm publish inside lib

# clears lib directory
rm -r lib/mappings
Expand Down
30 changes: 30 additions & 0 deletions scripts/prepublish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env node
const fs = require("fs-extra");

const distDir = __dirname + "/../dist";
const srcDir = __dirname + "/../src";

const clean = new Promise((resolve, reject) => {
fs.access(distDir, fs.F_OK, accessError => {
if (accessError) return resolve();

fs.remove(distDir, removeError => {
if (removeError) return reject(removeError);
resolve();
});
});
});

const schemaSource = `${srcDir}/schemas`;
const schemaDist = `${distDir}/schemas`;

clean.then(() => Promise.all([
fs.copy(`${schemaSource}/d2sb`, `${schemaDist}/d2sb`),
fs.copy(`${schemaSource}/draft-3`, `${schemaDist}/draft-3`),
fs.copy(`${schemaSource}/cwl-v10.json`, `${schemaDist}/cwl-v10.json`),
fs.copy(`${schemaSource}/cwl-mixed.json`, `${schemaDist}/cwl-mixed.json`),
fs.copy(`${srcDir}/../package.json`, `${distDir}/package.json`),
fs.copy(`${srcDir}/../package-lock.json`, `${distDir}/package-lock.json`),
])).catch(err => {
process.exit(1);
});
13 changes: 9 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"declaration": true,
"outDir": "./lib",
"outDir": "dist",
"target": "es5",
"lib": ["dom", "es6"],
"types": ["node", "mocha", "chai", "chai-as-promised"]
"lib": [
"dom",
"es6"
],
"typeRoots": [
"node_modules/@types"
]
},
"exclude": [
"lib",
"dist",
"node_modules",
"**/*.json"
]
Expand Down
10 changes: 0 additions & 10 deletions typings.json

This file was deleted.

0 comments on commit 24d57f2

Please sign in to comment.