Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes Yarn in favour of NPM. Updates nakama-js, nakama-js-prototbuf… #143

Merged
merged 4 commits into from
Jan 19, 2023

Conversation

tomglenn
Copy link
Contributor

… and satori-js build scripts and dependencies. Updates documentation to include satori-js.

… and satori-js build scripts and dependencies. Updates documentation to include satori-js.
@tomglenn
Copy link
Contributor Author

tomglenn commented Jan 18, 2023

@lugehorsam This PR doesn't currently change nakama-js-test or the other nakama example projects. How do we feel about merging this without updating those packages and updating them at a later date? I'm not hugely comfortable merging changes without the nakama-js-test repo, but as it stands the package doesn't build and run for me even on HEAD of master and the version of test packages is wildly out of date; e.g. puppeteer@5.4.2, latest is 19.5.2 and jest@26.6.0 (2 years old), latest is 29.3.1. the package also relies on Node 12.

My proposal would be to re-implement the test suite on modern Node (v18) and packages as a separate PR. Justification for getting this change in sooner (before test suite is redone) is to make the release of satori-js cleaner and more accessible to devs who will be using modern versions of Node.

@lugehorsam
Copy link
Contributor

@tomglenn I'm all for doing it in steps

@tomglenn tomglenn marked this pull request as ready for review January 18, 2023 16:31
@tomglenn
Copy link
Contributor Author

Cool, marked as ready. As discussed we'll go for an iterative approach. This PR gets us the main packages upgraded and switched over to npm.

// See the License for the specific language governing permissions and
// limitations under the License.

import esbuild from 'esbuild';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the .mjs extension?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an es6 module file. Recommended way of writing esbuild build scripts - https://esbuild.github.io/getting-started/#build-scripts

"whatwg-fetch": "^2.0.3"
},
"devDependencies": {
"@babel/runtime": "^7.12.5",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be removed for Satori? I think we still want to target all the same platforms including cocos creator.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also wondering about the other types of Javascript modules we publish (cjs, iife, umd) and if those should be applied to Satori as well.

Copy link
Contributor Author

@tomglenn tomglenn Jan 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whatwg-fetch should go back in yes (as well as js-base64 and base64-arraybuffer, good catch.)
babel isn't needed as esbuild handles transpiling.

Yep satori-js builds all the appropriate js module formats (specifically cjs, esm, iife and umd). I do need to add the rollup -c --bundleAsCjs back into the build script though.

@tomglenn tomglenn merged commit 9d3cca5 into master Jan 19, 2023
@tomglenn tomglenn deleted the tom/yarn-to-npm branch January 19, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants