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

breaking: v5 #234

Merged
merged 7 commits into from
Feb 21, 2024
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
File renamed without changes.
25 changes: 13 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
branches:
- master
pull_request:
env:
YARN_IGNORE_NODE: 1
jobs:
ci:
name: CI
Expand All @@ -14,10 +16,10 @@ jobs:
node-version: [18, 20]
fail-fast: false # true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: yarn
- uses: moonrepo/tool-version-action@v1
Expand All @@ -30,8 +32,8 @@ jobs:
name: Integrations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: yarn
- run: yarn install --immutable
Expand All @@ -44,26 +46,25 @@ jobs:
name: Compatibility
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: yarn
- run: yarn install --immutable
- run: yarn run setup
- run: yarn run moon run :build
- run: yarn ts-node --cwd ./tests ./testPackemonImports.ts
- run: node ./tests/testPackemonImports.cjs
# - run: yarn ts-node --cwd ./tests --transpileOnly ./testPackemonImports.ts
- run: node ./tests/testPackemonImports.mjs
scaffold-mono:
name: Scaffold (monorepo)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: yarn
- run: yarn install --immutable
Expand All @@ -79,10 +80,10 @@ jobs:
name: Scaffold (polyrepo)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: yarn
- run: yarn install --immutable
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: yarn
- name: Add key to allow access to repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ jobs:
name: Conventional Title
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: yarn
- uses: beemojs/conventional-pr-action@v2
Expand Down
3 changes: 3 additions & 0 deletions .moon/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ tasks:
NODE_ENV: 'production'

test:
command: 'vitest run --config ../../vitest.config.ts'
inputs:
- '/vitest.config.ts'
deps:
- '^:build'

Expand Down
4 changes: 4 additions & 0 deletions .moon/toolchain.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
$schema: 'https://moonrepo.dev/schemas/toolchain.json'

extends: 'https://raw.githubusercontent.com/moonrepo/dev/master/.moon/toolchain.yml'

node:
yarn:
version: '4.1.0'
672 changes: 336 additions & 336 deletions .yarn/releases/yarn-4.0.2.cjs → .yarn/releases/yarn-4.1.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ enableTelemetry: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs
yarnPath: .yarn/releases/yarn-4.1.0.cjs
22 changes: 0 additions & 22 deletions babel.config.js

This file was deleted.

13 changes: 0 additions & 13 deletions jest.config.js

This file was deleted.

26 changes: 12 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"scripts": {
"docs": "yarn run moon run website:start",
"moon": "$(yarn bin moon)",
"clean": "rm -rf packages/*/{cjs,lib}",
"packemon": "node ./packages/packemon/cjs/bin.cjs",
"clean": "rm -rf packages/*/{cjs,lib,mjs}",
"packemon": "node ./packages/packemon/mjs/bin.mjs",
"prerelease": "yarn run setup && yarn run moon run :build -u",
"release": "yarn prerelease && lerna-release",
"setup": "node ./scripts/buildPackages.mjs",
Expand All @@ -23,33 +23,31 @@
"devDependencies": {
"@babel/cli": "^7.23.9",
"@babel/core": "^7.23.9",
"@moonrepo/cli": "^1.21.1",
"@moonrepo/cli": "^1.21.4",
"@moonrepo/dev": "^2.0.1",
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.12",
"@swc/cli": "^0.3.9",
"@types/micromatch": "^4.0.6",
"@types/node": "^16.18.79",
"@types/react": "^18.2.55",
"@types/semver": "^7.5.6",
"@types/node": "^16.18.82",
"@types/react": "^18.2.57",
"@types/semver": "^7.5.7",
"babel-preset-moon": "^2.0.14",
"chokidar": "^3.6.0",
"electron-to-chromium": "^1.4.661",
"electron-to-chromium": "^1.4.677",
"eslint": "^8.56.0",
"eslint-config-moon": "^2.0.16",
"jest": "^29.7.0",
"jest-preset-moon": "^2.0.7",
"eslint-config-moon": "^2.1.1",
"lerna": "^8.1.2",
"prettier": "^3.2.5",
"prettier-config-moon": "^1.1.2",
"ts-node": "^10.9.2",
"tsconfig-moon": "^1.3.0",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"vitest": "^1.3.1"
},
"funding": {
"type": "ko-fi",
"url": "https://ko-fi.com/milesjohnson"
},
"packageManager": "yarn@4.0.2",
"packageManager": "yarn@4.1.0",
"resolutions": {
"@rollup/plugin-commonjs@^22.0.2": "patch:@rollup/plugin-commonjs@npm:22.0.2#.yarn/patches/@rollup-plugin-commonjs-npm-22.0.2-6275b92096.patch",
"@rollup/plugin-node-resolve@^13.3.0": "patch:@rollup/plugin-node-resolve@npm:13.3.0#.yarn/patches/@rollup-plugin-node-resolve-npm-13.3.0-a93dd11647.patch"
Expand Down
3 changes: 0 additions & 3 deletions packages/babel-plugin-cjs-esm-interop/jest.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/babel-plugin-cjs-esm-interop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"src/**/*"
],
"engines": {
"node": ">=16.12.0"
"node": ">=18.12.0"
},
"packemon": {
"format": "lib",
Expand Down
1 change: 1 addition & 0 deletions packages/babel-plugin-cjs-esm-interop/tests/plugin.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, it } from 'vitest';
import { transformAsync, TransformOptions } from '@babel/core';
import cjsEsmInterop, { CjsEsmInteropOptions } from '../src';

Expand Down
11 changes: 0 additions & 11 deletions packages/babel-plugin-conditional-invariant/jest.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/babel-plugin-conditional-invariant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"src/**/*"
],
"engines": {
"node": ">=16.12.0"
"node": ">=18.12.0"
},
"packemon": {
"format": "lib",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`conditionalInvariantPlugin() will not transform if wrapped in a matching conditional 1`] = `
exports[`conditionalInvariantPlugin() > will not transform if wrapped in a matching conditional 1`] = `
"if (process.env.NODE_ENV !== 'production') {
invariant();
}"
`;

exports[`conditionalInvariantPlugin() will not transform if wrapped in a matching conditional that is layers deep 1`] = `
exports[`conditionalInvariantPlugin() > will not transform if wrapped in a matching conditional that is layers deep 1`] = `
"if (process.env.NODE_ENV !== 'production') {
if (true) {
if (false) {
Expand All @@ -16,15 +16,15 @@ exports[`conditionalInvariantPlugin() will not transform if wrapped in a matchin
}"
`;

exports[`conditionalInvariantPlugin() will transform if wrapped in a non-matching conditional 1`] = `
exports[`conditionalInvariantPlugin() > will transform if wrapped in a non-matching conditional 1`] = `
"if (process.env.NODE_ENV === 'development') {
if (process.env.NODE_ENV !== 'production') {
invariant();
}
}"
`;

exports[`conditionalInvariantPlugin() will transform if wrapped in a non-matching conditional that is layers deep 1`] = `
exports[`conditionalInvariantPlugin() > will transform if wrapped in a non-matching conditional that is layers deep 1`] = `
"if (process.env.NODE_ENV === 'development') {
if (true) {
if (false) {
Expand All @@ -36,7 +36,7 @@ exports[`conditionalInvariantPlugin() will transform if wrapped in a non-matchin
}"
`;

exports[`conditionalInvariantPlugin() will transform valid expressions 1`] = `
exports[`conditionalInvariantPlugin() > will transform valid expressions 1`] = `
"if (process.env.NODE_ENV !== 'production') {
invariant();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, it } from 'vitest';
import { transformAsync, TransformOptions } from '@babel/core';
import conditionalInvariantPlugin from '../src';

Expand Down
3 changes: 0 additions & 3 deletions packages/babel-plugin-env-constants/jest.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/babel-plugin-env-constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"src/**/*"
],
"engines": {
"node": ">=16.12.0"
"node": ">=18.12.0"
},
"packemon": {
"format": "lib",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`envConstantsPlugin() transforms __DEV__ expressions 1`] = `
exports[`envConstantsPlugin() > transforms __DEV__ expressions 1`] = `
"if (process.env.NODE_ENV !== 'production') {} else if (process.env.NODE_ENV !== 'production' && 123) {} else if (true || process.env.NODE_ENV !== 'production') {} else if (!(process.env.NODE_ENV !== 'production')) {} else {}
switch (process.env.NODE_ENV !== 'production') {}
while (process.env.NODE_ENV !== 'production') {}
Expand All @@ -13,7 +13,7 @@ const arrayValue = [process.env.NODE_ENV !== 'production'];
React.createElement(Foo, null, process.env.NODE_ENV !== 'production' ? 'Child' : null);"
`;

exports[`envConstantsPlugin() transforms __PROD__ expressions 1`] = `
exports[`envConstantsPlugin() > transforms __PROD__ expressions 1`] = `
"if (process.env.NODE_ENV === 'production') {} else if (process.env.NODE_ENV === 'production' && 123) {} else if (true || process.env.NODE_ENV === 'production') {} else if (!(process.env.NODE_ENV === 'production')) {} else {}
switch (process.env.NODE_ENV === 'production') {}
while (process.env.NODE_ENV === 'production') {}
Expand All @@ -26,7 +26,7 @@ const arrayValue = [process.env.NODE_ENV === 'production'];
React.createElement(Foo, null, process.env.NODE_ENV === 'production' ? 'Child' : null);"
`;

exports[`envConstantsPlugin() transforms __TEST__ expressions 1`] = `
exports[`envConstantsPlugin() > transforms __TEST__ expressions 1`] = `
"if (process.env.NODE_ENV === 'test') {} else if (process.env.NODE_ENV === 'test' && 123) {} else if (true || process.env.NODE_ENV === 'test') {} else if (!(process.env.NODE_ENV === 'test')) {} else {}
switch (process.env.NODE_ENV === 'test') {}
while (process.env.NODE_ENV === 'test') {}
Expand All @@ -39,7 +39,7 @@ const arrayValue = [process.env.NODE_ENV === 'test'];
React.createElement(Foo, null, process.env.NODE_ENV === 'test' ? 'Child' : null);"
`;

exports[`envConstantsPlugin() will not transform invalid __DEV__ expressions 1`] = `
exports[`envConstantsPlugin() > will not transform invalid __DEV__ expressions 1`] = `
"const __DEV__ = 123;
const objectProperty = {
__DEV__: true
Expand All @@ -53,7 +53,7 @@ const arrayIndex = [];
arrayIndex[__DEV__] = 1;"
`;

exports[`envConstantsPlugin() will not transform invalid __PROD__ expressions 1`] = `
exports[`envConstantsPlugin() > will not transform invalid __PROD__ expressions 1`] = `
"const __PROD__ = 123;
const objectProperty = {
__PROD__: true
Expand All @@ -67,7 +67,7 @@ const arrayIndex = [];
arrayIndex[__PROD__] = 1;"
`;

exports[`envConstantsPlugin() will not transform invalid __TEST__ expressions 1`] = `
exports[`envConstantsPlugin() > will not transform invalid __TEST__ expressions 1`] = `
"const __TEST__ = 123;
const objectProperty = {
__TEST__: true
Expand Down
1 change: 1 addition & 0 deletions packages/babel-plugin-env-constants/tests/plugin.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, it } from 'vitest';
import { transformAsync, TransformOptions } from '@babel/core';
import envConstantsPlugin from '../src';

Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions packages/packemon/jest.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/packemon/moon.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
tasks:
build:
outputs:
- 'cjs'
- 'mjs'
options:
mergeOutputs: 'replace'
Loading
Loading