Skip to content

Commit

Permalink
Merge pull request #75 from sirensolutions/gar-migration
Browse files Browse the repository at this point in the history
[DEV-1426] G6 - Migrate to Yarn 4 and publish to GAR
  • Loading branch information
niknbr authored Nov 20, 2024
2 parents 5925140 + 612ab5f commit ed84d7f
Show file tree
Hide file tree
Showing 16 changed files with 1,028 additions and 37 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
es

# lock
Expand Down
25 changes: 25 additions & 0 deletions .yarn/plugins/@sirensolutions/yarn-plugin-gar-auth.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
name: `gar-auth`,
factory: require => {
const util = require('util');
const exec = util.promisify(require('child_process').exec);
let cachedToken

async function getToken() {
if (!cachedToken) {
const {stdout} = await exec('gcloud auth print-access-token');
cachedToken = stdout.trim();
}
return cachedToken;
}

return {
default: {
hooks: {
validateProject: getToken,
getNpmAuthenticationHeader: async () => `Bearer ${await getToken()}`
}
}
};
}
};
934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.5.1.cjs

npmPublishRegistry: "https://europe-west1-npm.pkg.dev/siren-cicd/npm-standard/"

npmScopes:
antv:
npmRegistryServer: "https://europe-west1-npm.pkg.dev/siren-cicd/npm-virtual/"

plugins:
- checksum: 7a993ef2944928530db74ca2f844dc21324bdc768bb0744b772277b114f28da4625903f4109fc90f3de6621e97c646f8969167df3435ee7e443d79b8a4806a62
path: .yarn/plugins/@sirensolutions/yarn-plugin-gar-auth.cjs
spec: "@sirensolutions/yarn-plugin-gar-auth.cjs"
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@

[![build](https://github.com/antvis/G6/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/antvis/G6/actions/) [![Coverage Status](https://coveralls.io/repos/github/antvis/G6/badge.svg?branch=master)](https://coveralls.io/github/antvis/G6?branch=master) ![typescript](https://img.shields.io/badge/language-typescript-red.svg) ![MIT](https://img.shields.io/badge/license-MIT-000000.svg) [![npm package](https://img.shields.io/npm/v/@antv/g6.svg)](https://www.npmjs.com/package/@antv/g6) [![NPM downloads](http://img.shields.io/npm/dm/@antv/g6.svg)](https://npmjs.org/package/@antv/g6) [![Percentage of issues still open](http://isitmaintained.com/badge/open/antvis/g6.svg)](http://isitmaintained.com/project/antvis/g6)

## Contributing

To set up the repo, run the following commands:

```shell
yarn
```

To publish, run the following commands for the package you want to publish (`core`, `element`, `plugin`, `pc`, `g6`):

```shell
yarn build:all
cd packages/core # Or: element, plugin, pc, g6
yarn npm publish
```

## What is G6

[G6](https://github.com/antvis/g6) is a graph visualization engine, which provides a set of basic mechanisms, including rendering, layout, analysis, interaction, animation, and other auxiliary tools. G6 aims to simplify the relationships, and help people to obtain the insight of relational data. Developers are able to build graph visualization **analysis** applications or graph visualization **modeling** applications easily.
Expand Down
29 changes: 12 additions & 17 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,26 @@ pipeline {

stage ('Boostrap') {
steps {
sh 'yarn && yarn bootstrap'
withCredentials([file(credentialsId: 'gcloud-jenkins-sirencicd', variable: 'GCLOUD_KEY_FILE')]) {
sh("""
set +x
gcloud auth activate-service-account --key-file="${GCLOUD_KEY_FILE}"
yarn
"""
)
}
}
}

stage('Deploy') {
steps {
withCredentials([
[
$class: 'UsernamePasswordMultiBinding',
credentialsId: 'artifactory-sirenpublisher',
usernameVariable: 'ARTIFACTORY_USERNAME',
passwordVariable: 'ARTIFACTORY_PASSWORD'
]
]) {
sh 'curl -u"${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD}" https://artifactory.siren.io/artifactory/api/npm/sirensolutions-npm-local/auth/antv > ~/.npmrc'
sh 'npm run build:all'
script {
['core', 'element', 'plugin', 'pc', 'g6'].each {
sh "cd packages/${it} && npm publish --registry=https://artifactory.siren.io/artifactory/api/npm/sirensolutions-npm-local && cd .."
}
sh 'yarn build'
script {
['core', 'element', 'plugin', 'pc', 'g6'].each {
sh "cd packages/${it} && yarn npm publish && cd .."
}
}
}
}

}

}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"pretty-quick": "pretty-quick",
"clean": "rimraf node_modules",
"bootstrap": "lerna bootstrap",
"ci": "npm run clean && npm run clean:modules && npm install && npm run bootstrap && npm run build:all && npm run lint:all && npm run test"
},
"husky": {
Expand Down Expand Up @@ -85,5 +84,6 @@
"normalize-url": "^7.2.0",
"sharp": "^0.30.4",
"electron": "23.3.13"
}
},
"packageManager": "yarn@4.5.1"
}
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@
"pre-commit": "^1.2.2",
"prettier": "^2.0.5",
"rimraf": "^3.0.0",
"stats-js": "^1.0.1",
"ts-jest": "^24.1.0",
"ts-loader": "^7.0.3",
"typescript": "^5.3.2",
"stats-js": "^1.0.1"
"typescript": "^5.3.2"
}
}
}
4 changes: 2 additions & 2 deletions packages/core/src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const colorSet = {
};

export default {
version: '0.8.24-siren.0',
version: '0.8.24-siren.1',
rootContainerClassName: 'root-container',
nodeContainerClassName: 'node-container',
edgeContainerClassName: 'edge-container',
Expand Down Expand Up @@ -252,6 +252,6 @@ export default {
windowFontFamily:
typeof window !== 'undefined' && window.getComputedStyle && document.body
? window.getComputedStyle(document.body, null).getPropertyValue('font-family') ||
'Arial, sans-serif'
'Arial, sans-serif'
: 'Arial, sans-serif',
};
6 changes: 3 additions & 3 deletions packages/element/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@antv/g6": "4.8.24-siren.1",
"@babel/core": "^7.7.7",
"@turf/turf": "^5.1.6",
"@types/jest": "^25.2.1",
Expand All @@ -87,7 +88,6 @@
"rimraf": "^3.0.0",
"ts-jest": "^24.1.0",
"ts-loader": "^7.0.3",
"typescript": "^5.3.2",
"@antv/g6": "4.8.24-siren.1"
"typescript": "^5.3.2"
}
}
}
2 changes: 1 addition & 1 deletion packages/g6/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@
"webpack": "^4.41.4",
"webpack-cli": "^3.3.10"
}
}
}
2 changes: 1 addition & 1 deletion packages/pc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@
"webpack-cli": "^3.3.10",
"worker-loader": "^3.0.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/pc/src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const textColor = 'rgb(0, 0, 0)';
const colorSet = getColorsWithSubjectColor(subjectColor, backColor);

export default {
version: '0.8.24-siren.0',
version: '0.8.24-siren.1',
rootContainerClassName: 'root-container',
nodeContainerClassName: 'node-container',
edgeContainerClassName: 'edge-container',
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"@antv/g6-core": "0.8.24-siren.1",
"@antv/g6-element": "0.8.24-siren.1",
"@antv/matrix-util": "^3.1.0-beta.3",
"@antv/path-util": "^2.0.3",
"@antv/scale": "^0.3.4",
"@antv/util": "^2.0.9",
"@antv/path-util": "^2.0.3",
"insert-css": "^2.0.0"
},
"sideEffects": false,
Expand All @@ -51,14 +51,14 @@
"access": "public"
},
"devDependencies": {
"@antv/g6": "4.8.24-siren.1",
"@types/jest": "^26.0.18",
"@umijs/fabric": "^2.0.0",
"event-simulate": "^1.0.1",
"father": "^2.30.0",
"jest": "^26.6.3",
"jquery": "^3.5.1",
"rimraf": "^3.0.2",
"ts-jest": "^26.4.4",
"@antv/g6": "4.8.24-siren.1"
"ts-jest": "^26.4.4"
}
}
}
4 changes: 2 additions & 2 deletions packages/react-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
]
},
"dependencies": {
"@antv/g6-core": "0.8.24-siren.1",
"@antv/g-base": "^0.5.1",
"@antv/g-canvas": "^0.5.2",
"@antv/g6-core": "0.8.24-siren.1",
"@types/yoga-layout": "^1.9.3",
"react": "^16.12.0",
"yoga-layout-prebuilt": "^1.10.0"
Expand All @@ -47,4 +47,4 @@
"prettier": "^1.19.1",
"yorkie": "^2.0.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@
"overrides": {
"@types/react": "^16.9.35"
}
}
}

0 comments on commit ed84d7f

Please sign in to comment.