Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@
"javascript"
],
"scripts": {
"install:all": "lerna bootstrap && lerna link",
"start:comp": "lerna run start --scope=@gitgraph/{core,js,react} --parallel",
"start:all": "lerna run start --scope=@gitgraph/{core,js,react,stories} --parallel",
"lerna": "lerna",
"build": "lerna run build --scope=@gitgraph/{core,react,js,node} --stream",
"watch": "lerna run watch --stream",
"watch": "lerna run watch --scope=@gitgraph/{core,react,js,node} --stream",
"storybook": "sleep 3 && lerna run storybook --stream",
"develop": "concurrently npm:watch npm:storybook",
"website": "lerna run start --scope=@gitgraph/website --stream",
Expand All @@ -49,11 +52,11 @@
"eslint-plugin-react": "^7.21.5",
"husky": "1.1.2",
"jest": "23.3.0",
"lerna": "3.13.1",
"lerna": "3.10.7",
"prettier": "^2.2.0",
"pretty-quick": "^3.1.0",
"ts-jest": "23.0.0",
"typescript": "3.5.1"
"typescript": "4.8.3"
},
"workspaces": [
"packages/*"
Expand Down
12 changes: 7 additions & 5 deletions packages/gitgraph-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
"publishConfig": {
"access": "public"
},
"main": "./lib/bundle.umd.js",
"module": "./lib/index.js",
"jsnext:main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"main": "dist/index.js",
"module": "dist/index.es.js",
"jsnext:main": "dist/index.es.js",
"typings": "dist/index.d.ts",
"scripts": {
"start": "rollup -c -w",
"prewatch": "rimraf ./lib",
"watch": "tsc -w",
"test": "jest",
Expand All @@ -45,12 +46,13 @@
"prepublishOnly": "npm run test"
},
"devDependencies": {
"@rollup/plugin-typescript": "8.5.0",
"@types/node": "9.4.6",
"auto-changelog": "1.12.1",
"browserify": "14.5.0",
"npm-run-all": "4.1.2",
"rimraf": "2.6.2",
"rollup": "0.51.8",
"rollup": "2.79.1",
"uglify-es": "3.3.9"
},
"jest": {
Expand Down
23 changes: 18 additions & 5 deletions packages/gitgraph-core/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
import typescript from "@rollup/plugin-typescript";

import pkg from "./package.json";

export default {
input: "lib/index.js",
output: {
file: "lib/bundle.umd.js",
format: "umd",
},
input: "src/index.ts",
output: [
{
file: pkg.main,
format: "cjs",
sourcemap: true,
},
{
file: pkg.module,
format: "es",
sourcemap: true,
},
],
plugins: [typescript({ module: "ESNext" })],
};
3 changes: 3 additions & 0 deletions packages/gitgraph-core/src/commit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ class Commit<TNode = SVGElement> {
} catch (e) {
[name, email] = [options.author, ""];
}
name = "foo bars 232ss";
email = "asd@asd.com";
console.log("Here Andrei 23");
this.author = { name, email, timestamp: Date.now() };
this.committer = { name, email, timestamp: Date.now() };

Expand Down
4 changes: 3 additions & 1 deletion packages/gitgraph-core/src/user-api/branch-user-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ class BranchUserApi<TNode> {
throw new Error(`Cannot commit on the deleted branch "${this.name}"`);
}

console.log("Here four five six");

// Deal with shorter syntax
if (typeof options === "string") options = { subject: options };
if (typeof options === "string") options = { subject: "foo" };
if (!options) options = {};

this._commitWithParents(options, []);
Expand Down
4 changes: 2 additions & 2 deletions packages/gitgraph-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"declaration": true,
"sourceMap": true,
"removeComments": false,
"strict": true,
"noImplicitAny": true,
"strict": false,
"noImplicitAny": false,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
Expand Down
20 changes: 11 additions & 9 deletions packages/gitgraph-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@
"publishConfig": {
"access": "public"
},
"main": "./lib/index.js",
"browser": "./lib/gitgraph.umd.js",
"module": "./lib/index.js",
"jsnext:main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"main": "dist/gitgraph.umd.js",
"browser": "dist/gitgraph.umd.js",
"module": "dist/gitgraph.umd.js",
"jsnext:main": "dist/index.es.js",
"typings:main": "dist/gitgraph.d.ts",
"directories": {
"lib": "lib"
"lib": "dist"
},
"files": [
"lib"
"dist"
],
"scripts": {
"start": "rollup -c -w",
"prewatch": "rimraf ./lib",
"watch": "tsc -w",
"build": "run-s build:*",
Expand All @@ -49,14 +50,15 @@
"version": "auto-changelog -p -l 0 --tag-prefix @gitgraph/js@ && git add CHANGELOG.md"
},
"dependencies": {
"@gitgraph/core": "1.5.0"
"@gitgraph/core": "1.5.0",
"@rollup/plugin-typescript": "8.5.0"
},
"devDependencies": {
"@types/node": "9.4.6",
"auto-changelog": "1.12.1",
"npm-run-all": "4.1.2",
"rimraf": "2.6.2",
"rollup": "1.10.1",
"rollup": "2.79.1",
"rollup-plugin-commonjs": "9.3.4",
"rollup-plugin-node-resolve": "4.2.3",
"uglify-es": "3.3.9"
Expand Down
8 changes: 5 additions & 3 deletions packages/gitgraph-js/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import resolve from "rollup-plugin-node-resolve";
import commonJS from "rollup-plugin-commonjs";
import typescript from "@rollup/plugin-typescript";

export default {
input: "lib/index.js",
input: "src/index.ts",
output: {
file: "lib/gitgraph.umd.js",
file: "dist/gitgraph.umd.js",
format: "umd",
name: "GitgraphJS",
sourcemap: true,
},
plugins: [resolve(), commonJS()],
plugins: [resolve(), commonJS(), typescript({ module: "ESNext" })],
};
6 changes: 3 additions & 3 deletions packages/gitgraph-js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"target": "es5",
"target": "es6",
"module": "es2015",
"lib": [
"dom",
Expand All @@ -11,8 +11,8 @@
"declaration": true,
"sourceMap": true,
"removeComments": false,
"strict": true,
"noImplicitAny": true,
"strict": false,
"noImplicitAny": false,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
Expand Down
1 change: 1 addition & 0 deletions packages/gitgraph-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
"main": "./src/index.ts",
"scripts": {
"start": "rollup -c -w",
"example:default": "ts-node examples/default.ts",
"example:branches": "ts-node examples/branches.ts",
"version": "auto-changelog -p -l 0 --tag-prefix @gitgraph/node@ && git add CHANGELOG.md"
Expand Down
4 changes: 2 additions & 2 deletions packages/gitgraph-node/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"declaration": true,
"sourceMap": true,
"removeComments": false,
"strict": true,
"noImplicitAny": true,
"strict": false,
"noImplicitAny": false,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true
Expand Down
14 changes: 8 additions & 6 deletions packages/gitgraph-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
"publishConfig": {
"access": "public"
},
"main": "./lib/bundle.umd.js",
"module": "./lib/index.js",
"jsnext:main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"main": "dist/bundle.umd.js",
"module": "dist/bundle.umd.js",
"jsnext:main": "dist/index.es.js",
"typings:main": "dist/Gitgraph.d.ts",
"scripts": {
"start": "rollup -c -w",
"prewatch": "rimraf ./lib",
"watch": "tsc -w",
"build": "run-s build:*",
Expand All @@ -44,7 +45,8 @@
"version": "auto-changelog -p -l 0 --tag-prefix @gitgraph/react@ && git add CHANGELOG.md"
},
"dependencies": {
"@gitgraph/core": "1.5.0"
"@gitgraph/core": "1.5.0",
"@rollup/plugin-typescript": "8.5.0"
},
"peerDependencies": {
"react": ">= 16.8.0"
Expand All @@ -59,7 +61,7 @@
"react": "16.8.4",
"react-dom": "16.8.4",
"rimraf": "2.6.2",
"rollup": "0.51.8",
"rollup": "2.79.1",
"uglify-es": "3.3.9"
}
}
20 changes: 13 additions & 7 deletions packages/gitgraph-react/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import typescript from "@rollup/plugin-typescript";

const globals = {
"@gitgraph/core": "gitgraph.core",
react: "React",
};

export default {
input: "lib/index.js",
input: "src/index.tsx",
output: {
file: "lib/bundle.umd.js",
// name: "@gitgraph/react",
file: "dist/bundle.umd.js",
format: "umd",

name: "GitgraphReact",
exports: "named",
sourcemap: true,

globals: globals,
},
name: "GitgraphReact",
exports: "named",
sourcemap: true,
external: Object.keys(globals),
plugins: [typescript({ module: "ESNext" })],
onwarn,
globals,
};

function onwarn(message) {
Expand Down
4 changes: 2 additions & 2 deletions packages/gitgraph-react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"declaration": true,
"sourceMap": true,
"removeComments": false,
"strict": true,
"noImplicitAny": true,
"strict": false,
"noImplicitAny": false,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
Expand Down
14 changes: 7 additions & 7 deletions packages/stories/.storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import "storybook-chromatic";
import { addParameters, configure } from "@storybook/react";

addParameters({
options: {
name: "Gitgraph.js",
url: "https://github.com/nicoespeon/gitgraph.js/",
hierarchySeparator: "/",
},
});
// addParameters({
// options: {
// name: "Gitgraph.js",
// url: "https://github.com/nicoespeon/gitgraph.js/",
// hierarchySeparator: "/",
// },
// });

// Automatically import all files ending in *.stories.tsx
const req = require.context("../src", true, /.stories.tsx$/);
Expand Down
1 change: 1 addition & 0 deletions packages/stories/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
],
"license": "MIT",
"scripts": {
"start": "yarn storybook",
"storybook": "start-storybook -p 6006",
"test:e2e": "CHROMATIC_APP_CODE=fpva75oqc1g chromatic test --exit-zero-on-changes",
"build": "build-storybook"
Expand Down
17 changes: 17 additions & 0 deletions packages/stories/src/gitgraph-js/1-basic-usage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,23 @@ storiesOf("gitgraph-js/1. Basic usage", module)
}}
</GraphContainer>
))
.add("two branches", () => (
<GraphContainer>
{(graphContainer) => {
const gitgraph = createGitgraph(graphContainer, {
generateCommitHash: createFixedHashGenerator(),
});

const master = gitgraph.branch({
name: "master",
});

master.commit().commit().commit();
gitgraph.branch("develop");
console.log("Here too");
}}
</GraphContainer>
))
.add("branch label on every commit", () => (
<GraphContainer>
{(graphContainer) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/stories/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"declaration": true,
"sourceMap": true,
"removeComments": false,
"strict": true,
"noImplicitAny": true,
"strict": false,
"noImplicitAny": false,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"declaration": true,
"sourceMap": true,
"removeComments": false,
"strict": true,
"noImplicitAny": true,
"strict": false,
"noImplicitAny": false,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
Expand Down
Loading