Skip to content

Commit

Permalink
Merge pull request #49 from sirensolutions/gar-migration
Browse files Browse the repository at this point in the history
[DEV-1426] Migrate to Yarn 4 and publish to GAR
  • Loading branch information
niknbr authored Nov 20, 2024
2 parents 0032fc6 + ad0c483 commit 26ff593
Show file tree
Hide file tree
Showing 17 changed files with 48,225 additions and 45 deletions.
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ build
package-lock.json


# yarn-lock
yarn.lock
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

.umi

Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.11.0
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

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

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

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

plugins:
- checksum: 7a993ef2944928530db74ca2f844dc21324bdc768bb0744b772277b114f28da4625903f4109fc90f3de6621e97c646f8969167df3435ee7e443d79b8a4806a62
path: .yarn/plugins/@sirensolutions/yarn-plugin-gar-auth.cjs
spec: "@sirensolutions/yarn-plugin-gar-auth.cjs"
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ A React toolkit for graph analysis based on G6

<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18"> English | [简体中文](./README.zh-CN.md)

## 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 (`graphin-icons`, `graphin`, `graphin-components`):
```shell
cd package/graphin-icons
yarn build
yarn npm publish
```

## 🌾 New Products!

2022.06.06, this day coincides with the 4th anniversary of the open source of G6, which is also the traditional Chinese solar term: "Grain in Ear", G6VP, a new product in the direction of graph analysis. Users can complete the visualization, exploration and analysis tasks of relational data online without code development. You can also export the SDK with one click and integrate it into the business system to help developers improve R&D efficiency.
Expand Down
27 changes: 11 additions & 16 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,25 @@ pipeline {

stage ('Boostrap') {
steps {
sh 'yarn && yarn bootstrap:ci'
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'
script {
['graphin-icons', 'graphin', 'graphin-components'].each {
sh "cd packages/${it} && npm run build && mv .npmrc .npmrc.bak && npm publish --no-workspaces --registry=https://artifactory.siren.io/artifactory/api/npm/sirensolutions-npm-local && mv .npmrc.bak .npmrc && cd .."
}
script {
['graphin-icons', 'graphin', 'graphin-components'].each {
sh "cd packages/${it} && yarn build && yarn npm publish && cd .."
}
}
}
}

}

}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"docs:deploy": "gh-pages -d dist",
"docs:deploy-2": "gh-pages -d ./dist -r https://github.com/antvis/graphin-docs.git",
"remove:deps": "rm -rf packages/graphin/node_modules/antd && rm -rf packages/graphin/node_modules/@ant-design/icons && rm -rf packages/graphin-components/node_modules/antd && rm -rf packages/graphin-components/node_modules/@ant-design/icons && rm -rf packages/graphin-icons/node_modules/@ant-design/icons && rm -rf packages/graphin-icons/node_modules/antd && rm -rf packages/dumi-theme-graphin/node_modules/@ant-design/icons && rm -rf packages/dumi-theme-graphin/node_modules/antd",
"bootstrap:ci": "lerna bootstrap --ignore @antv/graphin-studio --ignore graphin-site --ignore @antv/graphin-graphscope",
"build": "lerna run build",
"contributor": "git-contributor",
"clean": "lerna clean && npm run rm-package-lock",
Expand All @@ -33,6 +32,7 @@
"release:patch": "changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags"
},
"devDependencies": {
"@antv/dumi-theme-antv": "0.2.0",
"@types/jest": "^27.0.3",
"@types/react": "^16.9.11",
"@types/react-dom": "^16.9.3",
Expand All @@ -44,7 +44,6 @@
"d3": "^6.3.1",
"d3-selection": "^2.0.0",
"dumi": "^1.1.35",
"@antv/dumi-theme-antv": "0.2.0",
"eslint": "^7.18.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^7.2.0",
Expand Down Expand Up @@ -97,5 +96,10 @@
"resolutions": {
"@typescript-eslint/eslint-plugin": "^4.14.0",
"@typescript-eslint/parser": "^4.14.0"
}
},
"engines": {
"node": "22.11.0",
"yarn": "4.5.1"
},
"packageManager": "yarn@4.5.1"
}
1 change: 0 additions & 1 deletion packages/graphin-components/.npmrc

This file was deleted.

10 changes: 5 additions & 5 deletions packages/graphin-components/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@antv/graphin-components",
"version": "2.4.0-siren.38",
"version": "2.4.0-siren.39",
"description": "Components for graphin",
"main": "lib/index.js",
"module": "es/index.js",
"types": "lib/index.d.ts",
"scripts": {
"start": "npm run clean && father build --watch",
"build": "npm run clean && father build & npm run build:umd",
"build:umd": "node --max_old_space_size=8192 ./node_modules/webpack/bin/webpack.js --mode production -c ./webpack.config.js ",
"build:umd": "webpack --mode production -c ./webpack.config.js",
"test": "jest",
"clean": "rimraf es esm lib dist"
},
Expand Down Expand Up @@ -55,8 +55,8 @@
"webpack-cli": "^4.9.1"
},
"dependencies": {
"@antv/util": "^2.0.10",
"@antv/graphin": "2.7.17-siren.0"
"@antv/graphin": "2.7.17-siren.1",
"@antv/util": "^2.0.10"
},
"peerDependencies": {
"react": ">=16.9.0",
Expand All @@ -65,4 +65,4 @@
"publishConfig": {
"access": "public"
}
}
}
12 changes: 6 additions & 6 deletions packages/graphin-graphscope/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "@antv/graphin-graphscope",
"version": "1.0.3-siren.36",
"version": "1.0.3-siren.37",
"description": "An Example for GraphScope",
"main": "lib/index.js",
"module": "es/index.js",
"types": "lib/index.d.ts",
"scripts": {
"start": "father build --watch",
"build": "npm run clean && father build",
"build:umd": "rimraf dist && node --max_old_space_size=8192 ./node_modules/webpack/bin/webpack.js --env.NODE_ENV=production -c ./webpack.config.js ",
"build:umd": "rimraf dist && webpack --mode production --env.NODE_ENV=production -c ./webpack.config.js",
"clean": "rimraf es esm lib dist"
},
"dependencies": {
"@ant-design/icons": "^4.3.0",
"@antv/graphin": "2.7.17-siren.0",
"@antv/graphin-components": "2.4.0-siren.38",
"@antv/graphin-icons": "1.0.0-siren.38",
"@antv/graphin": "2.7.17-siren.1",
"@antv/graphin-components": "2.4.0-siren.39",
"@antv/graphin-icons": "1.0.0-siren.39",
"antd": "^4.10.3",
"classnames": "^2.2.6",
"re-resizable": "^6.9.0",
Expand Down Expand Up @@ -61,4 +61,4 @@
],
"author": "AntV",
"license": "MIT"
}
}
1 change: 0 additions & 1 deletion packages/graphin-icons/.npmrc

This file was deleted.

6 changes: 3 additions & 3 deletions packages/graphin-icons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/graphin-icons",
"version": "1.0.0-siren.38",
"version": "1.0.0-siren.39",
"description": "graphin icon fonts",
"main": "./dist/index",
"scripts": {
Expand All @@ -22,6 +22,6 @@
"access": "public"
},
"devDependencies": {
"father": "2.30.0"
"father": "^2.30.16"
}
}
}
1 change: 0 additions & 1 deletion packages/graphin/.npmrc

This file was deleted.

12 changes: 6 additions & 6 deletions packages/graphin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/graphin",
"version": "2.7.17-siren.0",
"version": "2.7.17-siren.1",
"description": "the react toolkit for graph analysis based on g6",
"main": "lib/index.js",
"module": "es/index.js",
Expand All @@ -13,7 +13,7 @@
"scripts": {
"start": "npm run clean && father build --watch",
"build": "npm run clean && father build && npm run build:umd",
"build:umd": "node --max_old_space_size=8192 ./node_modules/webpack/bin/webpack.js --mode production -c ./webpack.config.js",
"build:umd": "webpack --mode production -c ./webpack.config.js",
"test": "jest",
"prettier": "prettier --write ./src/**/**/**/*.js",
"clean": "rimraf es esm lib dist"
Expand All @@ -24,7 +24,6 @@
"directory": "packages/graphin"
},
"devDependencies": {
"@types/node": "latest",
"@antv/g-base": "^0.5.9",
"@antv/hierarchy": "^0.6.6",
"@babel/core": "^7.16.0",
Expand All @@ -33,6 +32,7 @@
"@types/d3-quadtree": "^3.0.2",
"@types/jest": "^27.0.3",
"@types/lodash-es": "^4.17.5",
"@types/node": "latest",
"cross-env": "^5.2.0",
"css-loader": "^1.0.1",
"eventemitter3": "^4.0.0",
Expand Down Expand Up @@ -61,11 +61,11 @@
"author": "AntV",
"license": "MIT",
"dependencies": {
"@antv/g6": "4.8.24-siren.1",
"@antv/util": "^2.0.10",
"@types/lodash.clonedeep": "^4.5.6",
"d3-quadtree": "^3.0.1",
"lodash.clonedeep": "^4.5.0",
"@antv/g6": "4.8.24-siren.1"
"lodash.clonedeep": "^4.5.0"
},
"peerDependencies": {
"react": ">=16.9.0",
Expand All @@ -74,4 +74,4 @@
"publishConfig": {
"access": "public"
}
}
}
Loading

0 comments on commit 26ff593

Please sign in to comment.