@storepress/create-plugin-html 0.0.6 → 0.1.1

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 (25) hide show
  1. package/README.md +5 -6
  2. package/index.js +80 -11
  3. package/package.json +1 -1
  4. package/plugin-templates/.github/workflows/deploy-github-pages.yaml.mustache +1 -0
  5. package/plugin-templates/eslint.config.js.mustache +133 -0
  6. package/plugin-templates/index-module.html.mustache +30 -0
  7. package/plugin-templates/index.html.mustache +47 -24
  8. package/plugin-templates/src/interactive/index.js.mustache +22 -0
  9. package/plugin-templates/src/react/index.js.mustache +41 -0
  10. package/{block-templates → plugin-templates/src/storepress}/Plugin.js.mustache +2 -2
  11. package/plugin-templates/src/storepress/index.js.mustache +20 -0
  12. package/plugin-templates/src/storepress/script.js.mustache +9 -0
  13. package/{block-templates → plugin-templates/src/storepress}/style.scss.mustache +2 -2
  14. package/plugin-templates/tools/changelog.js.mustache +40 -41
  15. package/plugin-templates/tools/package.js.mustache +47 -39
  16. package/plugin-templates/tools/packages-install.js.mustache +0 -2
  17. package/plugin-templates/tools/webpack-helpers.js.mustache +10 -37
  18. package/plugin-templates/tools/webpack.config.externals.js.mustache +130 -0
  19. package/plugin-templates/webpack.config.js.mustache +94 -85
  20. package/block-templates/index.js.mustache +0 -20
  21. package/plugin-templates/.eslintrc.js.mustache +0 -196
  22. package/plugin-templates/global-style.css.mustache +0 -14
  23. package/plugin-templates/script.js.mustache +0 -8
  24. package/plugin-templates/style.scss.mustache +0 -10
  25. /package/{block-templates → plugin-templates/src/storepress}/_mixins.scss.mustache +0 -0
@@ -1,196 +0,0 @@
1
- const restrictedImports = [
2
- {
3
- name: 'lodash',
4
- importNames: [
5
- 'camelCase',
6
- 'capitalize',
7
- 'castArray',
8
- 'chunk',
9
- 'clamp',
10
- 'clone',
11
- 'cloneDeep',
12
- 'compact',
13
- 'concat',
14
- 'countBy',
15
- 'debounce',
16
- 'deburr',
17
- 'defaults',
18
- 'defaultTo',
19
- 'delay',
20
- 'difference',
21
- 'differenceWith',
22
- 'dropRight',
23
- 'each',
24
- 'escape',
25
- 'escapeRegExp',
26
- 'every',
27
- 'extend',
28
- 'filter',
29
- 'find',
30
- 'findIndex',
31
- 'findKey',
32
- 'findLast',
33
- 'first',
34
- 'flatMap',
35
- 'flatten',
36
- 'flattenDeep',
37
- 'flow',
38
- 'flowRight',
39
- 'forEach',
40
- 'fromPairs',
41
- 'has',
42
- 'identity',
43
- 'includes',
44
- 'invoke',
45
- 'isArray',
46
- 'isBoolean',
47
- 'isEqual',
48
- 'isFinite',
49
- 'isFunction',
50
- 'isMatch',
51
- 'isNil',
52
- 'isNumber',
53
- 'isObject',
54
- 'isObjectLike',
55
- 'isPlainObject',
56
- 'isString',
57
- 'isUndefined',
58
- 'keyBy',
59
- 'keys',
60
- 'last',
61
- 'lowerCase',
62
- 'map',
63
- 'mapKeys',
64
- 'maxBy',
65
- 'memoize',
66
- 'merge',
67
- 'negate',
68
- 'noop',
69
- 'nth',
70
- 'omit',
71
- 'omitBy',
72
- 'once',
73
- 'orderby',
74
- 'overEvery',
75
- 'partial',
76
- 'partialRight',
77
- 'pick',
78
- 'pickBy',
79
- 'random',
80
- 'reduce',
81
- 'reject',
82
- 'repeat',
83
- 'reverse',
84
- 'setWith',
85
- 'size',
86
- 'snakeCase',
87
- 'some',
88
- 'sortBy',
89
- 'startCase',
90
- 'startsWith',
91
- 'stubFalse',
92
- 'stubTrue',
93
- 'sum',
94
- 'sumBy',
95
- 'take',
96
- 'throttle',
97
- 'times',
98
- 'toString',
99
- 'trim',
100
- 'truncate',
101
- 'unescape',
102
- 'unionBy',
103
- 'uniq',
104
- 'uniqBy',
105
- 'uniqueId',
106
- 'uniqWith',
107
- 'upperFirst',
108
- 'values',
109
- 'without',
110
- 'words',
111
- 'xor',
112
- 'zip',
113
- ],
114
- message:
115
- 'This Lodash method is not recommended. Please use native functionality instead. If using `memoize`, please use `memize` instead.',
116
- },
117
- {
118
- name: 'classnames',
119
- message:
120
- "Please use `clsx` instead. It's a lighter and faster drop-in replacement for `classnames`.",
121
- },
122
- ];
123
-
124
- module.exports = {
125
- root: true,
126
- extends: [
127
- 'plugin:@woocommerce/eslint-plugin/recommended',
128
- 'plugin:you-dont-need-lodash-underscore/compatible',
129
- ],
130
- settings: {
131
- // List of modules that are externals in our webpack config.
132
- // This helps the `import/no-extraneous-dependencies` and
133
- //`import/no-unresolved` rules account for them.
134
- 'import/core-modules': [
135
- '@woocommerce/blocks-registry',
136
- '@wordpress/is-shallow-equal',
137
- '@woocommerce/block-data',
138
- '@woocommerce/blocks-checkout',
139
- '@woocommerce/price-format',
140
- '@woocommerce/settings',
141
- '@woocommerce/shared-context',
142
- '@woocommerce/shared-hocs',
143
- '@woocommerce/data',
144
- '@wordpress/components',
145
- '@wordpress/i18n',
146
- '@wordpress/blocks',
147
- '@wordpress/a11y',
148
- '@wordpress/api-fetch',
149
- '@wordpress/block-editor',
150
- '@wordpress/compose',
151
- '@wordpress/data',
152
- '@wordpress/core-data',
153
- '@wordpress/editor',
154
- '@wordpress/escape-html',
155
- '@wordpress/hooks',
156
- '@wordpress/keycodes',
157
- '@wordpress/url',
158
- '@wordpress/element',
159
- '@woocommerce/blocks-test-utils',
160
- '@woocommerce/e2e-utils',
161
- 'lodash',
162
- 'jquery',
163
- '@storepress/utils',
164
- '@utils', // See: getWebPackAlias() from tools/webpack-helpers.js
165
- ],
166
- 'import/resolver': {
167
- node: {},
168
- webpack: {},
169
- },
170
- },
171
- env: {
172
- browser: true,
173
- es6: true,
174
- node: true,
175
- },
176
- globals: {
177
- jQuery: 'readonly',
178
- wp: true,
179
- wpApiSettings: true,
180
- wcSettings: true,
181
- es6: true,
182
- StorePress: true,
183
- },
184
- rules: {
185
- '@woocommerce/dependency-group': 'off',
186
- '@wordpress/no-unsafe-wp-apis': 'warn',
187
- 'react/react-in-jsx-scope': 'off',
188
- 'no-restricted-imports': [
189
- 'error',
190
- {
191
- paths: restrictedImports,
192
- },
193
- ],
194
- '@wordpress/no-global-active-element': 'warn'
195
- },
196
- };
@@ -1,14 +0,0 @@
1
- body {
2
- font-family: sans-serif;
3
- }
4
-
5
- .wrapper {
6
- width: 80%;
7
- height: 80dvh;
8
-
9
- display: flex;
10
- justify-content: center;
11
- align-items: center;
12
-
13
- margin-inline: auto;
14
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import {{pascaleSlug}} from '@{{kebabNamespace}}/{{kebabSlug}}';
5
-
6
- document.addEventListener( 'DOMContentLoaded', () => {
7
- {{pascaleSlug}}.init();
8
- } );
@@ -1,10 +0,0 @@
1
- @charset "UTF-8";
2
-
3
- @use "./src/mixins" as plugin;
4
-
5
- :where([data-{{kebabSlug}}]) {
6
- @include plugin.init();
7
- & {
8
- --custom-variable: 1px;
9
- }
10
- }