-
Notifications
You must be signed in to change notification settings - Fork 160
Drop node: prefix on imports in app-ember-satisfies to accomodate node < 16
#2571
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
Changes from all commits
6573512
9d1a109
a177068
bb8a77d
4ae5cc5
4d672ce
7086839
beb5926
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ name: CI | |
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: '0 7 * * *' # daily, 7am | ||
| - cron: "0 7 * * *" # daily, 7am | ||
|
|
||
| push: | ||
| branches: | ||
|
|
@@ -22,8 +22,8 @@ jobs: | |
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node: ['20', '22', '24'] | ||
| os: [ubuntu-latest, 'macos-latest'] # TODO add windows here | ||
| node: ["20", "22", "24"] | ||
| os: [ubuntu-latest, "macos-latest"] # TODO add windows here | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should ubuntu-latest be between quotes like macos-latest?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Idk, it appears to not matter somehow |
||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
@@ -37,6 +37,29 @@ jobs: | |
| - run: pnpm install --no-lockfile | ||
| - run: pnpm --filter "@embroider/*" test | ||
|
|
||
| legacy-macros: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node: ["12.22.12", "14.21.3", "16.20.2", "18.20.8", "20.19.5", "22.20.0", "24.9.0"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: pnpm/action-setup@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 # this is only used for the pnpm install, the user-node-version above will be used in tests | ||
| cache: pnpm | ||
| - run: pnpm install --no-lockfile | ||
| - name: downgrade Node Version in .npmrc | ||
| run: printf "auto-install-peers=false\nuse-node-version=${{matrix.node}}" > .npmrc | ||
| - run: pnpm node -v | ||
| - run: cat .npmrc | ||
| - run: pnpm --filter "@embroider/macros" test:smoke | ||
|
|
||
| preflight: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
|
|
@@ -55,9 +78,9 @@ jobs: | |
| echo "matrix=$matrix_json" >> $GITHUB_OUTPUT | ||
|
|
||
| test: | ||
| needs: ['preflight'] | ||
| needs: ["preflight"] | ||
| name: ${{ matrix.name }} | ||
| runs-on: '${{ matrix.os }}-latest' | ||
| runs-on: "${{ matrix.os }}-latest" | ||
| timeout-minutes: 60 | ||
|
|
||
| strategy: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| console.log(process.version); | ||
|
|
||
| var babel = require("@babel/core"); | ||
|
|
||
| const { join } = require('path'); | ||
|
|
||
| const { MacrosConfig } = require('./src/node'); | ||
|
|
||
| let config = MacrosConfig.for({}, __dirname); | ||
|
|
||
| let response = babel.transform(` | ||
| import { macroCondition } from '@embroider/macros'; | ||
| export default function() { | ||
| if (macroCondition(true)) { | ||
| return 'alpha'; | ||
| } else { | ||
| return 'beta'; | ||
| } | ||
| } | ||
| `, { | ||
| filename: join(__dirname, 'sample.js'), | ||
| configFile: false, | ||
| plugins: config.babelPluginConfig(), | ||
| }); | ||
|
|
||
|
|
||
| if(response.code.trim() !== `export default function () { | ||
| { | ||
| return 'alpha'; | ||
| } | ||
| }`.trim()) { | ||
| console.error(response.code); | ||
| throw new Error("smoke test failed"); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,9 @@ import type State from './state'; | |
| import { satisfies, coerce } from 'semver'; | ||
| import error from './error'; | ||
| import { assertArray } from './evaluate-json'; | ||
| import { pathToFileURL } from 'node:url'; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So simple. But ugh |
||
| import { createRequire } from 'node:module'; | ||
| import { dirname } from 'node:path'; | ||
| import { pathToFileURL } from 'url'; | ||
| import { createRequire } from 'module'; | ||
| import { dirname } from 'path'; | ||
| import findUp from 'find-up'; | ||
|
|
||
| const packageName = 'ember-source'; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out we don't prettier ignore this