Skip to content

Commit 31144a9

Browse files
author
GitHub Action
committed
Update from Altis Accelerate
1 parent 9d28305 commit 31144a9

File tree

271 files changed

+47614
-22850
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+47614
-22850
lines changed

.babelrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
const isProduction = process.env.NODE_ENV === 'production';
2+
13
module.exports = {
24
presets: [
35
'@babel/preset-typescript',
46
'@humanmade/webpack-helpers/babel-preset'
5-
],
7+
]
68
};

.config/externals.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const { externals } = require( '@humanmade/webpack-helpers' );
2+
3+
const myExternals = {
4+
'@wordpress/preferences': 'wp.preferences',
5+
...externals,
6+
};
7+
8+
module.exports = myExternals;

.config/webpack.config.dev.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/**
22
* This file defines the development build configuration
33
*/
4-
const { helpers, externals, loaders, presets } = require( '@humanmade/webpack-helpers' );
4+
const { helpers, loaders, presets } = require( '@humanmade/webpack-helpers' );
5+
const externals = require( './externals' );
56
const { choosePort, filePath } = helpers;
67

78
// Mutate the loader defaults.
@@ -19,15 +20,14 @@ module.exports = choosePort( 8080 ).then( port =>
1920
"dashboard": filePath( 'src/dashboard/index.tsx' ),
2021
"global-blocks": filePath( 'src/global-blocks/index.js' ),
2122
'accelerate': filePath( 'src/accelerate.js' ),
22-
'audiences/data': filePath( 'src/audiences/data/index.js' ),
23+
'audiences/data': filePath( 'src/audiences/data/index.ts' ),
2324
'audiences/preview': filePath( 'src/audiences/preview/index.js' ),
2425
'audiences/ui': filePath( 'src/audiences/index.js' ),
2526
'blocks/data': filePath( 'src/blocks/data/index.js' ),
2627
'blocks/ui': filePath( 'src/blocks/index.js' ),
2728
'blocks/ab-test-preview': filePath( 'src/ab-test-preview.js' ),
2829
'blocks/altis-xb-preview': filePath( 'src/preview/altis-xb-preview.js' ),
2930
'blocks/broadcast': filePath( 'inc/blocks/broadcast/index.js' ),
30-
'blocks/ai': filePath( 'inc/ai/admin/index.js' ),
3131
'experiments': filePath( 'src/experiments.js' ),
3232
'experiments/sidebar': filePath( 'src/experiments/index.js' ),
3333
'titles': filePath( 'src/experiments/titles/index.js' ),
@@ -39,14 +39,19 @@ module.exports = choosePort( 8080 ).then( port =>
3939
filename: '[name].[hash:8].js',
4040
chunkFilename: 'chunk.[id].[chunkhash:8].js',
4141
},
42+
optimization: {
43+
runtimeChunk: 'single',
44+
nodeEnv: 'development',
45+
splitChunks: false,
46+
},
4247
resolve: {
4348
extensions: [
4449
'.ts',
4550
'.tsx',
4651
'.wasm',
4752
'.mjs',
4853
'.js',
49-
'.json',
54+
'.json'
5055
],
5156
},
5257
} ),

.config/webpack.config.prod.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/**
22
* This file defines the production build configuration
33
*/
4-
const { helpers, externals, loaders, presets } = require( '@humanmade/webpack-helpers' );
4+
const { helpers, loaders, presets } = require( '@humanmade/webpack-helpers' );
5+
const externals = require( './externals' );
56
const { filePath } = helpers;
67

78
// Mutate the loader defaults.
89
loaders.ts.defaults.loader = 'babel-loader';
9-
// Increase url-loader limit to embed logo inline.
10-
loaders.url.defaults.options.limit = 200000;
1110

1211
module.exports = presets.production( {
1312
externals,
@@ -16,15 +15,14 @@ module.exports = presets.production( {
1615
"dashboard": filePath( 'src/dashboard/index.tsx' ),
1716
"global-blocks": filePath( 'src/global-blocks/index.js' ),
1817
'accelerate': filePath( 'src/accelerate.js' ),
19-
'audiences/data': filePath( 'src/audiences/data/index.js' ),
18+
'audiences/data': filePath( 'src/audiences/data/index.ts' ),
2019
'audiences/preview': filePath( 'src/audiences/preview/index.js' ),
2120
'audiences/ui': filePath( 'src/audiences/index.js' ),
2221
'blocks/data': filePath( 'src/blocks/data/index.js' ),
2322
'blocks/ui': filePath( 'src/blocks/index.js' ),
2423
'blocks/ab-test-preview': filePath( 'src/ab-test-preview.js' ),
2524
'blocks/altis-xb-preview': filePath( 'src/preview/altis-xb-preview.js' ),
2625
'blocks/broadcast': filePath( 'inc/blocks/broadcast/index.js' ),
27-
'blocks/ai': filePath( 'inc/ai/admin/index.js' ),
2826
'experiments': filePath( 'src/experiments.js' ),
2927
'experiments/sidebar': filePath( 'src/experiments/index.js' ),
3028
'titles': filePath( 'src/experiments/titles/index.js' ),

.eslintrc.js

Lines changed: 75 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,24 @@
33
* as well as copy-and-paste from and to other .eslintrc JSON files.
44
*/
55

6-
const isProduction = process.env.NODE_ENV === 'production';
7-
86
module.exports = {
97
'root': true,
108
'extends': [
11-
'humanmade',
12-
'plugin:@wordpress/eslint-plugin/recommended',
9+
'@humanmade/eslint-config',
10+
'plugin:@wordpress/eslint-plugin/custom',
11+
// 'plugin:@wordpress/eslint-plugin/react',
1312
'plugin:import/errors',
1413
],
14+
'parserOptions': {
15+
'ecmaVersion': 2022,
16+
'sourceType': 'module',
17+
'ecmaFeatures': {
18+
'jsx': true,
19+
},
20+
'babelOptions': {
21+
'configFile': './.babelrc.js',
22+
},
23+
},
1524
'globals': {
1625
'Altis': 'readonly',
1726
'wp': 'readonly',
@@ -29,120 +38,72 @@ module.exports = {
2938
'no-multi-str': 'off',
3039
'no-console': 'off',
3140
'no-shadow': 'off',
32-
'jsdoc/no-undefined-types': 'off',
3341
'react/react-in-jsx-scope': 'off',
42+
'@wordpress/no-unused-vars-before-return': 'off',
43+
// Disable TypeScript ESLint rules that duplicate TypeScript compiler checks
44+
'@typescript-eslint/no-unused-vars': 'off',
45+
'@typescript-eslint/no-explicit-any': 'off',
46+
'@typescript-eslint/ban-ts-comment': 'off',
47+
'@typescript-eslint/no-non-null-assertion': 'off',
48+
// Disable import validation that conflicts with TypeScript
49+
'import/named': 'off',
50+
'import/no-unresolved': 'off',
51+
'import/namespace': 'off',
52+
'import/default': 'off',
53+
'import/export': 'off',
54+
// Disable all JSDoc rules
55+
'jsdoc/check-access': 'off',
56+
'jsdoc/check-alignment': 'off',
57+
'jsdoc/check-examples': 'off',
58+
'jsdoc/check-indentation': 'off',
59+
'jsdoc/check-line-alignment': 'off',
60+
'jsdoc/check-param-names': 'off',
61+
'jsdoc/check-property-names': 'off',
62+
'jsdoc/check-syntax': 'off',
3463
'jsdoc/check-tag-names': 'off',
3564
'jsdoc/check-types': 'off',
36-
'import/no-unresolved': [
37-
'error',
38-
{
39-
"commonjs": true,
40-
"ignore": [
41-
// eslint-disable-next-line no-useless-escape
42-
"^@wordpress\/[^/]+"
43-
]
44-
}
45-
],
65+
'jsdoc/check-values': 'off',
66+
'jsdoc/empty-tags': 'off',
67+
'jsdoc/implements-on-classes': 'off',
68+
'jsdoc/match-description': 'off',
69+
'jsdoc/multiline-blocks': 'off',
70+
'jsdoc/newline-after-description': 'off',
71+
'jsdoc/no-bad-blocks': 'off',
72+
'jsdoc/no-defaults': 'off',
73+
'jsdoc/no-missing-syntax': 'off',
74+
'jsdoc/no-multi-asterisks': 'off',
75+
'jsdoc/no-restricted-syntax': 'off',
76+
'jsdoc/no-types': 'off',
77+
'jsdoc/no-undefined-types': 'off',
78+
'jsdoc/require-asterisk-prefix': 'off',
79+
'jsdoc/require-description': 'off',
80+
'jsdoc/require-description-complete-sentence': 'off',
81+
'jsdoc/require-example': 'off',
82+
'jsdoc/require-file-overview': 'off',
83+
'jsdoc/require-hyphen-before-param-description': 'off',
84+
'jsdoc/require-jsdoc': 'off',
85+
'jsdoc/require-param': 'off',
86+
'jsdoc/require-param-description': 'off',
87+
'jsdoc/require-param-name': 'off',
88+
'jsdoc/require-param-type': 'off',
89+
'jsdoc/require-property': 'off',
90+
'jsdoc/require-property-description': 'off',
91+
'jsdoc/require-property-name': 'off',
92+
'jsdoc/require-property-type': 'off',
93+
'jsdoc/require-returns': 'off',
94+
'jsdoc/require-returns-check': 'off',
95+
'jsdoc/require-returns-description': 'off',
96+
'jsdoc/require-returns-type': 'off',
97+
'jsdoc/require-throws': 'off',
98+
'jsdoc/require-yields': 'off',
99+
'jsdoc/require-yields-check': 'off',
100+
'jsdoc/tag-lines': 'off',
101+
'jsdoc/valid-types': 'off',
102+
'react-hooks/rules-of-hooks': 'off',
46103
'jsx-a11y/no-autofocus': 'off',
104+
'@wordpress/no-unsafe-wp-apis': 'off',
105+
'no-mixed-operators': 'off',
106+
'jsx-a11y/anchor-is-valid': 'off',
47107
},
48108
};
49109

50-
/*
51-
52-
module.exports = {
53-
"root": true,
54-
"extends": [
55-
"humanmade",
56-
"plugin:@wordpress/eslint-plugin/recommended",
57-
"plugin:import/errors"
58-
],
59-
"globals": {
60-
"Altis": "readonly",
61-
"wp": "readonly",
62-
"moment": "readonly"
63-
},
64-
"env": {
65-
"browser": true
66-
},
67-
"plugins": [
68-
"jsdoc"
69-
],
70-
"settings": {
71-
"import/resolver": {
72-
"node": {
73-
"extensions": [".js", ".jsx", ".ts", ".tsx"]
74-
}
75-
}
76-
},
77-
"rules": {
78-
"@wordpress/dependency-group": "off",
79-
"@wordpress/react-no-unsafe-timeout": "error",
80-
"import/no-unresolved": [
81-
"error",
82-
{
83-
"commonjs": true,
84-
"ignore": [
85-
// eslint-disable-next-line no-useless-escape
86-
"^@wordpress\/[^/]+"
87-
]
88-
}
89-
],
90-
// "jsdoc/check-param-names": "warn",
91-
// "jsdoc/check-tag-names": "warn",
92-
// "jsdoc/check-types": [
93-
// "warn",
94-
// {
95-
// "noDefaults": true
96-
// }
97-
// ],
98-
// "jsdoc/newline-after-description": "warn",
99-
// "jsdoc/no-undefined-types": "warn",
100-
// "jsdoc/require-description-complete-sentence": "warn",
101-
"jsdoc/require-hyphen-before-param-description": 0,
102-
// "jsdoc/require-param": "warn",
103-
// "jsdoc/require-param-description": "warn",
104-
// "jsdoc/require-param-name": "warn",
105-
// "jsdoc/require-param-type": "warn",
106-
// "jsdoc/require-returns-type": "warn",
107-
// "jsdoc/valid-types": "warn",
108-
// "max-len": [
109-
// "warn",
110-
// 120
111-
// ],
112-
"no-console": isProduction ? "error" : "warn",
113-
"no-debugger": isProduction ? "error" : "warn",
114-
"no-multi-str": "off",
115-
"no-plusplus": "off",
116-
"no-shadow": "off",
117-
"no-unused-vars": [
118-
"warn",
119-
{
120-
"vars": "all",
121-
"varsIgnorePattern": "_",
122-
"args": "after-used",
123-
"argsIgnorePattern": "_",
124-
"ignoreRestSiblings": true
125-
}
126-
],
127-
"operator-linebreak": [
128-
"error",
129-
"before",
130-
{
131-
"overrides": {
132-
"=": "none"
133-
}
134-
}
135-
],
136-
"react/prop-types": "off",
137-
"react/react-in-jsx-scope": "off",
138-
"valid-jsdoc": [
139-
"off",
140-
{}
141-
],
142-
143-
// There is an issue with references not being detected when used as JSX component name (e.g., App in <App />).
144-
"@wordpress/no-unused-vars-before-return": "off",
145-
}
146-
};
147-
148-
*/

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ node_modules/
1919
# Built and generated files
2020
/deploy/
2121

22+
# Local AU tasks
23+
/tasks/
24+
2225
# Git
2326
!.gitkeep
2427

2528
# Caches
2629
.phpunit.result.cache
30+
tests/e2e/artifacts

.setup/create-analytics-table.sql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
drop table if exists analytics;
2-
create table analytics (
1+
create table if not exists analytics (
32
request_id UUID DEFAULT generateUUIDv4(),
43
app_id String,
54
blog_id String materialized accurateCastOrDefault(attributes['blogId'], 'String', '1'),

.wordpress-org/banner-1544x500.png

-198 KB
Loading

.wordpress-org/banner-772x250.png

54.8 KB
Loading

.wordpress-org/icon-256x256.png

-38.1 KB
Loading

0 commit comments

Comments
 (0)