Skip to content

Add npm workspaces & tool-specific config files, drop make #569

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

Merged
merged 15 commits into from
Sep 13, 2021
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
7 changes: 4 additions & 3 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ root: true
env:
es6: true

parserOptions:
ecmaVersion: 2018
sourceType: module

overrides:
- files: ["*/src/*.js"]
extends:
- ./eslint-base.yaml
parserOptions:
ecmaVersion: 9
sourceType: module

- files: ["*/src/*.ts"]
parser: "@typescript-eslint/parser"
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/fluent-bundle.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/fluent-dedent.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/fluent-gecko.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/fluent-langneg.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/fluent-sequence.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/fluent-syntax.yml

This file was deleted.

19 changes: 9 additions & 10 deletions .github/workflows/fluent-dom.yml → .github/workflows/legacy.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
name: "@fluent/dom"
name: legacy
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: It will help with maintenance to document why this is legacy, and maybe how to migrate it to not be legacy anymore.

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
dist:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12.x, 14.x, 16.x]
node: [12.x, 14.x]
Copy link
Member

Choose a reason for hiding this comment

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

question (blocking): How are you manually testing the CI changes. I'd like to ensure this works before it's merged in.

Copy link
Member Author

Choose a reason for hiding this comment

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

I ran the tests here: https://github.com/eemeli/fluent.js/actions

I also added workflow_dispatch to the on map (line 7), which enables manually running the workflow.

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{matrix.node}}
uses: actions/setup-node@v1
with:
node-version: ${{matrix.node}}
- name: Install build tools
run: npm ci
- name: Install package dependencies
working-directory: ./fluent-dom
run: npm ci
- name: make dist
working-directory: ./fluent-dom
run: make dist
- run: npm install --global npm@7
- run: npm ci
- run: npm run build --workspaces
- run: npm test
- run: npm run lint
- run: npm run docs --workspaces
18 changes: 8 additions & 10 deletions .github/workflows/fluent-react.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
name: "@fluent/react"
name: test
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
dist:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12.x, 14.x, 16.x]
node: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{matrix.node}}
uses: actions/setup-node@v1
with:
node-version: ${{matrix.node}}
- name: Install build tools
run: npm ci
- name: Install package dependencies
working-directory: ./fluent-react
run: npm ci
- name: make dist
working-directory: ./fluent-react
run: make dist
- run: npm ci
- run: npm run build --workspaces
- run: npm test
- run: npm run lint
- run: npm run docs --workspaces
4 changes: 4 additions & 0 deletions .mocharc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ignore:
- fluent-dom/**
- fluent-react/**
ui: tdd
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,25 @@ Hacking on `fluent.js` is easy! To quickly get started clone the repo:
$ git clone https://github.com/projectfluent/fluent.js.git
$ cd fluent.js

You'll need at least Node.js 12 LTS. Older versions are not supported.
You'll need at least **Node.js 12** and **npm v7**.
Older versions are not supported.

Install the build tools used by all packages (Babel, Rollup, Mocha etc.):
Install the dependencies used by all packages, which are managed as
[npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces):

$ npm install

Install dependencies of individual `fluent.js` packages which are required for
passing tests:
Build and test all packages at once:

$ make deps
Copy link
Member

Choose a reason for hiding this comment

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

praise: Thanks, this nicer not have to deal with make for installing dependencies.


Build all packages at once:

$ make
$ npm run dist

…which is equivalent to:

$ make lint
$ make test
$ make build
$ npm run clean
$ npm run build --workspaces
$ npm run lint
$ npm run test
$ npm run docs --workspaces

You can also `cd` into a package's directory and issue the above `make`
commands from there. Only this one package will be affected.
Each package may also be built separately by running `npm run build` in
its directory.
55 changes: 0 additions & 55 deletions common.mk

This file was deleted.

2 changes: 1 addition & 1 deletion fluent-bundle/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @fluent/bundle ![](https://github.com/projectfluent/fluent.js/workflows/@fluent/bundle/badge.svg)
# @fluent/bundle ![](https://github.com/projectfluent/fluent.js/workflows/test/badge.svg)

`@fluent/bundle` is a JavaScript implementation of [Project Fluent][],
optimized for runtime performance.
Expand Down
3 changes: 3 additions & 0 deletions fluent-bundle/esm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
Loading