Skip to content

Commit ba1bcf9

Browse files
fixed parser and made directory structure changes
1 parent 3800a4a commit ba1bcf9

File tree

12 files changed

+11
-945
lines changed

12 files changed

+11
-945
lines changed

examples/_parsed/passport-examples.json

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { fileURLToPath } from 'url';
55

66
const FILENAME = fileURLToPath(import.meta.url);
77
const DIRNAME = path.dirname(FILENAME);
8-
const examplesDir = path.join(DIRNAME, 'examples', '_parsed');
8+
const examplesDir = path.join(DIRNAME, '..', '_parsed');
99
const main = (product) => {
10-
const sampleAppDir = path.join(DIRNAME, 'examples', product);
10+
const sampleAppDir = path.join(DIRNAME, '..', product);
1111

1212
// Create an object to hold all app data
1313
const allApps = {};
@@ -49,15 +49,16 @@ const main = (product) => {
4949
}
5050

5151
// Write a single JSON file in the product directory
52-
fs.writeFileSync(
53-
path.join(examplesDir, `${product}-examples.json`),
54-
JSON.stringify(allApps, null, 2),
55-
);
56-
57-
console.log(`Created ${product}-examples.json with data for ${Object.keys(allApps).length} apps`);
52+
if (Object.keys(allApps).length > 0) {
53+
fs.writeFileSync(
54+
path.join(examplesDir, `${product}-examples.json`),
55+
JSON.stringify(allApps, null, 2),
56+
);
57+
console.log(`Created ${product}-examples.json with data for ${Object.keys(allApps).length} apps`);
58+
}
5859
};
5960

60-
const products = ['passport']; // 'checkout', 'orderbook', 'contracts' etc
61+
const products = ['passport', 'checkout', 'orderbook', 'contracts'];
6162
products.forEach((product) => {
6263
main(product);
6364
});

examples/checkout/checkout-examples.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

examples/contracts/contracts-examples.json

Lines changed: 0 additions & 34 deletions
This file was deleted.

examples/orderbook/orderbook-examples.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

examples/passport/logged-in-user-with-nextjs/metadata.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/passport/logged-in-user-with-nextjs/prompt.txt

Lines changed: 0 additions & 99 deletions
This file was deleted.

0 commit comments

Comments
 (0)