Skip to content

Commit

Permalink
v1.88.3 - fix prettier config breaking old versions due to missing ke…
Browse files Browse the repository at this point in the history
…ywords
  • Loading branch information
balupton committed Dec 5, 2023
1 parent 09177a0 commit bc0be79
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 83 deletions.
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# History

## v1.88.3 2023 December 5

- fix non-typescript projects that target Node.js v4 and v6 from failing due to bad prettier configuration
- regression from https://github.com/bevry/boundation/commit/b54830456812d9bd591141d8af162eb8638fcae6#diff-f4c695cccbf0d3ce1b79765091f9b57956c45cb9dd1b8f5661116a7b93c4e5ceL510 which removed `nodeVersionTargetedMinimum` and relied solely on edition keywords, which until now did not exist on all node.js editions that we generate (was missing on coffeescript, babel, json)
- Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation)

## v1.88.2 2023 December 5

- configure prettier to use lf line endings, to prevent complications on Windows
Expand Down
98 changes: 43 additions & 55 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "boundation",
"version": "1.88.2",
"version": "1.88.3",
"description": "Automatic scaffolding and upgrading of your JavaScript ecosystem projects using Bevry's best practices",
"homepage": "https://github.com/bevry/boundation",
"license": "Artistic-2.0",
Expand Down Expand Up @@ -99,7 +99,7 @@
}
},
"dependencies": {
"@bevry/ansi": "^6.5.0",
"@bevry/ansi": "^6.6.0",
"@bevry/ecmascript-versions": "^4.5.0",
"@bevry/fs-accessible": "^2.2.0",
"@bevry/fs-read": "^1.3.0",
Expand All @@ -114,20 +114,20 @@
"@bevry/testen": "^9.1.0",
"arrange-package-json": "^4.5.0",
"arrangekeys": "^6.4.0",
"errlop": "^8.0.0",
"errlop": "^8.1.0",
"filedirname": "^3.1.0",
"get-cli-arg": "^8.3.0",
"inquirer": "^9.2.12",
"js-yaml": "^4.1.0",
"safeps": "^11.4.0",
"sortobject": "^5.3.0",
"typechecker": "^9.0.0",
"version-compare": "^3.6.0",
"version-range": "^4.9.0"
"typechecker": "^9.1.0",
"version-compare": "^3.7.0",
"version-range": "^4.10.0"
},
"devDependencies": {
"@bevry/update-contributors": "^1.23.0",
"assert-helpers": "^11.7.0",
"assert-helpers": "^11.8.0",
"eslint": "^8.55.0",
"eslint-config-bevry": "^5.2.0",
"eslint-config-prettier": "^9.1.0",
Expand Down Expand Up @@ -174,7 +174,8 @@
"prettier": {
"semi": false,
"singleQuote": true,
"trailingComma": "all"
"trailingComma": "all",
"endOfLine": "lf"
},
"boundation": {
"maintainedNodeVersions": true,
Expand Down
11 changes: 9 additions & 2 deletions source/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { cwd } from 'node:process'
import {
getESVersionsByDate,
getESVersionByDate,
getESVersionsByNow,
getDateWithYearOffset,
} from '@bevry/ecmascript-versions'

Expand Down Expand Up @@ -32,12 +33,18 @@ export const allLanguages = [
const aYearAgo = getDateWithYearOffset(-1)

// we reverse, to make sure it is newest first
export const allTypescriptTargets = [
export const allTypescriptEcmascriptTargets = [
'ESNext',
...getESVersionsByDate(aYearAgo).reverse(),
]

export const defaultCoffeeTarget = 'ESNext'
// we reverse, to make sure it is newest first
export const allEcmascriptVersions = [
'ESNext',
...getESVersionsByNow().reverse(),
]

export const defaultCoffeeEcmascriptTarget = 'ESNext'

// previous year
export const defaultBrowserTarget = getESVersionByDate(aYearAgo)
Expand Down
32 changes: 22 additions & 10 deletions source/editions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import {
unjoin,
} from './util.js'
import {
allTypescriptTargets,
allTypescriptEcmascriptTargets,
languageNames,
defaultBrowserTarget,
defaultCoffeeTarget,
defaultCoffeeEcmascriptTarget,
} from './data.js'
import { spawn, exec, unlinkIfContains } from './fs.js'

Expand Down Expand Up @@ -376,7 +376,7 @@ export async function generateEditions(state) {
browser: addExtension(answers.browserEntry, `json`),
test: addExtension(answers.testEntry, `js`),
bin: addExtension(answers.binEntry, `js`),
tags: ['source', 'json'],
tags: ['source', 'json', 'es5'],
engines: {
node: true,
browsers: answers.browsersTargeted && !answers.compilerBrowser,
Expand Down Expand Up @@ -419,8 +419,8 @@ export async function generateEditions(state) {

// add coffeescript edition
if (answers.compilerNode === 'coffeescript') {
const syntax = defaultCoffeeTarget.toLowerCase()
const directory = `edition-${syntax}`
const esVersionTargetLower = defaultCoffeeEcmascriptTarget.toLowerCase()
const directory = `edition-${esVersionTargetLower}`
editions.set(
'coffeescript',
new Edition({
Expand All @@ -431,17 +431,16 @@ export async function generateEditions(state) {
browser: addExtension(answers.browserEntry, `js`),
test: addExtension(answers.testEntry, `js`),
bin: addExtension(answers.binEntry, `js`),
tags: ['compiled', 'javascript', syntax, 'require'],
tags: ['compiled', 'javascript', esVersionTargetLower, 'require'],
engines: {
node: true,
browsers: answers.browsersTargeted,
},
}),
)
}

// add edition for each babel/typescript target
if (
else if (
answers.compilerNode === 'babel' ||
answers.compilerNode === 'typescript'
) {
Expand All @@ -463,6 +462,14 @@ export async function generateEditions(state) {
.reverse() // reverse modifies the actual array, hence need for slice
if (answers.compilerNode === 'babel') {
for (const nodeVersionTarget of nodeVersionsTargets) {
// fetch es version which is essential for accurate prettier configuration for node v6 which is es5
const esVersionTargetLower = (
await fetchAllCompatibleESVersionsForNodeVersions([
nodeVersionTarget,
])
)
.reverse()[0]
.toLowerCase()
const directory =
`edition-node-${nodeVersionTarget}` +
(targetModule === 'import' ? '-esm' : '')
Expand All @@ -476,7 +483,12 @@ export async function generateEditions(state) {
browser: addExtension(answers.browserEntry, `js`),
test: addExtension(answers.testEntry, `js`),
bin: addExtension(answers.binEntry, `js`),
tags: ['compiled', 'javascript', targetModule],
tags: [
'compiled',
'javascript',
esVersionTargetLower,
targetModule,
],
targets: {
node: nodeVersionTarget,
},
Expand All @@ -492,7 +504,7 @@ export async function generateEditions(state) {
for (const nodeVersionTarget of nodeVersionsTargets) {
// fetch the latest es version for the node.js version target that typescript supports
const esVersionTarget = intersect(
allTypescriptTargets,
allTypescriptEcmascriptTargets,
await fetchAllCompatibleESVersionsForNodeVersions([
nodeVersionTarget,
]),
Expand Down
Loading

0 comments on commit bc0be79

Please sign in to comment.