Skip to content

Instantly share code, notes, and snippets.

@koenbok koenbok/circle.ts Secret
Created Dec 11, 2018

What would you like to do?
Framer X Git Publish Examples
import * as fs from "fs";
import { join, resolve } from "path";
import * as child_process from "child_process";
function getInfo(path: string) {
return JSON.parse(fs.readFileSync(join(path, "package.json")).toString());
function getRemoteInfo(path: string) {
const info = getInfo(path);
return JSON.parse(
.execSync(`yarn info ${} --json`, {
cwd: path
function getSuggestedVersion(version: string) {
const parts = version.split(".");
parts[1] = (parseInt(parts[1]) + 1).toString();
return parts.join(".");
async function publish(path: string, version?: string) {
const remoteInfo = getRemoteInfo(path);
version = version || getSuggestedVersion(;
console.log(`\n\n*** Published v${version} to Framer Store\n\n`);
function run(path: string, command: string, ...args) {
child_process.spawnSync(command, args, {
cwd: path,
stdio: [process.stdin, process.stdout, process.stderr]
async function main() {
const [a, b, path, version] = process.argv;
publish(resolve(path), version);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.