generated from codex-team/typescript-lib-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added publishing script and updated versions
- Loading branch information
Showing
7 changed files
with
58 additions
and
12 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
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,13 +1,16 @@ | ||
{ | ||
"name": "@editorjs/caret", | ||
"description": "Utils useful for work with caret for Editor.js tools development", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"main": "dist/index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "tsc" | ||
}, | ||
"dependencies": { | ||
"@editorjs/dom": "workspace:^" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
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,13 +1,16 @@ | ||
{ | ||
"name": "@editorjs/dom", | ||
"description": "Utils useful for work with dom for Editor.js tools development", | ||
"version": "0.0.4", | ||
"version": "0.0.6", | ||
"main": "dist/index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "tsc" | ||
}, | ||
"dependencies": { | ||
"@editorjs/helpers": "workspace:^" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
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,10 +1,13 @@ | ||
{ | ||
"name": "@editorjs/helpers", | ||
"description": "Utils useful for Editor.js tools development", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"main": "dist/index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "tsc --project tsconfig.build.json" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
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,10 +1,13 @@ | ||
{ | ||
"name": "@editorjs/keyboard", | ||
"description": "Utils useful for work with keyboard for Editor.js tools development", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"main": "dist/index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "tsc" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { execSync } from 'child_process'; | ||
import * as path from 'path'; | ||
import { pathExistsSync, statSync, readdirSync } from 'fs-extra'; | ||
|
||
const packagesDir = path.join(__dirname, '..', 'packages'); | ||
|
||
/** | ||
* Function that returns names of all packages in /packages directory | ||
*/ | ||
function getPackages(): string[] { | ||
const directories = readdirSync(packagesDir).filter((dir) => { | ||
/** | ||
* Actutal path to the package in project | ||
*/ | ||
const pathToPackage = path.join('packages', dir); | ||
|
||
/** | ||
* Check if path is a directory (not a file) | ||
* Check if path contains package.json (directory is actually package and could be published) | ||
*/ | ||
return statSync(pathToPackage).isDirectory() && pathExistsSync(path.join(pathToPackage, 'package.json')); | ||
}); | ||
|
||
return directories; | ||
} | ||
|
||
execSync('npm run build', { stdio: 'inherit' }); | ||
|
||
let command = 'yarn npm publish --access public'; | ||
|
||
const packages = getPackages(); | ||
|
||
/** | ||
* For each package run yarn npm publish | ||
*/ | ||
for (const name of packages) { | ||
execSync(command, { stdio: 'inherit', | ||
cwd: path.join('packages', name) }); | ||
} |