@defra/forms-engine-plugin 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/.public/assets/fonts/bold-affa96571d-v2.woff +0 -0
  2. package/.public/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
  3. package/.public/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
  4. package/.public/assets/fonts/light-f591b13f7d-v2.woff +0 -0
  5. package/.public/assets/images/favicon.ico +0 -0
  6. package/.public/assets/images/favicon.svg +1 -0
  7. package/.public/assets/images/govuk-crest.svg +1 -0
  8. package/.public/assets/images/govuk-icon-180.png +0 -0
  9. package/.public/assets/images/govuk-icon-192.png +0 -0
  10. package/.public/assets/images/govuk-icon-512.png +0 -0
  11. package/.public/assets/images/govuk-icon-mask.svg +1 -0
  12. package/.public/assets/images/govuk-opengraph-image.png +0 -0
  13. package/.public/assets/manifest.json +39 -0
  14. package/.public/assets-manifest.json +24 -0
  15. package/.public/javascripts/application.0fd8c18.min.js +3 -0
  16. package/.public/javascripts/application.0fd8c18.min.js.LICENSE.txt +58 -0
  17. package/.public/javascripts/application.0fd8c18.min.js.map +1 -0
  18. package/.public/javascripts/file-upload.b2f18f5.min.js +2 -0
  19. package/.public/javascripts/file-upload.b2f18f5.min.js.map +1 -0
  20. package/.public/javascripts/vendor/accessible-autocomplete.275d332.min.js +2 -0
  21. package/.public/javascripts/vendor/accessible-autocomplete.275d332.min.js.map +1 -0
  22. package/.public/stylesheets/application.e340021.min.css +14 -0
  23. package/.public/stylesheets/application.e340021.min.css.map +1 -0
  24. package/package.json +7 -2
  25. package/.browserslistrc +0 -16
  26. package/.editorconfig +0 -9
  27. package/.eslintrc.cjs +0 -266
  28. package/.github/dependabot.yml +0 -85
  29. package/.github/workflows/check-pull-request.yml +0 -209
  30. package/.github/workflows/pr-notifier.yml +0 -98
  31. package/.github/workflows/publish.yml +0 -111
  32. package/.husky/pre-commit +0 -1
  33. package/.lintstagedrc.js +0 -4
  34. package/.nvmrc +0 -1
  35. package/.prettierignore +0 -8
  36. package/.prettierrc.cjs +0 -26
  37. package/Dockerfile +0 -61
  38. package/Procfile +0 -1
  39. package/babel.config.cjs +0 -55
  40. package/compose/aws.env +0 -4
  41. package/compose/start-localstack.sh +0 -26
  42. package/docker-compose.yaml +0 -86
  43. package/globals.d.ts +0 -1
  44. package/jest.config.cjs +0 -54
  45. package/jest.environment.js +0 -4
  46. package/jest.setup.cjs +0 -14
  47. package/postcss.config.js +0 -26
  48. package/sonar-project.properties +0 -17
  49. package/stylelint.config.js +0 -10
  50. package/test/client/javascripts/file-upload.test.js +0 -1197
  51. package/test/condition/checkboxes.test.js +0 -112
  52. package/test/condition/radios.test.js +0 -112
  53. package/test/condition/text.test.js +0 -103
  54. package/test/fixtures/assets-manifest.json +0 -4
  55. package/test/fixtures/form.js +0 -86
  56. package/test/fixtures/index.js +0 -2
  57. package/test/fixtures/list.js +0 -92
  58. package/test/form/cookies.test.js +0 -338
  59. package/test/form/csrf.test.js +0 -87
  60. package/test/form/definitions/basic.js +0 -101
  61. package/test/form/definitions/blank.js +0 -10
  62. package/test/form/definitions/checkboxes.json +0 -88
  63. package/test/form/definitions/components.json +0 -452
  64. package/test/form/definitions/conditional-reveal.js +0 -140
  65. package/test/form/definitions/conditions-basic.js +0 -187
  66. package/test/form/definitions/conditions-complex.js +0 -338
  67. package/test/form/definitions/conditions-dates.js +0 -78
  68. package/test/form/definitions/conditions-escaping.js +0 -143
  69. package/test/form/definitions/demo-cph-number.js +0 -3099
  70. package/test/form/definitions/feedback.json +0 -45
  71. package/test/form/definitions/fields-optional.js +0 -402
  72. package/test/form/definitions/fields-required.js +0 -402
  73. package/test/form/definitions/file-upload-basic.js +0 -44
  74. package/test/form/definitions/file-upload.js +0 -66
  75. package/test/form/definitions/minimal.js +0 -39
  76. package/test/form/definitions/phase-alpha.json +0 -33
  77. package/test/form/definitions/phase-default.json +0 -26
  78. package/test/form/definitions/radios.json +0 -88
  79. package/test/form/definitions/repeat-mixed.js +0 -54
  80. package/test/form/definitions/repeat.js +0 -70
  81. package/test/form/definitions/status.json +0 -126
  82. package/test/form/definitions/templates.js +0 -183
  83. package/test/form/definitions/test.json +0 -581
  84. package/test/form/definitions/text.json +0 -75
  85. package/test/form/definitions/titles.json +0 -170
  86. package/test/form/definitions.test.js +0 -47
  87. package/test/form/exit-page.test.js +0 -210
  88. package/test/form/feedback.test.js +0 -68
  89. package/test/form/fields-optional.test.js +0 -237
  90. package/test/form/fields-required.test.js +0 -294
  91. package/test/form/file-upload.test.js +0 -313
  92. package/test/form/govuk-notify.test.js +0 -449
  93. package/test/form/journey-basic.test.js +0 -444
  94. package/test/form/persist-files.test.js +0 -227
  95. package/test/form/phase-banner.test.js +0 -71
  96. package/test/form/repeat.test.js +0 -628
  97. package/test/form/summary-submission-email.test.js +0 -95
  98. package/test/form/template.test.js +0 -288
  99. package/test/form/titles.test.js +0 -204
  100. package/test/helpers/component-helpers.js +0 -74
  101. package/test/utils/get-cookie.js +0 -42
  102. package/test/utils/get-form-definitions.js +0 -18
  103. package/tmp.pdf +0 -1
  104. package/tsconfig.json +0 -28
  105. package/webpack.config.js +0 -208
package/tsconfig.json DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "allowJs": true,
4
- "checkJs": true,
5
- "esModuleInterop": true,
6
- "module": "NodeNext",
7
- "noEmit": true,
8
- "resolveJsonModule": true,
9
- "skipLibCheck": true,
10
- "strict": true,
11
- "target": "es2022",
12
- "baseUrl": "./",
13
- "paths": {
14
- "~/*": ["./*"]
15
- },
16
- "types": ["@testing-library/jest-dom"]
17
- },
18
- "include": [
19
- "**/*.cjs",
20
- "**/*.js",
21
- "**/*.mjs",
22
- "**/*.ts",
23
- ".eslintrc.*",
24
- ".prettierrc.*",
25
- ".lintstagedrc.*"
26
- ],
27
- "exclude": ["coverage", "node_modules", ".public", ".server"]
28
- }
package/webpack.config.js DELETED
@@ -1,208 +0,0 @@
1
- import { createRequire } from 'node:module'
2
- import { dirname, join } from 'node:path'
3
-
4
- import { CleanWebpackPlugin } from 'clean-webpack-plugin'
5
- import CopyPlugin from 'copy-webpack-plugin'
6
- import TerserPlugin from 'terser-webpack-plugin'
7
- import WebpackAssetsManifest from 'webpack-assets-manifest'
8
-
9
- const { NODE_ENV = 'development' } = process.env
10
-
11
- const require = createRequire(import.meta.url)
12
-
13
- const govukFrontendPath = dirname(
14
- require.resolve('govuk-frontend/package.json')
15
- )
16
-
17
- /**
18
- * @type {Configuration}
19
- */
20
- export default {
21
- context: join(import.meta.dirname, 'src/client'),
22
- entry: {
23
- application: {
24
- import: ['./javascripts/application.js', './stylesheets/application.scss']
25
- },
26
- 'file-upload': './javascripts/file-upload.js'
27
- },
28
- experiments: {
29
- outputModule: true
30
- },
31
- mode: NODE_ENV === 'production' ? 'production' : 'development',
32
- devtool: NODE_ENV === 'production' ? 'source-map' : 'inline-source-map',
33
- watchOptions: {
34
- aggregateTimeout: 200,
35
- poll: 1000
36
- },
37
- output: {
38
- filename:
39
- NODE_ENV === 'production'
40
- ? 'javascripts/[name].[contenthash:7].min.js'
41
- : 'javascripts/[name].js',
42
-
43
- chunkFilename:
44
- NODE_ENV === 'production'
45
- ? 'javascripts/[name].[chunkhash:7].min.js'
46
- : 'javascripts/[name].js',
47
-
48
- path: join(import.meta.dirname, '.public'),
49
- libraryTarget: 'module',
50
- module: true
51
- },
52
- resolve: {
53
- alias: {
54
- '/assets': join(govukFrontendPath, 'dist/govuk/assets')
55
- }
56
- },
57
- module: {
58
- rules: [
59
- {
60
- test: /\.(js|mjs|scss)$/,
61
- loader: 'source-map-loader',
62
- enforce: 'pre'
63
- },
64
- {
65
- test: /\.js$/,
66
- loader: 'babel-loader',
67
- exclude: /node_modules/,
68
- options: {
69
- browserslistEnv: 'javascripts',
70
- cacheDirectory: true,
71
- extends: join(import.meta.dirname, 'babel.config.cjs'),
72
- presets: [
73
- [
74
- '@babel/preset-env',
75
- {
76
- // Apply bug fixes to avoid transforms
77
- bugfixes: true,
78
-
79
- // Apply smaller "loose" transforms for browsers
80
- loose: true,
81
-
82
- // Skip CommonJS modules transform
83
- modules: false
84
- }
85
- ]
86
- ]
87
- },
88
-
89
- // Flag loaded modules as side effect free
90
- sideEffects: false
91
- },
92
- {
93
- test: /\.scss$/,
94
- type: 'asset/resource',
95
- generator: {
96
- binary: false,
97
- filename:
98
- NODE_ENV === 'production'
99
- ? 'stylesheets/[name].[contenthash:7].min.css'
100
- : 'stylesheets/[name].css'
101
- },
102
- use: [
103
- 'postcss-loader',
104
- {
105
- loader: 'sass-loader',
106
- options: {
107
- sassOptions: {
108
- quietDeps: true,
109
- sourceMapIncludeSources: true,
110
- style: 'expanded'
111
- },
112
- warnRuleAsWarning: true
113
- }
114
- }
115
- ]
116
- },
117
- {
118
- test: /\.(png|svg|jpe?g|gif)$/,
119
- type: 'asset/resource',
120
- generator: {
121
- filename: 'assets/images/[name][ext]'
122
- }
123
- },
124
- {
125
- test: /\.(ico)$/,
126
- type: 'asset/resource',
127
- generator: {
128
- filename: 'assets/images/[name][ext]'
129
- }
130
- },
131
- {
132
- test: /\.(woff|woff2|eot|ttf|otf)$/,
133
- type: 'asset/resource',
134
- generator: {
135
- filename: 'assets/fonts/[name][ext]'
136
- }
137
- }
138
- ]
139
- },
140
- optimization: {
141
- minimize: NODE_ENV === 'production',
142
- minimizer: [
143
- new TerserPlugin({
144
- terserOptions: {
145
- // Use webpack default compress options
146
- // https://webpack.js.org/configuration/optimization/#optimizationminimizer
147
- compress: { passes: 2 },
148
-
149
- // Allow Terser to remove @preserve comments
150
- format: { comments: false },
151
-
152
- // Include sources content from dependency source maps
153
- sourceMap: {
154
- includeSources: true
155
- },
156
-
157
- // Compatibility workarounds
158
- safari10: true
159
- }
160
- })
161
- ],
162
- splitChunks: {
163
- cacheGroups: {
164
- defaultVendors: {
165
- /**
166
- * Use npm package names
167
- * @param {NormalModule} module
168
- */
169
- name({ userRequest }) {
170
- const [[modulePath, pkgName]] = userRequest.matchAll(
171
- /node_modules\/([^\\/]+)/g
172
- )
173
-
174
- // Move into /javascripts/vendor
175
- return join('vendor', pkgName || modulePath)
176
- }
177
- }
178
- }
179
- },
180
-
181
- // Skip bundling unused modules
182
- providedExports: true,
183
- sideEffects: true,
184
- usedExports: true
185
- },
186
- plugins: [
187
- new CleanWebpackPlugin(),
188
- new WebpackAssetsManifest(),
189
- new CopyPlugin({
190
- patterns: [
191
- {
192
- from: join(govukFrontendPath, 'dist/govuk/assets'),
193
- to: 'assets'
194
- }
195
- ]
196
- })
197
- ],
198
- stats: {
199
- errorDetails: true,
200
- loggingDebug: ['sass-loader'],
201
- preset: 'minimal'
202
- },
203
- target: 'browserslist:javascripts'
204
- }
205
-
206
- /**
207
- * @import { Configuration, NormalModule } from 'webpack'
208
- */