@gen3/toolsff 0.12.15 → 0.12.17

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.
@@ -115,11 +115,12 @@ function writeGeneratedMiddlewareEntryTs(matcher, opts = {}) {
115
115
  * in the middleware path matcher. If true, all application routes
116
116
  * are scanned and included; otherwise, specific routes from the
117
117
  * authentication configuration are considered.
118
- */ const createMiddlewareRoutes = (useScanAllPaths = false)=>{
118
+ * @param forceMatchAll - set to true to force all routes to be matched by the middleware.
119
+ */ const createMiddlewareRoutes = (useScanAllPaths = false, forceMatchAll = false)=>{
119
120
  const authConfig = loadAuthConfig();
120
121
  const allPagesRequireLogin = authConfig?.routes?.['*']?.loginRequired;
121
122
  let routes;
122
- if (allPagesRequireLogin) {
123
+ if (allPagesRequireLogin || forceMatchAll) {
123
124
  console.log('All pages require login. Adding all routes to middleware path matcher.');
124
125
  routes = useScanAllPaths ? getPagesRoutes() : []; // setting to [] will cause the matcher to be set below
125
126
  } else {
@@ -138,15 +139,19 @@ function writeGeneratedMiddlewareEntryTs(matcher, opts = {}) {
138
139
  };
139
140
  function main() {
140
141
  try {
141
- const { values: { scanAllPages } } = parseArgs({
142
+ const { values: { scanAllPages, forceMatchAll } } = parseArgs({
142
143
  options: {
143
144
  scanAllPages: {
144
145
  type: 'boolean',
145
146
  default: false
147
+ },
148
+ forceMatchAll: {
149
+ type: 'boolean',
150
+ default: false
146
151
  }
147
152
  }
148
153
  });
149
- createMiddlewareRoutes(scanAllPages);
154
+ createMiddlewareRoutes(scanAllPages, forceMatchAll);
150
155
  } catch (e) {
151
156
  if (e instanceof Error) {
152
157
  if (e.name === 'ERR_PARSE_ARGS_UNKNOWN_OPTION') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gen3/toolsff",
3
- "version": "0.12.15",
3
+ "version": "0.12.17",
4
4
  "description": "tools for processing Gen3 commons content: color theme, icons, sharedFilters",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -48,5 +48,5 @@
48
48
  "axios": "^1.8.2"
49
49
  }
50
50
  },
51
- "gitHead": "36f020ffb3af8225e9e6160d8a944aa1939c17f6"
51
+ "gitHead": "31a4ccce1e130040a8a51c125a95b01fd2c0bf58"
52
52
  }
package/LICENSE DELETED
@@ -1,15 +0,0 @@
1
- Apache Software License 2.0
2
-
3
- Copyright (c) 2026, University of Chicago
4
-
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.