Skip to content

Commit

Permalink
Merge branch 'releases/4.3.0' into features/ML-folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Convly committed Jul 27, 2022
2 parents c83427e + a4c2f3b commit 2d6afbf
Show file tree
Hide file tree
Showing 381 changed files with 10,915 additions and 3,632 deletions.
11 changes: 0 additions & 11 deletions examples/getstarted/global.d.ts

This file was deleted.

9 changes: 9 additions & 0 deletions examples/getstarted/src/admin/app.example.js
@@ -0,0 +1,9 @@
const config = {
locales: ['fr'],
};
const bootstrap = () => {};

export default {
config,
bootstrap,
};
6 changes: 0 additions & 6 deletions examples/getstarted/src/admin/app.js

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions examples/kitchensink-ts/config/admin.ts
@@ -0,0 +1,8 @@
export default ({ env }) => ({
auth: {
secret: env('ADMIN_JWT_SECRET', 'example-token'),
},
apiToken: {
salt: env('API_TOKEN_SALT', 'example-salt'),
},
});
7 changes: 7 additions & 0 deletions examples/kitchensink-ts/config/api.ts
@@ -0,0 +1,7 @@
export default {
rest: {
defaultLimit: 25,
maxLimit: 100,
withCount: true,
},
};
11 changes: 11 additions & 0 deletions examples/kitchensink-ts/config/database.ts
@@ -0,0 +1,11 @@
import path from 'path';

export default ({ env }) => ({
connection: {
client: 'sqlite',
connection: {
filename: path.join(__dirname, '..', '..', env('DATABASE_FILENAME', '.tmp/data.db')),
},
useNullAsDefault: true,
},
});
12 changes: 12 additions & 0 deletions examples/kitchensink-ts/config/middlewares.ts
@@ -0,0 +1,12 @@
export default [
'strapi::errors',
'strapi::security',
'strapi::cors',
'strapi::poweredBy',
'strapi::logger',
'strapi::query',
'strapi::body',
'strapi::session',
'strapi::favicon',
'strapi::public',
];
7 changes: 7 additions & 0 deletions examples/kitchensink-ts/config/server.ts
@@ -0,0 +1,7 @@
export default ({ env }) => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
app: {
keys: env.array('APP_KEYS'),
},
});
File renamed without changes.
30 changes: 30 additions & 0 deletions examples/kitchensink-ts/package.json
@@ -0,0 +1,30 @@
{
"name": "kitchensink-ts",
"private": true,
"version": "4.2.2",
"description": "A Strapi application",
"scripts": {
"develop": "strapi develop",
"start": "strapi start",
"build": "strapi build",
"strapi": "strapi"
},
"devDependencies": {},
"dependencies": {
"@strapi/strapi": "4.2.2",
"@strapi/plugin-users-permissions": "4.1.12",
"@strapi/plugin-i18n": "4.1.12",
"better-sqlite3": "7.4.6"
},
"author": {
"name": "A Strapi developer"
},
"strapi": {
"uuid": "getstarted"
},
"engines": {
"node": ">=14.19.1 <=16.x.x",
"npm": ">=6.0.0"
},
"license": "MIT"
}
File renamed without changes.
5 changes: 5 additions & 0 deletions examples/kitchensink-ts/src/admin/tsconfig.json
@@ -0,0 +1,5 @@
{
"extends": "@strapi/typescript-utils/tsconfigs/admin",
"include": ["../plugins/**/admin/src/**/*", "./"],
"exclude": ["node_modules/", "build/", "dist/", "**/*.test.ts"]
}
6 changes: 6 additions & 0 deletions examples/kitchensink-ts/src/admin/webpack.config.example.ts
@@ -0,0 +1,6 @@
export default (config, webpack) => {
// Note: we provide webpack above so you should not `require` it
// Perform customizations to webpack config
// Important: return the modified config
return config;
};
File renamed without changes.
20 changes: 20 additions & 0 deletions examples/kitchensink-ts/src/index.ts
@@ -0,0 +1,20 @@
import '@strapi/strapi';

export default {
/**
* An asynchronous register function that runs before
* your application is initialized.
*
* This gives you an opportunity to extend code.
*/
register(/*{ strapi }*/) {},

/**
* An asynchronous bootstrap function that runs before
* your application gets started.
*
* This gives you an opportunity to set up your data model,
* run jobs, or perform some special logic.
*/
bootstrap(/*{ strapi }*/) {},
};
18 changes: 18 additions & 0 deletions examples/kitchensink-ts/tsconfig.json
@@ -0,0 +1,18 @@
{
"extends": "@strapi/typescript-utils/tsconfigs/server",
"compilerOptions": {
"outDir": "dist",
"rootDir": "."
},
"include": ["./", "src/**/*.json"],
"exclude": [
"node_modules/",
"build/",
"dist/",
".cache/",
".tmp/",
"src/admin/",
"**/*.test.ts",
"src/plugins/**"
]
}
4 changes: 4 additions & 0 deletions examples/kitchensink/config/plugins.js
@@ -0,0 +1,4 @@
module.exports = {
// ...
// ...
};
62 changes: 34 additions & 28 deletions examples/kitchensink/src/admin/app.example.js
@@ -1,33 +1,39 @@
import theme from './extensions/theme';

export default {
config: {
auth: {
logo:
'https://images.unsplash.com/photo-1593642634367-d91a135587b5?ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80',
},
head: {
favicon:
'https://images.unsplash.com/photo-1593642634367-d91a135587b5?ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80',
title: 'Strapi test',
},
locales: ['fr', 'de'],
menu: {
logo:
'https://images.unsplash.com/photo-1593642634367-d91a135587b5?ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80',
},
theme,
translations: {
fr: {
'Auth.form.email.label': 'test',
Users: 'Utilisateurs',
City: 'CITY FRENCH',
// Customize the label of the CM table..
Id: 'ID french',
},
const config = {
auth: {
logo:
'https://images.unsplash.com/photo-1593642634367-d91a135587b5?ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80',
},
head: {
favicon:
'https://images.unsplash.com/photo-1593642634367-d91a135587b5?ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80',
title: 'Strapi test',
},
locales: ['fr', 'de'],
menu: {
logo:
'https://images.unsplash.com/photo-1593642634367-d91a135587b5?ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80',
},
theme,
translations: {
fr: {
'Auth.form.email.label': 'test',
Users: 'Utilisateurs',
City: 'CITY FRENCH',
// Customize the label of the CM table..
Id: 'ID french',
},
tutorials: false,
notifications: { release: false },
},
bootstrap() {},
tutorials: false,
notifications: { release: false },
};

const bootstrap = app => {
console.log(app);
};

export default {
config,
bootstrap,
};
39 changes: 39 additions & 0 deletions examples/kitchensink/src/admin/app.js
@@ -0,0 +1,39 @@
import theme from './extensions/theme';

const config = {
auth: {
logo:
'https://images.unsplash.com/photo-1593642634367-d91a135587b5?ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80',
},
head: {
favicon:
'https://images.unsplash.com/photo-1593642634367-d91a135587b5?ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80',
title: 'Strapi tesrrt',
},
locales: ['fr', 'de'],
menu: {
logo:
'https://images.unsplash.com/photo-1593642634367-d91a135587b5?ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80',
},
theme,
translations: {
fr: {
'Auth.form.email.label': 'test',
Users: 'Utilisateurs',
City: 'CITY FRENCH',
// Customize the label of the CM table..
Id: 'ID french',
},
},
tutorials: false,
notifications: { release: false },
};

const bootstrap = app => {
console.log(app);
};

export default {
config,
bootstrap,
};
2 changes: 1 addition & 1 deletion jest.base-config.front.js
Expand Up @@ -53,7 +53,7 @@ module.exports = {
],
testEnvironment: 'jsdom',
transform: {
'^.+\\.js$': ['@swc-node/jest', { jsx: true, dynamicImport: true }],
'^.+\\.js$': ['@swc/jest', { jsc: { parser: { jsx: true, dynamicImport: true } } }],
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/fileTransformer.js',
},
Expand Down
11 changes: 6 additions & 5 deletions package.json
Expand Up @@ -71,7 +71,8 @@
"@babel/polyfill": "7.12.1"
},
"devDependencies": {
"@swc-node/jest": "1.5.0",
"@swc/core": "1.2.218",
"@swc/jest": "0.2.22",
"@testing-library/react": "11.2.7",
"@testing-library/react-hooks": "3.7.0",
"@testing-library/user-event": "13.5.0",
Expand All @@ -98,11 +99,11 @@
"glob": "7.2.3",
"husky": "3.1.0",
"istanbul": "~0.4.2",
"jest": "28.1.2",
"jest": "28.1.3",
"jest-circus": "28.1.3",
"jest-cli": "28.1.2",
"jest-environment-jsdom": "28.1.2",
"jest-watch-typeahead": "0.6.5",
"jest-cli": "28.1.3",
"jest-environment-jsdom": "28.1.3",
"jest-watch-typeahead": "2.0.0",
"lerna": "5.1.6",
"lint-staged": "10.5.4",
"lodash": "4.17.21",
Expand Down
1 change: 1 addition & 0 deletions packages/admin-test-utils/lib/fixtures/store/index.js
Expand Up @@ -4,6 +4,7 @@
const { combineReducers, createStore } = require('redux');

const reducers = {
admin_app: jest.fn(() => ({ status: 'init' })),
'content-manager_app': jest.fn(() => ({
components: [],
status: 'loading',
Expand Down
1 change: 1 addition & 0 deletions packages/cli/create-strapi-app/create-strapi-app.js
Expand Up @@ -37,6 +37,7 @@ program
.option('--dbfile <dbfile>', 'Database file path for sqlite')
.option('--dbforce', 'Overwrite database content if any')
.option('--template <templateurl>', 'Specify a Strapi template')
.option('--ts, --typescript', 'Use TypeScript to generate the project')
.description('create a new application')
.action(directory => {
initProject(directory, program);
Expand Down
11 changes: 7 additions & 4 deletions packages/core/admin/admin/src/app.js
@@ -1,6 +1,9 @@
const config = {
locales: ['fr'],
};
const bootstrap = () => {};

export default {
config: {
locales: ['fr'],
},
bootstrap() {},
config,
bootstrap,
};
Expand Up @@ -3,7 +3,7 @@ import { render, screen } from '@testing-library/react';
import { Router } from 'react-router-dom';
import { createMemoryHistory } from 'history';
import { IntlProvider } from 'react-intl';
import { useGuidedTour } from '@strapi/helper-plugin';
import { useGuidedTour, TrackingContext } from '@strapi/helper-plugin';
import { ThemeProvider, lightTheme } from '@strapi/design-system';
import GuidedTourHomepage from '../index';

Expand Down Expand Up @@ -31,13 +31,15 @@ jest.mock('@strapi/helper-plugin', () => ({
const history = createMemoryHistory();

const App = (
<ThemeProvider theme={lightTheme}>
<IntlProvider locale="en" messages={{}} textComponent="span">
<Router history={history}>
<GuidedTourHomepage />
</Router>
</IntlProvider>
</ThemeProvider>
<TrackingContext.Provider value={{ uuid: null, telemetryProperties: undefined }}>
<ThemeProvider theme={lightTheme}>
<IntlProvider locale="en" messages={{}} textComponent="span">
<Router history={history}>
<GuidedTourHomepage />
</Router>
</IntlProvider>
</ThemeProvider>
</TrackingContext.Provider>
);

describe('GuidedTour Homepage', () => {
Expand Down

0 comments on commit 2d6afbf

Please sign in to comment.