-
Notifications
You must be signed in to change notification settings - Fork 13
fix(init): remove rc versions, @types/react 18, no run #120
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
| @@ -1,4 +1 @@ | ||
| #!/bin/sh | ||
| . "$(dirname "$0")/_/husky.sh" | ||
|
|
||
| npx --no-install -- commitlint --edit ${1} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1 @@ | ||
| #!/usr/bin/env sh | ||
| . "$(dirname -- "$0")/_/husky.sh" | ||
|
|
||
|
Comment on lines
-1
to
-3
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. Note: Husky deprecated this syntax in 9, will be removed in 10 |
||
| npx --no-install lint-staged | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,16 +117,16 @@ export const generateFiles = async ( | |
| '@strapi/design-system': '^2.0.0', | ||
| '@strapi/icons': '^2.0.0', | ||
| 'react-intl': '^6.0.0', | ||
| react: '^17.0.0 || ^18.0.0', | ||
| 'react-dom': '^17.0.0 || ^18.0.0', | ||
| react: '^18.0.0', | ||
| 'react-dom': '^18.0.0', | ||
|
Comment on lines
-120
to
+121
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. Note: In the end it will still resolve to the biggest from them. Also creating a new plugin with v17 kind of does not make sense. |
||
| 'react-router-dom': '^6.0.0', | ||
| 'styled-components': '^6.0.0', | ||
| }; | ||
|
|
||
| pkgJson.peerDependencies = { | ||
| ...pkgJson.peerDependencies, | ||
| react: '^17.0.0 || ^18.0.0', | ||
| 'react-dom': '^17.0.0 || ^18.0.0', | ||
| react: '^18.0.0', | ||
| 'react-dom': '^18.0.0', | ||
| 'react-router-dom': '^6.0.0', | ||
| 'styled-components': '^6.0.0', | ||
| }; | ||
|
|
@@ -158,13 +158,13 @@ export const generateFiles = async ( | |
|
|
||
| pkgJson.scripts = { | ||
| ...pkgJson.scripts, | ||
| 'test:ts:front': 'run -T tsc -p admin/tsconfig.json', | ||
| 'test:ts:front': 'tsc -p admin/tsconfig.json', | ||
|
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. Note: There is no such binary |
||
| }; | ||
|
|
||
| pkgJson.devDependencies = { | ||
| ...pkgJson.devDependencies, | ||
| '@types/react': '*', | ||
| '@types/react-dom': '*', | ||
| '@types/react': '^18.0.0', | ||
| '@types/react-dom': '^18.0.0', | ||
|
Comment on lines
-166
to
+167
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. Note: Without this the version resolves to v19 |
||
| }; | ||
|
|
||
| const { adminTsconfigFiles } = await import('../../plugin/init/files/typescript'); | ||
|
|
@@ -181,7 +181,7 @@ export const generateFiles = async ( | |
|
|
||
| pkgJson.scripts = { | ||
| ...pkgJson.scripts, | ||
| 'test:ts:back': 'run -T tsc -p server/tsconfig.json', | ||
| 'test:ts:back': 'tsc -p server/tsconfig.json', | ||
|
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. Note: There is no such binary |
||
| }; | ||
|
|
||
| const { serverTsconfigFiles } = await import('../../plugin/init/files/typescript'); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,6 @@ import getLatestVersion from 'get-latest-version'; | |
| * Shared types and utilities for plugin initialization. | ||
| */ | ||
|
|
||
| // TODO: remove these when release versions are available | ||
| export const USE_RC_VERSIONS: string[] = ['@strapi/design-system', '@strapi/icons']; | ||
|
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. Note: As of this writing the versions are 2.2.0 |
||
|
|
||
| export interface PackageExport { | ||
| types?: string; | ||
| require: string; | ||
|
|
@@ -57,9 +54,8 @@ export const resolveLatestVersionOfDeps = async ( | |
| ): Promise<Record<string, string>> => { | ||
| const latestDeps: Record<string, string> = {}; | ||
|
|
||
| for (const [name, version] of Object.entries(deps)) { | ||
| for (const [name, range] of Object.entries(deps)) { | ||
| try { | ||
| const range = USE_RC_VERSIONS.includes(name) ? 'rc' : version; | ||
| const latestVersion = await getLatestVersion(name, { range }); | ||
| latestDeps[name] = latestVersion ? `^${latestVersion}` : '*'; | ||
| } catch { | ||
|
|
||
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.
Note: Husky deprecated this syntax in 9, will be removed in 10