Skip to content

Commit 2bde2ab

Browse files
authored
chore(workspace): Setup internals/ with private lib packages (#116)
1 parent 800166b commit 2bde2ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+181
-208
lines changed

.github/codecov.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ignore:
2+
- "internals/**" # internal libraries
23
- "**/scripts/**"
3-
- "**/tests/**" # Ignore shared utilities for tests
4+
- "**/tests/**" # shared utilities for tests
45
- "**/examples/**"
56
- "**/*.config.js"
67
- "**/*.config.ts"

.github/labeler.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
"workflows":
1+
"internals":
22
- changed-files:
33
- any-glob-to-any-file:
4-
- ".github/workflows/**"
4+
- "internals/**"
55

66
"pkg:js-ast-analyze":
77
- changed-files:
@@ -42,3 +42,8 @@
4242
- changed-files:
4343
- any-glob-to-any-file:
4444
- "**/*.test.ts"
45+
46+
"workflows":
47+
- changed-files:
48+
- any-glob-to-any-file:
49+
- ".github/workflows/**"

internals/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Internals
2+
3+
> [!CAUTION]
4+
>
5+
> **Private** _library_ packages to be used only for building/development process.

internals/test/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `@internals/test`
2+
3+
Shared utilities for **testing** purpose only.

internals/test/package.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://json.schemastore.org/package",
3+
"private": true,
4+
"name": "@internals/test",
5+
"version": "0.1.0",
6+
"type": "module",
7+
"exports": {
8+
"./*": {
9+
"default": "./src/*.ts"
10+
}
11+
},
12+
"dependencies": {
13+
"@types/estree": "catalog:",
14+
"dedent": "^1.5.0",
15+
"svelte": "catalog:",
16+
"svelte-ast-analyze": "workspace:*",
17+
"zimmerframe": "catalog:"
18+
}
19+
}
File renamed without changes.

internals/test/tsconfig.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"extends": ["../../tsconfig.json"],
4+
"compilerOptions": {
5+
"noEmit": true,
6+
"types": ["node"]
7+
}
8+
}

pkgs/js-ast-analyze/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"rootDir": "src/",
66
"outDir": "dist/"
77
},
8-
"exclude": ["src/**/*.test.ts", "tests/"],
8+
"exclude": ["src/**/*.test.ts"],
99
"include": ["src/"]
1010
}

pkgs/js-ast-analyze/typedoc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://typedoc.org/schema.json",
33
"extends": ["../../typedoc.base.json"],
4-
"exclude": ["src/**/*.test.ts", "tests/"],
4+
"exclude": ["src/**/*.test.ts"],
55
"entryPoints": ["src/**/*.ts"]
66
}

pkgs/js-ast-build/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"rootDir": "src/",
66
"outDir": "dist/"
77
},
8-
"exclude": ["src/**/*.test.ts", "tests/"],
8+
"exclude": ["src/**/*.test.ts"],
99
"include": ["src/"]
1010
}

pkgs/js-ast-build/typedoc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://typedoc.org/schema.json",
33
"extends": ["../../typedoc.base.json"],
4-
"exclude": ["src/**/*.test.ts", "tests/"],
4+
"exclude": ["src/**/*.test.ts"],
55
"entryPoints": ["src/**/*.ts"]
66
}

pkgs/svelte-ast-analyze/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,8 @@
100100
"test": "vitest run . --passWithNoTests"
101101
},
102102
"devDependencies": {
103-
"@types/estree": "catalog:",
104-
"typescript": "catalog:",
105-
"zimmerframe": "catalog:"
103+
"@internals/test": "workspace:*",
104+
"@types/estree": "catalog:"
106105
},
107106
"peerDependencies": {
108107
"svelte": "catalog:"

pkgs/svelte-ast-analyze/src/css/mod.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
4-
5-
import { parse_and_extract } from "../../tests/shared.ts";
3+
import { describe, it } from "vitest";
64

75
import { isCSSNode } from "./mod.ts";
86

pkgs/svelte-ast-analyze/src/css/style-sheet.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
4-
5-
import { parse_and_extract } from "../../tests/shared.ts";
3+
import { describe, it } from "vitest";
64

75
import { hasCSSStyleSheetLang, isCSSStyleSheet } from "./style-sheet.ts";
86

pkgs/svelte-ast-analyze/src/html/mod.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
4-
5-
import { parse_and_extract } from "../../tests/shared.ts";
3+
import { describe, it } from "vitest";
64

75
import { isHTMLNode } from "./mod.ts";
86

pkgs/svelte-ast-analyze/src/js/mod.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
4-
5-
import { parse_and_extract } from "../../tests/shared.ts";
3+
import { describe, it } from "vitest";
64

75
import { isInstanceScript, isModuleScript, isScript, isScriptTypeScript } from "./mod.ts";
86

pkgs/svelte-ast-analyze/src/node.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
import { parse_and_extract } from "@internals/test/svelte";
12
import type { AST } from "svelte/compiler";
23
import { describe, it } from "vitest";
34

4-
import { parse_and_extract } from "../tests/shared.ts";
5-
65
import { isSvelteNode, isSvelteOnlyNode } from "./node.ts";
76

87
describe(isSvelteNode.name, () => {

pkgs/svelte-ast-analyze/src/template/attribute.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
4-
5-
import { parse_and_extract } from "../../tests/shared.ts";
3+
import { describe, it } from "vitest";
64

75
import { isAttributeLike } from "./attribute.ts";
86

pkgs/svelte-ast-analyze/src/template/block.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
4-
5-
import { parse_and_extract } from "../../tests/shared.js";
3+
import { describe, it } from "vitest";
64

75
import { isBlock } from "./block.ts";
86

pkgs/svelte-ast-analyze/src/template/element.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
4-
5-
import { parse_and_extract } from "../../tests/shared.ts";
3+
import { describe, it } from "vitest";
64

75
import { isElementLike } from "./element.ts";
86

pkgs/svelte-ast-analyze/src/template/fragment.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
4-
5-
import { parse_and_extract } from "../../tests/shared.ts";
3+
import { describe, it } from "vitest";
64

75
import { isFragment } from "./fragment.ts";
86

pkgs/svelte-ast-analyze/src/template/mod.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
4-
5-
import { parse_and_extract } from "../../tests/shared.ts";
3+
import { describe, it } from "vitest";
64

75
import { isTemplateNode } from "./mod.ts";
86

pkgs/svelte-ast-analyze/src/template/options.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
4-
5-
import { parse_and_extract } from "../../tests/shared.ts";
3+
import { describe, it } from "vitest";
64

75
import { isSvelteOptions } from "./options.ts";
86

pkgs/svelte-ast-analyze/src/template/root.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
4-
5-
import { parse_and_extract } from "../../tests/shared.ts";
3+
import { describe, it } from "vitest";
64

75
import { isRoot } from "./root.ts";
86

pkgs/svelte-ast-analyze/src/template/tag.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
4-
5-
import { parse_and_extract } from "../../tests/shared.ts";
3+
import { describe, it } from "vitest";
64

75
import { isTag } from "./tag.ts";
86

pkgs/svelte-ast-analyze/tests/shared.ts

-38
This file was deleted.

pkgs/svelte-ast-analyze/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"rootDir": "src/",
66
"outDir": "dist/"
77
},
8-
"exclude": ["src/**/*.test.ts", "tests/"],
8+
"exclude": ["src/**/*.test.ts"],
99
"include": ["src/"]
1010
}

pkgs/svelte-ast-analyze/typedoc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://typedoc.org/schema.json",
33
"extends": ["../../typedoc.base.json"],
4-
"exclude": ["src/**/*.test.ts", "tests/"],
4+
"exclude": ["src/**/*.test.ts"],
55
"entryPoints": ["src/**/*.ts"]
66
}

pkgs/svelte-ast-build/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"rootDir": "src/",
66
"outDir": "dist/"
77
},
8-
"exclude": ["src/**/*.test.ts", "tests/"],
8+
"exclude": ["src/**/*.test.ts"],
99
"include": ["src/"]
1010
}

pkgs/svelte-ast-build/typedoc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://typedoc.org/schema.json",
33
"extends": ["../../typedoc.base.json"],
4-
"exclude": ["src/**/*.test.ts", "tests/"],
4+
"exclude": ["src/**/*.test.ts"],
55
"entryPoints": ["src/**/*.ts"]
66
}

pkgs/svelte-ast-print/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@
9595
},
9696
"devDependencies": {
9797
"@types/estree": "catalog:",
98-
"dedent": "^1.5.0",
99-
"zimmerframe": "catalog:"
98+
"@internals/test": "workspace:*"
10099
},
101100
"peerDependencies": {
102101
"svelte": "catalog:"

pkgs/svelte-ast-print/src/css/rule.test.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
import { parse_and_extract } from "@internals/test/svelte";
12
import type { AST } from "svelte/compiler";
23
import { describe, it } from "vitest";
34

4-
import { parse_and_extract } from "../../tests/shared.ts";
5-
6-
import { printCSSAtrule, printCSSBlock, printCSSDeclaration, printCSSRule } from "./mod.js";
5+
import { printCSSAtrule, printCSSBlock, printCSSDeclaration, printCSSRule } from "./mod.ts";
76

87
describe(printCSSBlock.name, () => {
98
it("prints correctly", ({ expect }) => {

pkgs/svelte-ast-print/src/css/selector.test.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
4-
5-
import { parse_and_extract } from "../../tests/shared.ts";
3+
import { describe, it } from "vitest";
64

75
import {
86
printCSSAttributeSelector,
@@ -18,7 +16,7 @@ import {
1816
printCSSSelectorList,
1917
printCSSSimpleSelector,
2018
printCSSTypeSelector,
21-
} from "./mod.js";
19+
} from "./mod.ts";
2220

2321
describe(printCSSSimpleSelector.name, () => {
2422
describe(printCSSAttributeSelector.name, () => {

pkgs/svelte-ast-print/src/css/style-sheet.test.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
import { parse_and_extract } from "@internals/test/svelte";
12
import type { AST } from "svelte/compiler";
23
import { describe, it } from "vitest";
34

4-
import { parse_and_extract } from "../../tests/shared.ts";
5-
6-
import { printCSSStyleSheet } from "./mod.js";
5+
import { printCSSStyleSheet } from "./mod.ts";
76

87
describe(printCSSStyleSheet.name, () => {
98
it("it prints correctly attributes", ({ expect }) => {

pkgs/svelte-ast-print/src/html/mod.test.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import { describe, it } from "vitest";
2-
1+
import { parse_and_extract } from "@internals/test/svelte";
32
import type { AST } from "svelte/compiler";
3+
import { describe, it } from "vitest";
44

5-
import { parse_and_extract } from "../../tests/shared.ts";
6-
7-
import { printComment, printHTMLNode, printText } from "./mod.js";
5+
import { printComment, printHTMLNode, printText } from "./mod.ts";
86

97
describe(printHTMLNode.name, () => {
108
describe(printComment.name, () => {

0 commit comments

Comments
 (0)