Merge pull request #238 from pybricks/dlech

updates
This commit is contained in:
David Lechner
2021-01-11 16:51:01 -06:00
committed by GitHub
11 changed files with 29 additions and 55 deletions
-3
View File
@@ -12,11 +12,8 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: '12.x'
registry-url: 'https://npm.pkg.github.com'
- uses: actions/checkout@v2
- run: yarn install
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: yarn coverage
- name: Coveralls
uses: coverallsapp/github-action@master
-3
View File
@@ -16,11 +16,8 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: '12.x'
registry-url: 'https://npm.pkg.github.com'
- uses: actions/checkout@v2
- run: yarn install
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
yarn lint
git diff --exit-code
-1
View File
@@ -1 +0,0 @@
@pybricks:registry=https://npm.pkg.github.com
-1
View File
@@ -1 +0,0 @@
"@pybricks:registry" "https://npm.pkg.github.com"
-25
View File
@@ -4,28 +4,6 @@
These are the tools you will need to build and run `pybricks-code` locally.
## Important Note about Github Packages
**This step is mandatory and cannot be skipped. Otherwise you will have no access to some referenced dependencies in [package.json](./package.json)!**
We are currently depending on a couple of packages from the Github package
registry. [Github requires you](https://docs.github.com/en/free-pro-team@latest/packages/guides/configuring-npm-for-use-with-github-packages#authenticating-with-a-personal-access-token) to log in first before you can install public packages.
To do this, first you will need to create a new authentication token at
<https://github.com/settings/tokens>.
- Click the *Generate a new token* button.
- Select the **repo** and **read:packages** scopes.
- Click the *Generate token* button.
- Click the clipboard icon top copy the token to be used below.
Then run the following command and enter your username, authentication token
and email:
npm login --registry=https://npm.pkg.github.com
This only needs to be done once.
## IDE
Technically you can use any text editor you like but the project is set up to
@@ -68,9 +46,6 @@ where you would like to save the source code and run:
cd pybricks-code
yarn install
If you see a 401 not authorized error after running `yarn install`, then you
probably skipped the logging into the Github package registry as [described above](#important-note-about-github-packages).
# Software Stack
This project was bootstrapped with [Create React App][create-react-app].
+17 -1
View File
@@ -1,6 +1,11 @@
// https://github.com/gsoft-inc/craco/blob/master/packages/craco/README.md#configuration
const { getLoader, getLoaders, loaderByName } = require('@craco/craco');
const {
addBeforeLoader,
getLoader,
getLoaders,
loaderByName,
} = require('@craco/craco');
module.exports = {
webpack: {
@@ -45,6 +50,17 @@ module.exports = {
/\.json$/,
];
// work around default handling of .wasm files
// https://github.com/webpack/webpack/issues/7352
addBeforeLoader(webpackConfig, loaderByName('file-loader'), {
test: /\.wasm$/,
type: 'javascript/auto',
loader: 'file-loader',
options: {
name: 'static/[name].[hash:8].[ext]',
},
});
return webpackConfig;
},
},
+2 -5
View File
@@ -5,8 +5,8 @@
"dependencies": {
"@blueprintjs/core": "^3.36.0",
"@craco/craco": "^6.0.0",
"@pybricks/firmware": "4.3.0",
"@pybricks/mpy-cross-v5": "^1.1.0",
"@pybricks/firmware": "4.4.0",
"@pybricks/mpy-cross-v5": "^1.2.0",
"@shopify/react-i18n": "^5.2.0",
"@testing-library/dom": "^7.29.2",
"@testing-library/jest-dom": "^5.11.8",
@@ -43,7 +43,6 @@
"zen-push": "^0.2.1"
},
"scripts": {
"prepare": "mkdirp public/static/js && ncp node_modules/@pybricks/mpy-cross-v5/build/mpy-cross.wasm src/sagas/mpy-cross.emcwasm",
"start": "craco start",
"build": "craco build",
"test": "craco test --env=./test/env.js",
@@ -76,8 +75,6 @@
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"jest-mock-extended": "^1.0.9",
"mkdirp": "^1.0.4",
"ncp": "^2.0.0",
"prettier": "^2.2.1"
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ declare module '*.json' {
export default src;
}
declare module '*.emcwasm' {
declare module '*.wasm' {
const src: string;
export default src;
}
-1
View File
@@ -1 +0,0 @@
*.emcwasm
+1 -1
View File
@@ -2,6 +2,7 @@
// Copyright (c) 2020 The Pybricks Authors
import { CompileResult, compile as mpyCrossCompile } from '@pybricks/mpy-cross-v5';
import wasm from '@pybricks/mpy-cross-v5/build/mpy-cross.wasm';
import { call, put, takeEvery } from 'redux-saga/effects';
import {
MpyActionType,
@@ -9,7 +10,6 @@ import {
didCompile,
didFailToCompile,
} from '../actions/mpy';
import wasm from './mpy-cross.emcwasm';
/**
* Compiles a script to .mpy and dispatches either didCompile on success or
+8 -13
View File
@@ -1484,17 +1484,17 @@
schema-utils "^2.6.5"
source-map "^0.7.3"
"@pybricks/firmware@4.3.0":
version "4.3.0"
resolved "https://npm.pkg.github.com/download/@pybricks/firmware/4.3.0/89f260a050abcc837c803b7851edcb234944d5aff0a2f45706b556796fbc3a45#817b3bd9aa3daf77c80b67a5c5d5776779773491"
integrity sha512-5cTtBpTtRa0P98DS+M2WswYsF4FCQdeL65tMZd98S47sjZn/Yzw6AJzhSFfZHPJbRQzqDcHJm065awQHb7SXMg==
"@pybricks/firmware@4.4.0":
version "4.4.0"
resolved "https://registry.yarnpkg.com/@pybricks/firmware/-/firmware-4.4.0.tgz#bdb7fd5476b914533b09d796fb2d98ec1e911ae1"
integrity sha512-le6EgkipT74D5lmi47FJa2B/Jms4XuRbh6ReoUH9bgaW5TolmE4wwN67uwA2c3fVY16ApCMe9dZoj/5y6ai50w==
dependencies:
jszip "^3.5.0"
"@pybricks/mpy-cross-v5@^1.1.0":
version "1.1.0"
resolved "https://npm.pkg.github.com/download/@pybricks/mpy-cross-v5/1.1.0/01b9fe3498310264b7b826d7bb596ef593b3b92de93503933ca14fb9efb5160e#5fe7eb7f5b8d0f783c16eab92d4e1b96bcfba0cb"
integrity sha512-rARDzR1/PfzGLJVnyOeDRSsWmdHOPSQed0IeRG8T3YpFSGywR8z/UoSq1jurVETZvSEIOj1P4nmd0ZAPa3+bMA==
"@pybricks/mpy-cross-v5@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@pybricks/mpy-cross-v5/-/mpy-cross-v5-1.2.0.tgz#29cbd949c579c0551792d2fd1cd777d193aa925c"
integrity sha512-A1FXGP0teuZa3tPBTz9niCdEol4Ld6jOABl9FkglmutGWO99eLwuyYibh8wQqHNKwXRHrzCJmo/W+/42HmSjog==
"@redux-saga/core@^1.1.3":
version "1.1.3"
@@ -8266,11 +8266,6 @@ natural-compare@^1.4.0:
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
ncp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3"
integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=
negotiator@0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"