Prefix internal modules with internal-* (#14074)

Last week we discussed bringing in some consistency for our non-public
npm packages in the repo. We discussed using custom namespaces (e.g.
`@tailwindcss-internal`) vs. simple prefixes but it does not matter too
much if we are both consistent with our pattern and it's easy for us to
see whether a plugin is public or not.

Since we have a mixture of public namespaced (`@tailwindcss/*`) and
non-namespaced (`tailwindcss`) packages, I think it would be best if we
use a prefix to signal internal dependencies. This PR proposes we use
`internal-*` as the prefix and renames `test-utils` to
`internal-example-plugin` (since, really, this package is just an
example for the Tailwind plugin system).
This commit is contained in:
Philipp Spiess 2024-07-29 16:58:07 +02:00 committed by GitHub
parent a2159e80f5
commit e920442e49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 13 deletions

View File

@ -39,6 +39,6 @@
"@types/node": "^20.12.12",
"@types/postcss-import": "^14.0.3",
"postcss": "8.4.24",
"tailwindcss-test-utils": "workspace:*"
"internal-example-plugin": "workspace:*"
}
}

View File

@ -144,7 +144,7 @@ describe('plugins', () => {
let result = await processor.process(
css`
@import 'tailwindcss/utilities';
@plugin 'tailwindcss-test-utils';
@plugin 'internal-example-plugin';
`,
{ from: INPUT_CSS_PATH },
)
@ -174,7 +174,7 @@ describe('plugins', () => {
let result = await processor.process(
css`
@import 'tailwindcss/utilities';
@plugin 'tailwindcss-test-utils';
@plugin 'internal-example-plugin';
`,
{ from: INPUT_CSS_PATH },
)

View File

@ -1,5 +1,5 @@
{
"name": "tailwindcss-test-utils",
"name": "internal-example-plugin",
"version": "0.0.0",
"private": true,
"main": "index.js"

17
pnpm-lock.yaml generated
View File

@ -153,12 +153,12 @@ importers:
'@types/postcss-import':
specifier: ^14.0.3
version: 14.0.3
internal-example-plugin:
specifier: workspace:*
version: link:../internal-example-plugin
postcss:
specifier: 8.4.24
version: 8.4.24
tailwindcss-test-utils:
specifier: workspace:*
version: link:../test-utils
packages/@tailwindcss-vite:
dependencies:
@ -179,6 +179,8 @@ importers:
specifier: ^5.2.11
version: 5.2.11(@types/node@20.12.12)(lightningcss@1.25.1)
packages/internal-example-plugin: {}
packages/tailwindcss:
devDependencies:
'@tailwindcss/oxide':
@ -191,8 +193,6 @@ importers:
specifier: ^1.25.1
version: 1.25.1
packages/test-utils: {}
playgrounds/nextjs:
dependencies:
'@tailwindcss/postcss':
@ -1237,7 +1237,6 @@ packages:
bun@1.1.10:
resolution: {integrity: sha512-qOJXrQZSzJ5DbJMt47GZGWtUSmIkbwD7fPSN/XS/T46D4cTTnPK46QDHlyC8VD+Anvs6uKNwuwKIyB31kUdHmQ==}
cpu: [arm64, x64]
os: [darwin, linux, win32]
hasBin: true
@ -4093,7 +4092,7 @@ snapshots:
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0)
eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0)
eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0)
eslint-plugin-react: 7.34.1(eslint@8.57.0)
eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0)
@ -4117,7 +4116,7 @@ snapshots:
enhanced-resolve: 5.16.1
eslint: 8.57.0
eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0)
eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0)
fast-glob: 3.3.2
get-tsconfig: 4.7.5
is-core-module: 2.13.1
@ -4139,7 +4138,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0):
eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0):
dependencies:
array-includes: 3.1.8
array.prototype.findlastindex: 1.2.5