Skip to content
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5e4f22f
refactor: Move targets to src root
cballevre Nov 26, 2024
56896ac
refactor: Move manifest.webapp at root
cballevre Nov 27, 2024
02881c8
refactor: Use only deep import for cozy-ui
cballevre Nov 28, 2024
41e2c03
feat: Add Rsbuild dependencies
cballevre Nov 26, 2024
519fed8
feat: Add Rsbuild config
cballevre Nov 26, 2024
9e72e7d
feat: Add Rsbuild scripts
cballevre Nov 26, 2024
3c9762e
feat: Add alias to tsconfig
cballevre Nov 26, 2024
e8335ca
feat: Move static assets into the public folder
cballevre Nov 27, 2024
e43028a
feat: Migrate index.ejs from targets
cballevre Nov 27, 2024
0905a1d
feat: Use import with extension for styles
cballevre Nov 28, 2024
4a268f0
feat: Remove __APP_SLUG__ to use cozy-photos slug directly
cballevre Nov 28, 2024
cf98709
feat: Use common alias
cballevre Nov 28, 2024
e9a67ce
feat: Remove cozy-client-js
cballevre Nov 28, 2024
1c4c7ba
feat: Use flag debug to activate redux devtools
cballevre Nov 28, 2024
307e5cc
feat: Remove mobile target
cballevre Nov 28, 2024
971e231
feat: Remove jsconfig.json
cballevre Nov 28, 2024
2916c57
feat: Every one use assets
cballevre Nov 28, 2024
3ed456b
feat: Remove webpack custom config
cballevre Nov 28, 2024
3be608f
feat: Remove old package
cballevre Nov 28, 2024
044bc76
feat: Remove style linting temporary
cballevre Nov 28, 2024
588ab49
feat: Use `development` mode when using `watch` script
Ldoppea Jan 7, 2025
8f998c6
chore: Adapt bundlemon config to new Rsbuild output
Ldoppea Jan 7, 2025
1b46e41
feat: Upgrade rsbuild-config-cozy-app to `0.2.0`
Ldoppea Jan 15, 2025
cbd114f
feat: Add `yarn start` script for rsbuild
Ldoppea Jan 15, 2025
349554e
feat: Use SWC for Jest unit tests
Ldoppea Jan 15, 2025
ea4892c
feat: Upgrade rsbuild-config-cozy-app to `0.2.1`
Ldoppea Jan 29, 2025
6bcc58f
feat: Add style linting again
zatteo Feb 11, 2025
82e648c
fix: Inject correctly custom themes override
zatteo Feb 11, 2025
27e5144
feat: Upgrade rsbuild-config-cozy-app to 0.3.0
zatteo Feb 11, 2025
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
59 changes: 47 additions & 12 deletions .bundlemonrc
Original file line number Diff line number Diff line change
@@ -1,43 +1,78 @@
{
"baseDir": "./build",
"pathLabels": {
"chunkId": "[\\d-]+"
},
"files": [
{
"path": "app/photos.<hash>.js"
"path": "static/js/<chunkId>.<hash>.js"
},
{
"path": "public/cozy-client-js.js"
"path": "static/js/cozy.<hash>.js"
},
{
"path": "public/photos.<hash>.js"
"path": "static/js/main.<hash>.js"
},
{
"path": "public/photos.<hash>.min.css"
"path": "static/js/lib-react.<hash>.js"
},
{
"path": "services/onPhotoTrashed/photos.js"
"path": "static/js/lib-router.<hash>.js"
},
{
"path": "services/onPhotoUpload/photos.js"
"path": "static/css/cozy.<hash>.css"
},
{
"path": "vendors/photos.<hash>.js"
"path": "static/css/main.<hash>.css"
},
{
"path": "app-photos.<hash>.min.css"
"path": "public/static/js/<chunkId>.<hash>.js"
},
{
"path": "index.html"
"path": "public/static/js/public.<hash>.js"
},
{
"path": "manifest.json"
"path": "public/static/js/cozy.<hash>.js"
},
{
"path": "manifest.webapp"
"path": "public/static/js/lib-react.<hash>.js"
},
{
"path": "public/static/js/lib-router.<hash>.js"
},
{
"path": "public/static/css/cozy.<hash>.css"
},
{
"path": "public/static/css/public.<hash>.css"
},
{
"path": "services/onPhotoTrashed.js"
},
{
"path": "vendors-photos.<hash>.min.css"
"path": "services/onPhotoUpload.js"
},
{
"path": "index.html"
},
{
"path": "assets/manifest.json"
},
{
"path": "manifest.webapp"
}
],
"groups": [
{
"path": "**/*.js"
},
{
"path": "**/*.css"
},
{
"path": "**/*.{png,svg,ico}"
}
],
"reportOutput": [
"github"
]
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ desktop.ini
# cozy-jobs-cli
.token.json
konnector-dev-config.json

# SWC
.swc
66 changes: 0 additions & 66 deletions app.config.js

This file was deleted.

36 changes: 29 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,38 @@ module.exports = {
'<rootDir>/jestHelpers/mocks/pdfjsWorkerMock.js',
'^cozy-client$': 'cozy-client/dist/index.js',
'^react-redux': '<rootDir>/node_modules/react-redux',
'^cozy-ui/react(.*)$': '<rootDir>/node_modules/cozy-ui/transpiled/react$1'
'^cozy-ui/react(.*)$': '<rootDir>/node_modules/cozy-ui/transpiled/react$1',
'^@/(.*)$': '<rootDir>/src/$1'
},
clearMocks: true,
transform: {
'\\.[jt]sx?$': 'babel-jest',
'\\.(js|jsx|mjs)$': [
'@swc/jest',
{
jsc: {
experimental: {
plugins: [['swc_mut_cjs_exports', {}]]
},
parser: {
jsx: true
}
}
}
],
'\\.(ts|tsx)$': [
'@swc/jest',
{
jsc: {
experimental: {
plugins: [['swc_mut_cjs_exports', {}]]
},
parser: {
syntax: 'typescript',
tsx: true
}
}
}
],
'^.+\\.webapp$': '<rootDir>/test/jestLib/json-transformer.js'
},
transformIgnorePatterns: [
Expand All @@ -40,10 +67,5 @@ module.exports = {
url: 'http://cozy.localhost:8080/'
},
testMatch: ['**/(*.)(spec|test).[jt]s?(x)'],
globals: {
__APP_SLUG__: 'photos',
__TARGET__: 'browser',
__DEVELOPMENT__: true
},
reporters: ['default', '<rootDir>/jestHelpers/ConsoleUsageReporter.js']
}
13 changes: 0 additions & 13 deletions jsconfig.json

This file was deleted.

12 changes: 8 additions & 4 deletions src/photos/targets/manifest.webapp → manifest.webapp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "1.68.0",
"type": "webapp",
"licence": "AGPL-3.0",
"icon": "public/app-icon.svg",
"icon": "assets/app-icon.svg",
"categories": ["cozy"],
"source": "https://github.com/cozy/cozy-photos",
"editor": "Cozy",
Expand All @@ -18,15 +18,15 @@
"fr": {
"short_description": "Cozy Photos est l’application de visualisation et gestion de vos photos sur Cozy.",
"long_description": "Avec Cozy Photos vous pourrez :\n- Visualiser toutes les photos présentes dans votre Cozy, classées par date;\n- Organisez vos photos en albums;\n- Partager vos albums avec qui vous le souhaitez.",
"screenshots": ["screenshots/fr/screenshot01.jpg", "screenshots/fr/screenshot02.jpg", "screenshots/fr/screenshot03.jpg"]
"screenshots": ["assets/screenshots/fr/screenshot01.jpg", "assets/screenshots/fr/screenshot02.jpg", "assets/screenshots/fr/screenshot03.jpg"]
},
"en": {
"short_description": "Cozy Photos allows you to view and manage your photos on your Cozy",
"long_description": "With Cozy Photos, you can:\n- Get a timeline of all your memories\n- Organize your photos through albums\n- Share albums with just a link",
"screenshots": ["screenshots/en/screenshot01.jpg", "screenshots/en/screenshot02.jpg", "screenshots/en/screenshot03.jpg"]
"screenshots": ["assets/screenshots/en/screenshot01.jpg", "assets/screenshots/en/screenshot02.jpg", "assets/screenshots/en/screenshot03.jpg"]
}
},
"screenshots": ["screenshots/fr/screenshot01.jpg", "screenshots/fr/screenshot02.jpg", "screenshots/fr/screenshot03.jpg"],
"screenshots": ["assets/screenshots/fr/screenshot01.jpg", "assets/screenshots/fr/screenshot02.jpg", "assets/screenshots/fr/screenshot03.jpg"],
"routes": {
"/": {
"folder": "/",
Expand All @@ -37,6 +37,10 @@
"folder": "/public",
"index": "index.html",
"public": true
},
"/assets": {
"folder": "/assets",
"public": true
}
},
"services": {
Expand Down
24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
"version": "1.68.0",
"main": "src/main.jsx",
"scripts": {
"build": "cozy-scripts build --manifest src/photos/targets/manifest.webapp --build-dir build --src-dir src/photos --barV7 false --cozyClientJs",
"watch": "cozy-scripts watch --manifest src/photos/targets/manifest.webapp --build-dir build --src-dir src/photos --barV7 false --cozyClientJs",
"start": "cozy-scripts start --manifest src/photos/targets/manifest.webapp --build-dir build --src-dir src/photos --barV7 false --cozyClientJs",
"build": "rsbuild build",
"watch": "rsbuild build --watch --mode development",
"start": "rsbuild dev",
"analyze": "RSDOCTOR=true yarn build",
"cozyPublish": "cozy-app-publish --token $REGISTRY_TOKEN --build-dir 'build/' --prepublish downcloud --postpublish mattermost",
"tx": "tx pull --all || true",
"lint": "npm-run-all --parallel 'lint:*'",
"lint:styles": "stylint src --config ./node_modules/cozy-scripts/config/.stylintrc",
"lint:styles": "stylint src --config ./node_modules/stylus-config-cozy-app/.stylintrc",
"lint:js": "eslint '{src,test}/**/*.{js,jsx}'",
"test": "env NODE_ENV='test' jest",
"version": "yarn version:photos",
"version:photos": "replace '\\d+\\.\\d+\\.\\d+' $npm_package_version ./src/photos/targets/manifest.webapp",
"service": "yarn cozy-konnector-dev -m src/photos/targets/manifest.webapp"
"version:photos": "replace '\\d+\\.\\d+\\.\\d+' $npm_package_version manifest.webapp",
"service": "yarn cozy-konnector-dev -m manifest.webapp"
},
"repository": {
"type": "git",
Expand All @@ -40,6 +41,9 @@
},
"homepage": "https://github.com/cozy/cozy-photos#readme",
"devDependencies": {
"@rsbuild/core": "^1.1.6",
"@swc/core": "^1.10.7",
"@swc/jest": "^0.2.37",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "11.2.7",
"@types/react-redux": "7.1.26",
Expand All @@ -57,8 +61,9 @@
"npm-run-all": "4.1.5",
"react-test-renderer": "16.14.0",
"replace": "1.2.1",
"rsbuild-config-cozy-app": "^0.2.1",
"stylint": "1.5.9",
"terser-webpack-plugin": "1.4.5",
"swc_mut_cjs_exports": "^8.0.1",
"worker-loader": "2.0.0"
},
"dependencies": {
Expand All @@ -67,7 +72,6 @@
"classnames": "2.3.1",
"cozy-bar": "16.0.1",
"cozy-client": "51.3.0",
"cozy-client-js": "0.20.0",
"cozy-device-helper": "^2.5.0",
"cozy-devtools": "^1.2.1",
"cozy-doctypes": "1.85.4",
Expand All @@ -76,7 +80,6 @@
"cozy-intent": "2.29.1",
"cozy-logger": "1.9.1",
"cozy-realtime": "4.6.0",
"cozy-scripts": "^8.2.0",
"cozy-sharing": "^16.0.0",
"cozy-ui": "113.3.0",
"cozy-viewer": "2.9.0",
Expand All @@ -97,6 +100,7 @@
"redux": "3.7.2",
"redux-logger": "3.0.6",
"redux-mock-store": "1.5.4",
"redux-thunk": "2.4.2"
"redux-thunk": "2.4.2",
"stylus-config-cozy-app": "^0.1.0"
}
}
File renamed without changes
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions rsbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from '@rsbuild/core'
import { getRsbuildConfig } from 'rsbuild-config-cozy-app'

const config = getRsbuildConfig({
title: 'Cozy Photos',
hasServices: true,
hasPublic: true
})

export default defineConfig(config)
2 changes: 1 addition & 1 deletion src/components/Button/CozyHomeLink.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import PropTypes from 'prop-types'
import { useI18n } from 'cozy-ui/transpiled/react'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
import Button from 'cozy-ui/transpiled/react/Buttons'
import Icon from 'cozy-ui/transpiled/react/Icon'
import { HOME_LINK_HREF } from 'photos/constants/config'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Error/ErrorShare.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
import { Empty } from 'cozy-ui/transpiled/react'
import Empty from 'cozy-ui/transpiled/react/Empty'
import CloudBrokenIcon from 'cozy-ui/transpiled/react/Icons/CloudBroken'

export const ErrorShare = ({ errorType }) => {
Expand Down
3 changes: 1 addition & 2 deletions src/components/PushBanner/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global __TARGET__ */
import React from 'react'
import PropTypes from 'prop-types'

Expand Down Expand Up @@ -28,7 +27,7 @@ const PushBanner = ({ isPublic }) => {
return <QuotaBanner />
}

if (__TARGET__ !== 'mobile' && !isFlagshipApp()) {
if (!isFlagshipApp()) {
return <BannerClient />
}

Expand Down
7 changes: 3 additions & 4 deletions src/lib/logger.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* global __APP_SLUG__ */
import minilog from '@cozy/minilog'

const logger = minilog(`cozy-${__APP_SLUG__}`)
const logger = minilog(`cozy-photos`)
minilog.enable()

minilog.suggest.allow(`cozy-${__APP_SLUG__}`, 'log')
minilog.suggest.allow(`cozy-${__APP_SLUG__}`, 'info')
minilog.suggest.allow(`cozy-photos`, 'log')
minilog.suggest.allow(`cozy-photos`, 'info')

export default logger
Loading