Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,17 @@
2. Run `npm run build` to compile to `build/` directory
3. Run `npm test` to validate changes
4. Run `npm run lint` to ensure code quality
5. Built files in `build/` are what get published to npm
5. **ALWAYS** add a changelog entry to `CHANGELOG.md` under the "**WORK IN PROGRESS**" section for any user-facing changes
6. Built files in `build/` are what get published to npm

### Changelog Guidelines
- **REQUIRED**: Add an entry to `CHANGELOG.md` for all feature additions, bug fixes, or behavioral changes
- Format: `* (@username/@copilot) Description of change`
- Add entries under the `## **WORK IN PROGRESS**` section
- Be concise and describe the change from a user's perspective
- Examples:
- `* (@Apollon77/@copilot) Add validation for JSON files in admin/ and admin/i18n/ directories`
- `* (@Apollon77/@copilot) Re-enabled validation checks for README.md and LICENSE files in packageFiles tests`

## Project Structure

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## **WORK IN PROGRESS**
* (@Apollon77/@copilot) Add validation for JSON files in admin/ and admin/i18n/ directories
* (@Apollon77/@copilot) Logs npm and installation errors to console for easier debugging
* (@Apollon77/@copilot) Re-enabled validation checks for README.md and LICENSE files in packageFiles tests

## 5.1.1 (2025-08-31)
* (@Apollon77) Downgrades chai-as-promised type dependency to same major as main dependency
Expand Down
30 changes: 13 additions & 17 deletions build/tests/packageFiles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,21 +323,17 @@ function validatePackageFiles(adapterDir) {
}
});
});
// describe(`Check additional files`, () => {
// it("README.md exists", () => {
// expect(
// fs.existsSync(path.join(adapterDir, "README.md")),
// `README.md is missing in the adapter dir. Please create it!`,
// ).to.be.true;
// });
// it("LICENSE exists or is present in the README.md", () => {
// const licenseExists = fs.existsSync(path.join(adapterDir, "LICENSE"));
// if (licenseExists) return;
// const readmeContent = fs.readFileSync(path.join(adapterDir, "README.md"), "utf8");
// expect(readmeContent).to.match(
// /## LICENSE/i,
// `The license should be in a file "LICENSE" or be included in "README.md" as a 2nd level headline!`,
// );
// });
// });
describe(`Check additional files`, () => {
it('README.md exists', () => {
(0, chai_1.expect)(fs.existsSync(path.join(adapterDir, 'README.md')), `README.md is missing in the adapter dir. Please create it!`).to.be.true;
});
it('LICENSE exists or is present in the README.md', () => {
const licenseExists = fs.existsSync(path.join(adapterDir, 'LICENSE'));
if (licenseExists) {
return;
}
const readmeContent = fs.readFileSync(path.join(adapterDir, 'README.md'), 'utf8');
(0, chai_1.expect)(readmeContent).to.match(/## LICENSE/i, `The license should be in a file "LICENSE" or be included in "README.md" as a 2nd level headline!`);
});
});
}
40 changes: 21 additions & 19 deletions src/tests/packageFiles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,23 +336,25 @@ export function validatePackageFiles(adapterDir: string): void {
});
});

// describe(`Check additional files`, () => {
// it("README.md exists", () => {
// expect(
// fs.existsSync(path.join(adapterDir, "README.md")),
// `README.md is missing in the adapter dir. Please create it!`,
// ).to.be.true;
// });

// it("LICENSE exists or is present in the README.md", () => {
// const licenseExists = fs.existsSync(path.join(adapterDir, "LICENSE"));
// if (licenseExists) return;

// const readmeContent = fs.readFileSync(path.join(adapterDir, "README.md"), "utf8");
// expect(readmeContent).to.match(
// /## LICENSE/i,
// `The license should be in a file "LICENSE" or be included in "README.md" as a 2nd level headline!`,
// );
// });
// });
describe(`Check additional files`, () => {
it('README.md exists', () => {
expect(
fs.existsSync(path.join(adapterDir, 'README.md')),
`README.md is missing in the adapter dir. Please create it!`,
).to.be.true;
});

it('LICENSE exists or is present in the README.md', () => {
const licenseExists = fs.existsSync(path.join(adapterDir, 'LICENSE'));
if (licenseExists) {
return;
}

const readmeContent = fs.readFileSync(path.join(adapterDir, 'README.md'), 'utf8');
expect(readmeContent).to.match(
/## LICENSE/i,
`The license should be in a file "LICENSE" or be included in "README.md" as a 2nd level headline!`,
);
});
});
}