Skip to content

Commit 710912f

Browse files
authored
build: Integrate moon. (#168)
* Update deps. * Init moon. * Test format. * Test lint. * Test build. * Clean up. * Update workflow. * Fix depth. * Add yarn install. * Fix test env var. * Fix tests. * Enable color. * Fix color. * Update ts. * Add jest configs. * Fix tests. * Update moon deps. * Add log. * Turn off fail fast. * Remove node options. * Update moon. * Update deps. * Update snapshots. * Update scripts. * Remove node 14. * Fix depth. * More deps. * Remove windows.
1 parent d9ce87c commit 710912f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+4265
-2995
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ umd/
1414
*.min.js
1515
*.map
1616
*.snap
17-
scenarios/
17+
scenarios/
18+
templates/

.github/workflows/build.yml

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,27 @@ on:
55
- master
66
pull_request:
77
jobs:
8-
test:
9-
name: Test
8+
ci:
9+
name: CI
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
os: [ubuntu-latest, windows-latest]
14-
node-version: [14, 16, 17]
15-
fail-fast: true
13+
os: [ubuntu-latest] # , windows-latest]
14+
node-version: [16, 18]
15+
fail-fast: false # true
1616
steps:
1717
- uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
1820
- uses: actions/setup-node@v3
1921
with:
2022
cache: yarn
21-
node-version: ${{ matrix.node-version }}
23+
- uses: moonrepo/tool-version-action@v1
24+
with:
25+
node: ${{ matrix.node-version }}
2226
- run: yarn install --immutable
2327
- run: yarn run setup
24-
- run: yarn run type
25-
- run: yarn run test # coverage
26-
- run: yarn run lint
28+
- run: yarn run moon --color --log debug ci
2729
integrate:
2830
name: Integrations
2931
runs-on: ubuntu-latest
@@ -43,33 +45,24 @@ jobs:
4345
runs-on: ubuntu-latest
4446
steps:
4547
- uses: actions/checkout@v3
48+
with:
49+
fetch-depth: 0
4650
- uses: actions/setup-node@v3
4751
with:
4852
cache: yarn
4953
- run: yarn install --immutable
5054
- run: yarn run setup
51-
- run: yarn run pack
55+
- run: yarn run moon run :build
5256
- run: yarn ts-node --cwd ./tests ./testPackemonImports.ts
5357
- run: node ./tests/testPackemonImports.cjs
5458
- run: node ./tests/testPackemonImports.mjs
55-
pack:
56-
name: Pack
57-
runs-on: ubuntu-latest
58-
steps:
59-
- uses: actions/checkout@v3
60-
- uses: actions/setup-node@v3
61-
with:
62-
cache: yarn
63-
- run: yarn install --immutable
64-
- run: yarn run setup
65-
- run: yarn run pack
66-
# Run again with packemon built files
67-
- run: yarn run pack
6859
scaffold-mono:
6960
name: Scaffold (monorepo)
7061
runs-on: ubuntu-latest
7162
steps:
7263
- uses: actions/checkout@v3
64+
with:
65+
fetch-depth: 0
7366
- uses: actions/setup-node@v3
7467
with:
7568
cache: yarn
@@ -81,12 +74,14 @@ jobs:
8174
# Test all the things
8275
- run: cd ../work
8376
- run: ls -R .
84-
- run: yarn run check
77+
- run: yarn run moon check --all
8578
scaffold-poly:
8679
name: Scaffold (polyrepo)
8780
runs-on: ubuntu-latest
8881
steps:
8982
- uses: actions/checkout@v3
83+
with:
84+
fetch-depth: 0
9085
- uses: actions/setup-node@v3
9186
with:
9287
cache: yarn
@@ -98,14 +93,4 @@ jobs:
9893
# Test all the things
9994
- run: cd ../work
10095
- run: ls -R .
101-
- run: yarn run check
102-
docs:
103-
name: Docs
104-
runs-on: ubuntu-latest
105-
steps:
106-
- uses: actions/checkout@v3
107-
- uses: actions/setup-node@v3
108-
with:
109-
cache: yarn
110-
- run: yarn install --immutable
111-
- run: cd website && yarn run build
96+
- run: yarn run moon check --all

.github/workflows/deploy.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ jobs:
3333
git config --global user.email "[email protected]"
3434
git config --global user.name "gh-actions"
3535
yarn install --immutable
36-
cd website
37-
yarn run deploy
36+
yarn run moon run website:deploy

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ logs/
33
*.log
44

55
# Cache
6+
.docusaurus
67
.eslintcache
78
.idea
89
.npm
@@ -23,6 +24,7 @@ mjs/
2324
tmp/
2425
umd/
2526
node_modules/
27+
templates/
2628
test/
2729
scenarios/*/build.js
2830

@@ -50,3 +52,7 @@ scripts/swc
5052
!.yarn/sdks
5153
!.yarn/versions
5254
.pnp.*
55+
56+
# moon
57+
.moon/cache
58+
.moon/docker

.moon/project.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
$schema: 'https://moonrepo.dev/schemas/global-project.json'
2+
3+
extends: 'https://raw.githubusercontent.com/moonrepo/dev/master/.moon/oss/project-packages.yml'
4+
5+
tasks:
6+
# Till V3 compat
7+
build:
8+
command: 'packemon'
9+
args:
10+
- 'build'
11+
- '--addEngines'
12+
- '--addExports'
13+
- '--declaration'
14+
inputs:
15+
- '@globs(sources)'
16+
- '@globs(typescript)'
17+
- 'package.json'
18+
outputs:
19+
- 'lib'
20+
env:
21+
NODE_ENV: 'production'

.moon/toolchain.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
$schema: 'https://moonrepo.dev/schemas/toolchain.json'
2+
3+
extends: 'https://raw.githubusercontent.com/moonrepo/dev/master/.moon/oss/toolchain.yml'

.moon/workspace.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
$schema: 'https://moonrepo.dev/schemas/workspace.json'
2+
3+
extends: 'https://raw.githubusercontent.com/moonrepo/dev/master/.moon/oss/workspace.yml'
4+
5+
projects:
6+
- 'packages/*'
7+
- 'website'

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18.12.0

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.docusaurus
12
.github/
23
.yarn/
34
node_modules/
@@ -10,6 +11,7 @@ esm/
1011
lib/
1112
mjs/
1213
umd/
14+
templates/
1315
CHANGELOG.md
1416
*.d.ts
1517
*.d.cts

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 497 additions & 33 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)