authscape 1.0.720 → 1.0.722

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.
@@ -3,7 +3,8 @@
3
3
  "allow": [
4
4
  "Bash(dir:*)",
5
5
  "Bash(npm run build:*)",
6
- "Bash(exit 0)"
6
+ "Bash(exit 0)",
7
+ "Bash(node src/scripts/postinstall.js:*)"
7
8
  ],
8
9
  "deny": [],
9
10
  "ask": []
package/index.js CHANGED
@@ -8299,101 +8299,6 @@ function _getServerSideProps() {
8299
8299
  }));
8300
8300
  return _getServerSideProps.apply(this, arguments);
8301
8301
  }
8302
- #!/usr/bin/env node
8303
-
8304
- /**
8305
- * AuthScape Post-Install Script
8306
- * Automatically sets up sitemap.xml for Next.js projects (both Pages Router and App Router)
8307
- */
8308
- "use strict";
8309
-
8310
- var fs = require('fs');
8311
- var path = require('path');
8312
-
8313
- // Template for Pages Router
8314
- var PAGES_ROUTER_TEMPLATE = "// Auto-generated by AuthScape - Do not edit manually\nexport { default, getServerSideProps } from 'authscape/lib/sitemap';\n";
8315
-
8316
- // Template for App Router
8317
- var APP_ROUTER_TEMPLATE = "// Auto-generated by AuthScape - Do not edit manually\nexport { GET } from 'authscape/lib/sitemap-route';\n";
8318
- function detectProjectStructure() {
8319
- // Get the parent directory where the user ran npm install
8320
- // This goes up from node_modules/authscape to the project root
8321
- var projectRoot = path.resolve(process.cwd(), '../..');
8322
-
8323
- // Check for App Router (prioritize newer approach)
8324
- var appDirs = [path.join(projectRoot, 'app'), path.join(projectRoot, 'src', 'app')];
8325
- for (var _i = 0, _appDirs = appDirs; _i < _appDirs.length; _i++) {
8326
- var dir = _appDirs[_i];
8327
- if (fs.existsSync(dir)) {
8328
- return {
8329
- type: 'app',
8330
- baseDir: dir,
8331
- sitemapPath: path.join(dir, 'sitemap.xml'),
8332
- filePath: path.join(dir, 'sitemap.xml', 'route.js')
8333
- };
8334
- }
8335
- }
8336
-
8337
- // Check for Pages Router
8338
- var pagesDirs = [path.join(projectRoot, 'pages'), path.join(projectRoot, 'src', 'pages')];
8339
- for (var _i2 = 0, _pagesDirs = pagesDirs; _i2 < _pagesDirs.length; _i2++) {
8340
- var _dir = _pagesDirs[_i2];
8341
- if (fs.existsSync(_dir)) {
8342
- return {
8343
- type: 'pages',
8344
- baseDir: _dir,
8345
- sitemapPath: path.join(_dir, 'sitemap.xml.js'),
8346
- filePath: path.join(_dir, 'sitemap.xml.js')
8347
- };
8348
- }
8349
- }
8350
- return null;
8351
- }
8352
- function setupSitemap() {
8353
- var structure = detectProjectStructure();
8354
- if (!structure) {
8355
- console.log('⚠️ Next.js pages/app directory not found. Skipping sitemap setup.');
8356
- console.log(' To set up manually, visit: https://authscape.com/docs/sitemap');
8357
- return;
8358
- }
8359
-
8360
- // Check if sitemap file already exists
8361
- if (fs.existsSync(structure.filePath)) {
8362
- // File exists, don't overwrite
8363
- return;
8364
- }
8365
- try {
8366
- if (structure.type === 'app') {
8367
- // App Router: Create directory first, then route.js inside it
8368
- if (!fs.existsSync(structure.sitemapPath)) {
8369
- fs.mkdirSync(structure.sitemapPath, {
8370
- recursive: true
8371
- });
8372
- }
8373
- fs.writeFileSync(structure.filePath, APP_ROUTER_TEMPLATE, 'utf8');
8374
- console.log('✅ AuthScape sitemap configured at /sitemap.xml (App Router)');
8375
- } else {
8376
- // Pages Router: Just create the file
8377
- fs.writeFileSync(structure.filePath, PAGES_ROUTER_TEMPLATE, 'utf8');
8378
- console.log('✅ AuthScape sitemap configured at /sitemap.xml (Pages Router)');
8379
- }
8380
- } catch (error) {
8381
- // Silent failure - don't break the install
8382
- console.log('⚠️ Could not auto-configure sitemap:', error.message);
8383
- console.log(' To set up manually, visit: https://authscape.com/docs/sitemap');
8384
- }
8385
- }
8386
-
8387
- // Run the setup
8388
- try {
8389
- setupSitemap();
8390
- } catch (error) {
8391
- // Completely silent failure to avoid breaking npm install
8392
- // Only log if there's an unexpected error
8393
- if (process.env.DEBUG) {
8394
- console.error('AuthScape postinstall error:', error);
8395
- }
8396
- }
8397
8302
  "use strict";
8398
8303
 
8399
8304
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.720",
3
+ "version": "1.0.722",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
8
- "build": "npx babel src --out-file index.js",
8
+ "build": "npx babel src --out-file index.js --ignore \"src/scripts/**\"",
9
9
  "postinstall": "node src/scripts/postinstall.js || exit 0"
10
10
  },
11
11
  "author": "zuechb",