Skip to content

Commit

Permalink
Update dirs (#174)
Browse files Browse the repository at this point in the history
* chore: update dir structure

* chore: update release script
  • Loading branch information
darrenvechain authored Jan 12, 2024
1 parent 6c5072d commit 0b6e05e
Show file tree
Hide file tree
Showing 95 changed files with 40 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Key Features a.k.a scope

## Sample Projects

- Please refer to the [apps](./apps) folder for sample projects.
- Please refer to the [apps](./examples) folder for sample projects.

---

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"private": true,
"name": "vechain-dapp-kit",
"private": true,
"description": "A TypeScript library that facilitates seamless interaction between vechain wallets (veworld, sync2) and dApps.",
"workspaces": [
"apps/*",
"packages/*"
"examples/*",
"packages/*",
"tests/*"
],
"scripts": {
"build": "turbo run build",
Expand Down
37 changes: 32 additions & 5 deletions scripts/prepare-packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,33 @@ const updatePackageVersions = (version: string) => {

fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2));
}

// Update versions in the examples directory
const examplesPath = path.resolve(__dirname, '../examples');

const examplePackages = fs.readdirSync(examplesPath);

for (const example of examplePackages) {
const examplePath = path.resolve(examplesPath, example);
const examplePackageJsonPath = path.resolve(
examplePath,
'./package.json',
);
const examplePackageJson = JSON.parse(
fs.readFileSync(examplePackageJsonPath, 'utf8'),
);

for (const dep of Object.keys(examplePackageJson.dependencies)) {
if (packageNames.includes(dep)) {
examplePackageJson.dependencies[dep] = version;
}
}

fs.writeFileSync(
examplePackageJsonPath,
JSON.stringify(examplePackageJson, null, 2),
);
}
};

const preparePackages = async () => {
Expand All @@ -55,23 +82,23 @@ const preparePackages = async () => {
console.log(' Clean:');
console.log(' - 🚮 Removing existing packages & builds...');
await exec('yarn purge');
console.log(' - ✅ Removed!');
console.log(' - ✅ Removed!');

console.log(' Build:');
console.log(' - 📦 Building packages...');
await exec('yarn install:all');
console.log(' - ✅ Built!');
console.log(' - ✅ Built!');

console.log(' Test:');
console.log(' - 🧪 Testing packages...');
await exec('yarn test');
console.log(' - ✅ Success!');
console.log(' - ✅ Success!');

console.log(' Version:');
console.log(` - 🏷 Updating package versions to ${version}...`);
console.log(` - 🏷 Updating package versions to ${version}...`);
updatePackageVersions(version);
await exec(`yarn format`);
console.log(' - ✅ Updated!');
console.log(' - ✅ Updated!');

console.log('\n______________________________________________________\n\n');
console.log(' Publish:');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Given } from '@cucumber/cucumber';
import { ICustomWorld } from 'types';
import { ICustomWorld } from 'tests/e2e/src/types';

Given('The user is in the homepage', async function (this: ICustomWorld) {
await this.openUrl('http://localhost:1234');
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { World, setWorldConstructor } from '@cucumber/cucumber';
import { ICustomWorld } from 'types';
import { ICustomWorld } from 'tests/e2e/src/types';
import { openUrl, click, clickByText, isVisible, isVisibleByText } from 'utils';

export class CustomWorld extends World implements ICustomWorld {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ChromiumBrowser } from 'playwright';
import { chromium } from 'playwright';
import { After, AfterAll, Before, BeforeAll } from '@cucumber/cucumber';
import { ICustomWorld } from 'types';
import { ICustomWorld } from 'tests/e2e/src/types';

let browser: ChromiumBrowser;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0b6e05e

Please sign in to comment.