Skip to content

chore: store source files in src/ #7949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 5, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/translations-pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ on:
- 'apps/site/pages/**/*.mdx'
- '!apps/site/pages/en/**/*.md'
- '!apps/site/pages/en/**/*.mdx'
- 'packages/i18n/locales/*.json'
- '!packages/i18n/locales/en.json'
- 'packages/i18n/src/locales/*.json'
- '!packages/i18n/src/locales/en.json'
- 'apps/site/snippets/**/*.bash'
- '!apps/site/snippets/en/**/*.bash'

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ apps/site/.wrangler
## Playwright
test-results
playwright-report

## MacOS Ignored Files
.DS_Store
4 changes: 2 additions & 2 deletions crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ files:
pt-BR: pt-br
zh-CN: zh-cn
zh-TW: zh-tw
- source: /packages/i18n/locales/en.json
translation: /packages/i18n/locales/%two_letters_code%.json
- source: /packages/i18n/src/locales/en.json
translation: /packages/i18n/src/locales/%two_letters_code%.json
languages_mapping:
two_letters_code:
es-ES: es
Expand Down
2 changes: 1 addition & 1 deletion docs/adding-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Add your new article to `app/site/navigation.json`:
Create translation keys for your navigation entries in the appropriate locale files:

```json
// packages/i18n/locales/en.json
// packages/i18n/src/locales/en.json
{
"components": {
"navigation": {
Expand Down
2 changes: 1 addition & 1 deletion docs/creating-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The website uses a dual-package architecture for React components:
Generic UI components should be placed in `@node-core/ui-components`:

```tsx
// @node-core/ui-components/Common/Button/index.tsx
// @node-core/ui-components/src/Common/Button/index.tsx
import type { FC, ButtonHTMLAttributes } from 'react';
import styles from './index.module.css';

Expand Down
2 changes: 1 addition & 1 deletion docs/downloads-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ The snippet has access to a `props` variable of type `ReleaseContextType`:

### 5. Add Translation Key

Add descriptive text in `packages/i18n/locales/en.json`:
Add descriptive text in `packages/i18n/src/locales/en.json`:

```json
{
Expand Down
25 changes: 9 additions & 16 deletions packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,16 @@
"name": "@node-core/website-i18n",
"type": "module",
"exports": {
".": "./lib/index.mjs",
"./config.json": "./config.json",
"./locales/*.json": "./locales/*.json",
"./types": {
"types": "./types.d.ts",
"default": "./types.d.ts"
}
"./*": [
"./src/*",
"./src/*.d.ts",
"./src/*.mjs",
"./src/*.json"
],
".": "./src/index.mjs"
},
"main": "./lib/index.mjs",
"module": "./lib/index.mjs",
"types": "./dist/index.d.mts",
"files": [
"config.json",
"index.js",
"locales",
"types.d.ts"
],
"main": "./src/index.mjs",
"module": "./src/index.mjs",
"scripts": {
"lint": "turbo lint:js",
"lint:js": "eslint \"**/*.{js,mjs,ts}\"",
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions packages/i18n/lib/index.mjs → packages/i18n/src/index.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
'use strict';

import localeConfig from '../config.json' with { type: 'json' };
import localeConfig from './config.json' with { type: 'json' };

/**
* Imports a locale when exists from the locales directory
*
* @param {string} locale The locale code to import
* @returns {Promise<import('../types').Locale>} The imported locale
* @returns {Promise<import('./types').Locale>} The imported locale
*/
export const importLocale = async locale => {
return import(`../locales/${locale}.json`, { with: { type: 'json' } }).then(
return import(`./locales/${locale}.json`, { with: { type: 'json' } }).then(
f => f.default
);
};
Expand All @@ -19,7 +19,7 @@ export const importLocale = async locale => {
* This is used for allowing us to redirect the user to any
* of the available locales that we have enabled on the website
*
* @returns {Array<import('../types').LocaleConfig>}
* @returns {Array<import('./types').LocaleConfig>}
*/
export const getAvailableLocales = () =>
localeConfig.filter(locale => locale.enabled);
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.
3 changes: 1 addition & 2 deletions packages/i18n/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
"outDir": "dist",
"rootDir": "."
},
"include": ["lib", "types.d.ts"],
"exclude": ["node_modules", "dist"]
"include": ["src"]
}
2 changes: 1 addition & 1 deletion packages/i18n/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": ["//"],
"tasks": {
"lint:js": {
"inputs": ["lib/**/*.{js,mjs,ts}"]
"inputs": ["src/**/*.{js,mjs,ts}"]
},
"lint:fix": {
"cache": false
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-components/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Preview, ReactRenderer } from '@storybook/react';

import { STORYBOOK_MODES, STORYBOOK_SIZES } from './constants';

import '../styles/index.css';
import '#ui/styles/index.css';

const preview: Preview = {
parameters: {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-components/.stylelintrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default {
plugins: [
'stylelint-order',
'stylelint-selector-bem-pattern',
'./stylelint/one-utility-class-per-line.mjs',
'#ui/stylelint/one-utility-class-per-line.mjs',
],
rules: {
// Enforces Element Class Names to be camelCase
Expand Down
29 changes: 10 additions & 19 deletions packages/ui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,13 @@
"type": "module",
"exports": {
"./*": [
"./*",
"./*.tsx",
"./*/index.tsx",
"./*.ts",
"./*/index.ts"
"./src/*",
"./src/*.tsx",
"./src/*/index.tsx",
"./src/*.ts",
"./src/*/index.ts"
]
},
"files": [
"Common",
"Containers",
"Icons",
"MDX",
"stylelint",
"styles",
"types.ts"
],
"scripts": {
"lint": "turbo run lint:js lint:css",
"lint:css": "stylelint \"**/*.css\" --allow-empty-input --cache --cache-strategy=content --cache-location=.stylelintcache",
Expand Down Expand Up @@ -76,11 +67,11 @@
},
"imports": {
"#ui/*": [
"./*",
"./*.tsx",
"./*/index.tsx",
"./*.ts",
"./*/index.ts"
"./src/*",
"./src/*.tsx",
"./src/*/index.tsx",
"./src/*.ts",
"./src/*/index.ts"
]
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import assert from 'node:assert/strict';

import { render, screen } from '@testing-library/react';

import { isVisible } from '../../../../../../tests/utilities.mjs';
import { isVisible } from '../../../../../../../tests/utilities.mjs';

import PaginationListItem from '#ui/Common/BasePagination/PaginationListItem';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import assert from 'node:assert/strict';

import { render, screen } from '@testing-library/react';

import { isVisible } from '../../../../../tests/utilities.mjs';
import { isVisible } from '../../../../../../tests/utilities.mjs';

import BasePagination from '#ui/Common/BasePagination';

Expand Down
File renamed without changes.
8 changes: 1 addition & 7 deletions packages/ui-components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,5 @@
"incremental": true,
"baseUrl": "."
},
"include": [
"**/*.ts",
"**/*.tsx",
".storybook/**/*.ts",
".storybook/**/*.tsx"
],
"exclude": ["node_modules"]
"include": ["src"]
}
Loading