@maka/maka-cli 5.3.12 → 5.3.13
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.
- package/bundle/typescript/package.json +1 -1
- package/bundle/typescript/src/templates/meteor/app/maka.d.ts +28 -2
- package/bundle/typescript/src/templates/meteor/app/server/helmet-csp.js.ts +12 -12
- package/bundle/typescript/src/templates/meteor/app/server/helmet-csp.js.tsx +12 -12
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 2.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 2.x applications using React.",
|
|
@@ -2,6 +2,24 @@ interface Window { cordova: any; }
|
|
|
2
2
|
|
|
3
3
|
declare module "*.css";
|
|
4
4
|
|
|
5
|
+
// Meteor's server-injected runtime config global. Genuinely undocumented --
|
|
6
|
+
// not part of @types/meteor's app-facing API coverage.
|
|
7
|
+
declare var __meteor_runtime_config__: any;
|
|
8
|
+
|
|
9
|
+
// No official types; not covered by @types/meteor.
|
|
10
|
+
declare module 'meteor/autoupdate' {
|
|
11
|
+
export const Autoupdate: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Adds the one real WebApp member @types/meteor doesn't have yet. This
|
|
15
|
+
// merges additively with @types/meteor's own `declare module "meteor/webapp"`
|
|
16
|
+
// -- it must not redeclare anything already defined there.
|
|
17
|
+
declare module 'meteor/webapp' {
|
|
18
|
+
namespace WebApp {
|
|
19
|
+
function addHtmlAttributeHook(callback: (request?: any) => Record<string, string>): void;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
5
23
|
declare module 'meteor/maka:http' {
|
|
6
24
|
export const HTTP: {
|
|
7
25
|
/**
|
|
@@ -149,10 +167,18 @@ declare module 'meteor/maka:http' {
|
|
|
149
167
|
|
|
150
168
|
declare module 'meteor/maka:rest' {
|
|
151
169
|
import { IncomingMessage, ServerResponse } from 'http';
|
|
152
|
-
import { RateLimiterMemory, RateLimiterRedis, IRateLimiterOptions } from 'rate-limiter-flexible';
|
|
153
|
-
import { RedisClientType } from '@redis/client';
|
|
154
170
|
import { Meteor } from 'meteor/meteor';
|
|
155
171
|
|
|
172
|
+
// rate-limiter-flexible and @redis/client are optional peer packages used
|
|
173
|
+
// only by maka:rest's rate-limiting feature -- they're bundled by the
|
|
174
|
+
// Meteor package itself, not something every app needs to npm install
|
|
175
|
+
// just to typecheck. Typed as `any` rather than pulling those packages in
|
|
176
|
+
// as devDependencies for every scaffolded project.
|
|
177
|
+
type IRateLimiterOptions = any;
|
|
178
|
+
type RateLimiterMemory = any;
|
|
179
|
+
type RateLimiterRedis = any;
|
|
180
|
+
type RedisClientType = any;
|
|
181
|
+
|
|
156
182
|
export type LoginType = 'default' | null;
|
|
157
183
|
|
|
158
184
|
export interface MakaRestOptions {
|
|
@@ -8,6 +8,7 @@ import { Meteor } from 'meteor/meteor'
|
|
|
8
8
|
import { WebApp } from 'meteor/webapp'
|
|
9
9
|
import { Autoupdate } from 'meteor/autoupdate'
|
|
10
10
|
import crypto from 'crypto'
|
|
11
|
+
import type { HelmetOptions } from 'helmet'
|
|
11
12
|
|
|
12
13
|
const self = '\'self\''
|
|
13
14
|
const data = 'data:'
|
|
@@ -42,13 +43,18 @@ const runtimeConfig = Object.assign(__meteor_runtime_config__, Autoupdate, {
|
|
|
42
43
|
})
|
|
43
44
|
|
|
44
45
|
// add client versions to __meteor_runtime_config__
|
|
46
|
+
// clientProgram is typed `any` here: @types/meteor's WebApp.clientPrograms
|
|
47
|
+
// shape only documents `version` as a plain string, but Meteor's real
|
|
48
|
+
// runtime object also carries the versionRefreshable/versionNonRefreshable/
|
|
49
|
+
// versionReplaceable accessor methods used below.
|
|
45
50
|
Object.keys(WebApp.clientPrograms).forEach(arch => {
|
|
51
|
+
const clientProgram: any = WebApp.clientPrograms[arch];
|
|
46
52
|
__meteor_runtime_config__.versions[arch] = {
|
|
47
|
-
version: Autoupdate.autoupdateVersion ||
|
|
48
|
-
versionRefreshable: Autoupdate.autoupdateVersion ||
|
|
49
|
-
versionNonRefreshable: Autoupdate.autoupdateVersion ||
|
|
53
|
+
version: Autoupdate.autoupdateVersion || clientProgram.version(),
|
|
54
|
+
versionRefreshable: Autoupdate.autoupdateVersion || clientProgram.versionRefreshable(),
|
|
55
|
+
versionNonRefreshable: Autoupdate.autoupdateVersion || clientProgram.versionNonRefreshable(),
|
|
50
56
|
// comment the following line if you use Meteor < 2.0
|
|
51
|
-
versionReplaceable: Autoupdate.autoupdateVersion ||
|
|
57
|
+
versionReplaceable: Autoupdate.autoupdateVersion || clientProgram.versionReplaceable()
|
|
52
58
|
}
|
|
53
59
|
})
|
|
54
60
|
|
|
@@ -62,7 +68,6 @@ const helmetOptions = {
|
|
|
62
68
|
//If this is truu, site's won't be able to link to you
|
|
63
69
|
crossOriginEmbedderPolicy: false,
|
|
64
70
|
contentSecurityPolicy: {
|
|
65
|
-
blockAllMixedContent: true,
|
|
66
71
|
directives: {
|
|
67
72
|
defaultSrc: [self].concat(allowedOrigins),
|
|
68
73
|
scriptSrc: [
|
|
@@ -121,10 +126,6 @@ const helmetOptions = {
|
|
|
121
126
|
referrerPolicy: {
|
|
122
127
|
policy: 'no-referrer'
|
|
123
128
|
},
|
|
124
|
-
expectCt: {
|
|
125
|
-
enforce: true,
|
|
126
|
-
maxAge: 604800
|
|
127
|
-
},
|
|
128
129
|
frameguard: {
|
|
129
130
|
action: 'sameorigin'
|
|
130
131
|
},
|
|
@@ -134,13 +135,12 @@ const helmetOptions = {
|
|
|
134
135
|
permittedCrossDomainPolicies: {
|
|
135
136
|
permittedPolicies: 'none'
|
|
136
137
|
}
|
|
137
|
-
};
|
|
138
|
+
} satisfies HelmetOptions;
|
|
138
139
|
|
|
139
140
|
// We assume, that we are working on a localhost when there is no https
|
|
140
141
|
// connection available.
|
|
141
142
|
// Run your project with --production flag to simulate script-src hashing
|
|
142
143
|
if (!usesHttps && Meteor.isDevelopment && devAllowedOrigins) {
|
|
143
|
-
delete helmetOptions.contentSecurityPolicy.blockAllMixedContent;
|
|
144
144
|
helmetOptions.contentSecurityPolicy.directives.scriptSrc = [
|
|
145
145
|
self,
|
|
146
146
|
devAllowedOrigins.join(' '),
|
|
@@ -173,7 +173,7 @@ if (!usesHttps && Meteor.isDevelopment && devAllowedOrigins) {
|
|
|
173
173
|
unsafeInline,
|
|
174
174
|
];
|
|
175
175
|
|
|
176
|
-
helmetOptions.contentSecurityPolicy.directives['script-src-attr'] = null;
|
|
176
|
+
(helmetOptions.contentSecurityPolicy.directives as Record<string, any>)['script-src-attr'] = null;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
export default helmetOptions;
|
|
@@ -8,6 +8,7 @@ import { Meteor } from 'meteor/meteor'
|
|
|
8
8
|
import { WebApp } from 'meteor/webapp'
|
|
9
9
|
import { Autoupdate } from 'meteor/autoupdate'
|
|
10
10
|
import crypto from 'crypto'
|
|
11
|
+
import type { HelmetOptions } from 'helmet'
|
|
11
12
|
|
|
12
13
|
const self = '\'self\''
|
|
13
14
|
const data = 'data:'
|
|
@@ -42,13 +43,18 @@ const runtimeConfig = Object.assign(__meteor_runtime_config__, Autoupdate, {
|
|
|
42
43
|
})
|
|
43
44
|
|
|
44
45
|
// add client versions to __meteor_runtime_config__
|
|
46
|
+
// clientProgram is typed `any` here: @types/meteor's WebApp.clientPrograms
|
|
47
|
+
// shape only documents `version` as a plain string, but Meteor's real
|
|
48
|
+
// runtime object also carries the versionRefreshable/versionNonRefreshable/
|
|
49
|
+
// versionReplaceable accessor methods used below.
|
|
45
50
|
Object.keys(WebApp.clientPrograms).forEach(arch => {
|
|
51
|
+
const clientProgram: any = WebApp.clientPrograms[arch];
|
|
46
52
|
__meteor_runtime_config__.versions[arch] = {
|
|
47
|
-
version: Autoupdate.autoupdateVersion ||
|
|
48
|
-
versionRefreshable: Autoupdate.autoupdateVersion ||
|
|
49
|
-
versionNonRefreshable: Autoupdate.autoupdateVersion ||
|
|
53
|
+
version: Autoupdate.autoupdateVersion || clientProgram.version(),
|
|
54
|
+
versionRefreshable: Autoupdate.autoupdateVersion || clientProgram.versionRefreshable(),
|
|
55
|
+
versionNonRefreshable: Autoupdate.autoupdateVersion || clientProgram.versionNonRefreshable(),
|
|
50
56
|
// comment the following line if you use Meteor < 2.0
|
|
51
|
-
versionReplaceable: Autoupdate.autoupdateVersion ||
|
|
57
|
+
versionReplaceable: Autoupdate.autoupdateVersion || clientProgram.versionReplaceable()
|
|
52
58
|
}
|
|
53
59
|
})
|
|
54
60
|
|
|
@@ -62,7 +68,6 @@ const helmetOptions = {
|
|
|
62
68
|
//If this is truu, site's won't be able to link to you
|
|
63
69
|
crossOriginEmbedderPolicy: false,
|
|
64
70
|
contentSecurityPolicy: {
|
|
65
|
-
blockAllMixedContent: true,
|
|
66
71
|
directives: {
|
|
67
72
|
defaultSrc: [self].concat(allowedOrigins),
|
|
68
73
|
scriptSrc: [
|
|
@@ -121,10 +126,6 @@ const helmetOptions = {
|
|
|
121
126
|
referrerPolicy: {
|
|
122
127
|
policy: 'no-referrer'
|
|
123
128
|
},
|
|
124
|
-
expectCt: {
|
|
125
|
-
enforce: true,
|
|
126
|
-
maxAge: 604800
|
|
127
|
-
},
|
|
128
129
|
frameguard: {
|
|
129
130
|
action: 'sameorigin'
|
|
130
131
|
},
|
|
@@ -134,13 +135,12 @@ const helmetOptions = {
|
|
|
134
135
|
permittedCrossDomainPolicies: {
|
|
135
136
|
permittedPolicies: 'none'
|
|
136
137
|
}
|
|
137
|
-
};
|
|
138
|
+
} satisfies HelmetOptions;
|
|
138
139
|
|
|
139
140
|
// We assume, that we are working on a localhost when there is no https
|
|
140
141
|
// connection available.
|
|
141
142
|
// Run your project with --production flag to simulate script-src hashing
|
|
142
143
|
if (!usesHttps && Meteor.isDevelopment && devAllowedOrigins) {
|
|
143
|
-
delete helmetOptions.contentSecurityPolicy.blockAllMixedContent;
|
|
144
144
|
helmetOptions.contentSecurityPolicy.directives.scriptSrc = [
|
|
145
145
|
self,
|
|
146
146
|
devAllowedOrigins.join(' '),
|
|
@@ -173,7 +173,7 @@ if (!usesHttps && Meteor.isDevelopment && devAllowedOrigins) {
|
|
|
173
173
|
unsafeInline,
|
|
174
174
|
];
|
|
175
175
|
|
|
176
|
-
helmetOptions.contentSecurityPolicy.directives['script-src-attr'] = null;
|
|
176
|
+
(helmetOptions.contentSecurityPolicy.directives as Record<string, any>)['script-src-attr'] = null;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
export default helmetOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 2.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 2.x applications using React.",
|