Skip to content
This repository was archived by the owner on Aug 15, 2019. It is now read-only.

Commit bb46e84

Browse files
authored
Update publish-npm.sh script and point to unpkg.com in README (#185)
* feature perf rnn on the homepage * review * update publish-npm script * website css tweak
1 parent ffdc100 commit bb46e84

File tree

6 files changed

+13
-65
lines changed

6 files changed

+13
-65
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ math.scope(() => {
4040
#### ES3/ES5 JavaScript
4141

4242
You can also use **deeplearn.js** with plain JavaScript. Load the latest version
43-
of the library directly from the Google CDN:
43+
of the library from [unpkg](https://unpkg.com):
4444

4545
```html
46-
<script src="https://storage.googleapis.com/learnjs-data/deeplearn-latest.js"></script>
46+
<script src="https://unpkg.com/deeplearn"></script>
4747
```
4848

4949
To use a specific version, replace `latest` with a version number
@@ -105,8 +105,8 @@ To build a standalone ES5 library that can be imported in the browser with a
105105
`<script>` tag:
106106

107107
```bash
108-
$ ./scripts/build-standalone.sh VERSION # Builds standalone library.
109-
>> Stored standalone library at dist/deeplearn-VERSION(.min).js
108+
$ ./scripts/build-standalone.sh # Builds standalone library.
109+
>> Stored standalone library at dist/deeplearn(.min).js
110110
```
111111

112112
To do a dry run and test building an npm package:

demos/homepage/assets/style.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,11 @@ ul.index {
222222
padding: 5px 12px;
223223
font-weight: 400;
224224
font-size: 48px;
225-
margin: 0 0px 2px 2px;
226225
}
227226

228227
.featured-demo h1.mdl-card__title-text {
229228
background-color: rgba(0, 0, 0, .54);
230-
font-size: 48px;
229+
font-size: 36px;
231230
margin: 0 0 2px 2px;
232231
padding: 5px 12px;
233232
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "deeplearn",
3-
"version": "0.2.9",
3+
"version": "0.2.10",
44
"description": "Hardware-accelerated JavaScript library for machine intelligence",
55
"private": false,
66
"main": "dist/src/index.js",

scripts/build-standalone.sh

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
# =============================================================================
16-
if [ -z "$1" ]
17-
then
18-
echo "No version number found."
19-
exit
20-
fi
21-
22-
echo "Building version $1"
23-
24-
npm run prep
25-
26-
node_modules/.bin/browserify --standalone deeplearn src/index.ts -p [tsify] > dist/deeplearn-$1.js
27-
node_modules/.bin/uglifyjs dist/deeplearn-$1.js > dist/deeplearn-$1.min.js
28-
29-
cp dist/deeplearn-$1.js dist/deeplearn.js
30-
cp dist/deeplearn-$1.min.js dist/deeplearn.min.js
31-
32-
cp dist/deeplearn-$1.js dist/deeplearn-latest.js
33-
cp dist/deeplearn-$1.min.js dist/deeplearn-latest.min.js
34-
35-
echo "Stored standalone library at dist/deeplearn-$1(.min).js"
16+
rm -rf dist/ && \
17+
npm run prep && \
18+
node_modules/.bin/browserify --standalone deeplearn src/index.ts -p [tsify] > dist/deeplearn.js && \
19+
node_modules/.bin/uglifyjs dist/deeplearn.js > dist/deeplearn.min.js && \
20+
echo "Stored standalone library at dist/deeplearn(.min).js"

scripts/publish-npm.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
# =============================================================================
16-
npm run prep && \
1716
rm -rf dist/ && \
18-
./scripts/build-standalone.sh $1 && \
17+
npm run prep && \
18+
./scripts/build-standalone.sh && \
1919
node_modules/.bin/tsc && \
2020
npm publish
2121
echo 'Yay! Published a new package to npm.'

scripts/publish-standalone.sh

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)