Skip to content

Commit

Permalink
Migrated Portal from CRA to Vite
Browse files Browse the repository at this point in the history
refs #15502

- this commit migrates Portal from CRA to Vite, as it brings the
  package more inline with the direction we're going in terms of tooling
  for builds
- the bulk of the changes here are just config related to get things
  working with Vite, and then cleaning up all the CRA boilerplate
  • Loading branch information
daniellockyer committed Mar 16, 2023
1 parent 9f5d4b4 commit 0d1388a
Show file tree
Hide file tree
Showing 17 changed files with 1,154 additions and 3,266 deletions.
73 changes: 28 additions & 45 deletions ghost/portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"url": "git://github.com/TryGhost/Ghost.git"
},
"author": "Ghost Foundation",
"unpkg": "umd/portal.min.js",
"files": [
"umd/",
"LICENSE",
Expand All @@ -17,35 +16,18 @@
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"dependencies": {
"@sentry/react": "7.42.0",
"@sentry/tracing": "7.42.0",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "12.1.5",
"@testing-library/user-event": "14.4.3",
"@tryghost/i18n": "0.0.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-scripts": "5.0.1"
},
"scripts": {
"start": "BROWSER=none react-scripts start",
"start:combined": "BROWSER=none node ./scripts/start-combined.js",
"start:dev": "node ./scripts/start-mode.js",
"dev": "node ./scripts/dev-mode.js",
"build": "npm run build:combined",
"build:original": "react-scripts build",
"build:combined": "node ./scripts/build-combined.js",
"test": "react-scripts test",
"test:ci": "yarn test --watchAll=false --coverage",
"dev": "concurrently \"vite\" \"yarn build:watch\"",
"build": "vite build",
"build:watch": "vite build --watch",
"preview": "vite preview",
"test": "vitest run",
"test:ci": "yarn test --coverage",
"test:unit": "yarn test:ci",
"eject": "react-scripts eject",
"lint": "eslint src --ext .js --cache",
"preship": "yarn lint",
"ship": "STATUS=$(git status --porcelain); echo $STATUS; if [ -z \"$STATUS\" ]; then yarn version; fi",
"postship": "git push ${GHOST_UPSTREAM:-origin} --follow-tags && yarn publish . --tag $npm_package_version",
"posttest": "yarn lint",
"analyze": "source-map-explorer 'umd/*.js'",
"prepublishOnly": "yarn build"
},
"eslintConfig": {
Expand All @@ -55,10 +37,7 @@
],
"plugins": [
"ghost"
],
"rules": {
"import/no-webpack-loader-syntax": "off"
}
]
},
"browserslist": {
"production": [
Expand All @@ -77,24 +56,28 @@
"cobertura",
"text-summary",
"html"
],
"moduleNameMapper": {
"^!!raw-loader!.*": "jest-raw-loader"
}
]
},
"devDependencies": {
"chalk": "4.1.2",
"chokidar": "3.5.3",
"jest-raw-loader": "1.0.1",
"minimist": "1.2.8",
"ora": "5.4.1",
"raw-loader": "4.0.2",
"rewire": "6.0.0",
"serve-handler": "6.1.5",
"source-map-explorer": "2.5.3"
},
"resolutions": {
"//": "See https://github.com/facebook/create-react-app/issues/11773",
"react-error-overlay": "6.0.11"
"@babel/eslint-parser": "7.21.3",
"@sentry/react": "7.42.0",
"@sentry/tracing": "7.42.0",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "12.1.5",
"@tryghost/i18n": "0.0.0",
"@vitejs/plugin-react": "3.1.0",
"@vitest/coverage-c8": "0.29.3",
"@vitest/ui": "0.29.3",
"concurrently": "7.6.0",
"cross-fetch": "3.1.5",
"eslint": "8.36.0",
"eslint-config-react-app": "7.0.1",
"jsdom": "21.1.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"vite": "4.1.4",
"vite-plugin-css-injected-by-js": "3.1.0",
"vite-plugin-svgr": "2.4.0",
"vitest": "0.29.2"
}
}
Binary file removed ghost/portal/public/favicon.ico
Binary file not shown.
43 changes: 0 additions & 43 deletions ghost/portal/public/index.html

This file was deleted.

Binary file removed ghost/portal/public/logo192.png
Binary file not shown.
Binary file removed ghost/portal/public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions ghost/portal/public/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions ghost/portal/public/robots.txt

This file was deleted.

29 changes: 0 additions & 29 deletions ghost/portal/scripts/build-combined.js

This file was deleted.

Loading

0 comments on commit 0d1388a

Please sign in to comment.