diff --git a/js/Makefile b/js/Makefile index 9086796f59..11bada339e 100644 --- a/js/Makefile +++ b/js/Makefile @@ -3,6 +3,10 @@ export PATH := $(PWD)/node_modules/.bin:$(PATH) UNAME_S ?= $(shell uname -s) +author = Berty Technologies +contributor = $(shell git config --get user.name) <$(shell git config --get user.email)> +license = (Apache-2.0 or MIT) + ifeq ($(UNAME_S),Darwin) export SHELL = /bin/bash npm := /usr/local/bin/npm @@ -24,15 +28,13 @@ lerna_flags := --reject-cycles --concurrency=8 lerna_upgrade := $(bin)/upd lerna_exec := $(lerna) $(lerna_flags) exec --stream --parallel --scope=$1 -- +json := $(bin)/json + eslint := $(bin)/eslint pkg ?= $(shell find $(PWD)/packages -depth 1 -type d) pkg_mod := $(patsubst %, %/node_modules, $(pkg)) - -include packages/berty-app/Makefile -include packages/storybook-mobile/Makefile -include packages/storybook-web/Makefile -include packages/react-native-core/Makefile +pkg_desc := $(patsubst %, %/node_modules, $(pkg)) .DEFAULT_GOAL := deps @@ -80,27 +82,36 @@ fclean: fclean .PHONY: pkg pkg: name ?= example +pkg: export PWD := $(PWD) pkg: $(mod) lerna create @berty-tech/$(name) \ --access restricted \ --private \ - --license '(Apache-2.0 OR MIT)' \ - --yes \ + --license '$(license)' \ + --yes + cd $(PWD)/packages/$(name) \ + && $(json) -I -f package.json -e "this.description=''" \ + && $(json) -I -f package.json -e "this.author='$(author)'" .PHONY: rnpkg rnpkg: name ?= example +rnpkg: export PWD := $(PWD) rnpkg: $(mod) - cd packages && create-react-native-module \ - --platforms ios,android \ - --prefix Berty$(shell echo "$(name)" | caser --pascal $(name)) \ - --package-identifier tech.berty.$(name) \ - --license '(Apache-2.0 OR MIT)' \ - --use-cocoapods \ - --github-account berty \ - --author-name 'Berty Technologies' \ - --author-email oss@berty.tech \ - $(name) - rm -f packages/$(name)/README.md + cd $(PWD)/packages \ + && create-react-native-module \ + --platforms ios,android \ + --prefix Berty$(shell echo "$(name)" | caser --pascal $(name)) \ + --package-identifier tech.berty.$(name) \ + --license '$(license)' \ + --use-cocoapods \ + --github-account berty \ + $(name) + cd $(PWD)/packages/react-native-$(name) \ + && rm -rf README.md \ + && $(json) -I -f package.json -e "this.name='@berty-tech/$(name)'" \ + && $(json) -I -f package.json -e "this.description=''" + && $(json) -I -f package.json -e "this.author='$(author)'" \ + && $(json) -I -f package.json -e "this.licenseFilename=undefined" \ .PHONY: lint lint: export PWD := $(PWD) @@ -118,3 +129,9 @@ lint.fix: lint .PHONY: lint.watch lint.watch: options += --watch lint.watch: lint + +include packages/berty-app/Makefile +include packages/storybook-mobile/Makefile +include packages/storybook-web/Makefile +include packages/react-native-core/Makefile + diff --git a/js/package-lock.json b/js/package-lock.json index 0321f027ee..de5f9f426a 100644 --- a/js/package-lock.json +++ b/js/package-lock.json @@ -5872,6 +5872,11 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, + "json": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/json/-/json-9.0.6.tgz", + "integrity": "sha1-eXLCpaSKQmeNsnMMfCxO5uTiRYU=" + }, "json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", diff --git a/js/package.json b/js/package.json index 323532fe82..d3d69a291e 100644 --- a/js/package.json +++ b/js/package.json @@ -11,11 +11,10 @@ "type": "git", "url": "git+ssh://git@github.com/berty/berty.git" }, - "author": { - "username": "berty", - "name": "Berty Technologies", - "email": "oss@berty.tech" - }, + "author": "Berty Technologies ", + "contributors": [ + "Godefroy Ponsinet " + ], "license": "(Apache-2.0 OR MIT)", "bugs": { "url": "https://github.com/berty/berty/issues" @@ -25,6 +24,7 @@ "caser": "^0.1.1", "create-react-native-module": "^0.10.2", "eslint-plugin-jest": "^22.17.0", + "json": "^9.0.6", "lerna": "^3.16.4", "lerna-update-wizard": "^0.16.0", "react-native-create-library": "^3.1.2", diff --git a/js/packages/react-native-core/package.json b/js/packages/react-native-core/package.json index 5a5181f091..d600fc4f01 100644 --- a/js/packages/react-native-core/package.json +++ b/js/packages/react-native-core/package.json @@ -20,7 +20,6 @@ "email": "staff@berty-tech.tech" }, "license": "(Apache-2.0 OR MIT)", - "licenseFilename": "LICENSE", "readmeFilename": "README.md", "peerDependencies": { "react": "^16.8.1", diff --git a/js/packages/react-native-example/package.json b/js/packages/react-native-example/package.json index a701fb679f..a806b4d89f 100644 --- a/js/packages/react-native-example/package.json +++ b/js/packages/react-native-example/package.json @@ -20,7 +20,6 @@ "email": "staff@berty-tech.tech" }, "license": "(Apache-2.0 OR MIT)", - "licenseFilename": "LICENSE", "readmeFilename": "README.md", "peerDependencies": { "react": "^16.8.1",