Skip to content
Merged
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
27 changes: 27 additions & 0 deletions scripts/link-core-master.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env node
// Copyright 2020 Google LLC. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// =============================================================================

// This script updates package.json to link core at master.

const fs = require('fs');

let pkg = fs.readFileSync('package.json', 'utf8');

pkg = `${pkg}`.replace(
new RegExp(`"@tensorflow/tfjs-core": ".+"`, 'g'),
`"@tensorflow/tfjs-core": "link:../tfjs-core"`);

fs.writeFileSync('package.json', pkg);
2 changes: 1 addition & 1 deletion tfjs-converter/cloudbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ steps:
dir: 'tfjs-converter'
entrypoint: 'yarn'
id: 'build'
args: ['build']
args: ['build-ci']
waitFor: ['gen-json']

# Run javascript tests.
Expand Down
10 changes: 6 additions & 4 deletions tfjs-converter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
},
"license": "Apache-2.0",
"peerDependencies": {
"@tensorflow/tfjs-core": "1.6.0"
"@tensorflow/tfjs-core": "link:../tfjs-core"
},
"devDependencies": {
"@tensorflow/tfjs-core": "1.6.0",
"@tensorflow/tfjs-core": "link:../tfjs-core",
"@types/deep-equal": "^1.0.1",
"@types/jasmine": "~2.8.6",
"@types/long": "~3.0.32",
Expand Down Expand Up @@ -54,13 +54,15 @@
"yalc": "~1.0.0-pre.21"
},
"scripts": {
"build": "yarn gen-json --test && tsc",
"build": "yarn link-core-master && yarn gen-json --test && tsc",
"build-ci": "yarn gen-json --test && tsc",
"build-core": "cd ../tfjs-core && yarn && yarn build",
"build-core-ci": "cd ../tfjs-core && yarn && yarn build-ci",
"build-npm": "./scripts/build-npm.sh",
"link-local": "yalc link",
"link-core-master": "../scripts/link-core-master.js",
"publish-local": "yarn build-npm && yalc push",
"test": "yarn build-core && yarn && yarn gen-json --test && ts-node run_tests.ts",
"test": "yarn link-core-master && yarn build-core && yarn && yarn gen-json --test && ts-node run_tests.ts",
"test-ci": "ts-node run_tests.ts",
"test-snippets": "ts-node ./scripts/test_snippets.ts",
"lint": "tslint -p . -t verbose",
Expand Down
2 changes: 1 addition & 1 deletion tfjs-converter/scripts/build-npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set -e

rimraf dist/
yarn
yarn build
yarn build-ci
rollup -c

# Use minified files for miniprogram
Expand Down
14 changes: 3 additions & 11 deletions tfjs-converter/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,9 @@
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=

"@tensorflow/tfjs-core@1.6.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-core/-/tfjs-core-1.6.0.tgz#8a871de73995e0efc7ea5660df018402c788d285"
integrity sha512-b98jn1pjRuEDVNN6/ZQMFhyYV27ZIsG9CcHSMXq1ohX6ALQQB3mwgrMeC2TEVXFl6/L2vOD8W+txuBRGKHnvpg==
dependencies:
"@types/offscreencanvas" "~2019.3.0"
"@types/seedrandom" "2.4.27"
"@types/webgl-ext" "0.0.30"
"@types/webgl2" "0.0.4"
node-fetch "~2.1.2"
seedrandom "2.4.3"
"@tensorflow/tfjs-core@link:../tfjs-core":
version "0.0.0"
uid ""

"@types/deep-equal@^1.0.1":
version "1.0.1"
Expand Down