Skip to content

Commit

Permalink
Merge pull request #134 from universal-ember/modern-v2-addon--v3-addon
Browse files Browse the repository at this point in the history
A proper single library -- a v2.1 addon.
  • Loading branch information
NullVoxPopuli authored Nov 7, 2024
2 parents 80319d3 + 157280a commit fe390b8
Show file tree
Hide file tree
Showing 145 changed files with 1,609 additions and 2,365 deletions.
4 changes: 2 additions & 2 deletions .attw.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"ignoreRules": ["no-resolution", "cjs-resolves-to-esm"],
"excludeEntrypoints": ["webpack", "vite"]
"ignoreRules": ["no-resolution", "cjs-resolves-to-esm", "internal-resolution-error"],
"excludeEntrypoints": ["private/samples"]
}
File renamed without changes.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules/
declarations/
dist/
coverage/
dist-typedoc/
*.yaml
*.md
Expand Down
69 changes: 38 additions & 31 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,38 +1,45 @@
'use strict';

const { configs } = require('@nullvoxpopuli/eslint-configs');
const { configBuilder: emberBuilder } = require('@nullvoxpopuli/eslint-configs/configs/ember');
const { configBuilder: nodeBuilder } = require('@nullvoxpopuli/eslint-configs/configs/node');
const { configFor, forFiles } = require('@nullvoxpopuli/eslint-configs/configs/-utils');

const node = configs.node();
const ember = emberBuilder();
const node = nodeBuilder();

module.exports = {
root: true,
overrides: [
...node.overrides,
{
files: ['**/*.{ts,js}'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
files: ['**/*.test.{ts,js}'],
rules: {
'n/no-unpublished-import': 'off',
},
module.exports = configFor([
// Browser / Runtime
forFiles('src/browser/**/*.{gjs,js}', ember.modules.browser.js),
forFiles('src/browser/**/*.{gts,ts}', ember.modules.browser.ts),
forFiles('**/*.gts', { parser: 'ember-eslint-parser' }),
forFiles('**/*.gjs', { parser: 'ember-eslint-parser' }),

// Build
forFiles('**/*.cjs', node.commonjs.js),
forFiles('**/*.cts', node.commonjs.ts),
forFiles('src/build/**/*.{js,mjs}', node.modules.js),
forFiles(['src/build/**/*.{ts,mts}', 'src/types.ts'], node.modules.ts),

// Supporting / internal
forFiles('*.js', node.modules.js),
forFiles('{vite,vitest}.config.ts', node.modules.ts),

// Overrides
forFiles('*.{gts,ts}', {
rules: {
// huge TODO
'@typescript-eslint/no-explicit-any': 'off',
},
{
files: ['**/*.d.ts'],
rules: {
'n/no-unsupported-features/node-builtins': 'off',
'n/no-missing-import': 'off',
},
}),
forFiles(['**/*.test.ts', '**/*.d.ts'], {
rules: {
'n/no-unpublished-import': 'off',
'n/no-missing-import': 'off',
},
{
files: ['src/browser/**/*', '**/*.test.ts', 'src/plugins/markdown-pages/types.ts'],
rules: {
'n/no-unpublished-import': 'off',
'n/no-missing-import': 'off',
},
}),
forFiles('rollup.config.js', {
rules: {
'no-console': 'off',
},
],
};
}),
]);
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ jobs:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm turbo _:lint
- run: pnpm build
- run: pnpm lint

##############################################################

Expand All @@ -75,6 +76,7 @@ jobs:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm build
- run: pnpm turbo test:node

browser_tests:
Expand All @@ -87,4 +89,5 @@ jobs:
- uses: wyvox/action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm build
- run: pnpm turbo test:ember
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ dist/
dist-typedoc/
declarations/
.turbo/

# npm/pnpm/yarn pack output
*.tgz
.eslintcache
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
node_modules/
coverage/
declarations/
dist/
dist-typedoc/
*.yaml
*.md
docs-app/
ui/
.lint-todo/
11 changes: 7 additions & 4 deletions .prettierrc.cjs → .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
'use strict';

module.exports = {
/**
* @see https://prettier.io/docs/en/configuration.html
* @type {import("prettier").Config}
*/
export default {
printWidth: 100,
plugins: ['prettier-plugin-ember-template-tag'],
overrides: [
{
// Lol, JavaScript
files: ['*.js', '*.ts', '*.cjs', '.mjs', '.cts', '.mts', '.cts'],
files: ['*.js', '*.ts', '*.cjs', '*.mjs', '*.mts', '*.cts', '*.gjs', '*.gts'],
options: {
singleQuote: true,
trailingComma: 'es5',
Expand Down
1 change: 1 addition & 0 deletions ui/.template-lintrc.cjs → .template-lintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ module.exports = {
extends: 'recommended',
rules: {
'no-forbidden-elements': 'off',
'no-inline-styles': 'off',
},
};
File renamed without changes.
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2024

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
File renamed without changes.
5 changes: 1 addition & 4 deletions ui/babel.config.json → babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
"transforms": []
}
],
[
"module:decorator-transforms",
{ "runtime": { "import": "decorator-transforms/runtime" } }
]
["module:decorator-transforms", { "runtime": { "import": "decorator-transforms/runtime" } }]
]
}
4 changes: 2 additions & 2 deletions docs-app/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = async function (defaults) {
app: (() => {
let sideWatch = require('@embroider/broccoli-side-watch');

let paths = ['kolay', '@universal-ember/kolay-ui'].map((libraryName) => {
let paths = ['kolay'].map((libraryName) => {
let entry = require.resolve(libraryName);
let { packageJson, path: packageJsonPath } = readPackageUpSync({ cwd: entry });
let packagePath = path.dirname(packageJsonPath);
Expand Down Expand Up @@ -56,7 +56,7 @@ module.exports = async function (defaults) {
enableTypeScriptTransform: true,
},
autoImport: {
watchedDependencies: ['kolay', '@universal-ember/kolay-ui'],
watchedDependencies: ['kolay'],
},
});

Expand Down
33 changes: 17 additions & 16 deletions docs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"lint:prettier:fix": "prettier . --write",
"start": "pnpm start:vite",
"start:vite": "vite",
"start:test": "vite --open /tests/",
"start:test": "pnpm start:vite --open /tests/",
"start:webpack": "WEBPACK=true pnpm ember serve",
"start:sync": "pnpm _syncPnpm --watch",
"_syncPnpm": "DEBUG=* pnpm sync-dependencies-meta-injected",
Expand All @@ -35,28 +35,28 @@
"@babel/eslint-parser": "^7.23.3",
"@babel/plugin-proposal-decorators": "^7.23.6",
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.1.1",
"@ember/test-helpers": "^3.3.0",
"@ember/string": "^4.0.0",
"@ember/test-helpers": "^4.0.4",
"@ember/test-waiters": "^3.1.0",
"@embroider/broccoli-side-watch": "^1.0.1",
"@embroider/compat": "unstable",
"@embroider/test-setup": "unstable",
"@embroider/config-meta-loader": "unstable",
"@embroider/core": "unstable",
"@embroider/macros": "unstable",
"@embroider/test-setup": "unstable",
"@embroider/vite": "unstable",
"@embroider/webpack": "unstable",
"@glimmer/component": "^1.1.2",
"@glimmer/component": "^2.0.0",
"@glimmer/tracking": "^1.1.2",
"@glint/core": "^1.3.0",
"@glint/environment-ember-loose": "^1.3.0",
"@glint/environment-ember-template-imports": "^1.3.0",
"@glint/template": "^1.3.0",
"@nullvoxpopuli/eslint-configs": "^4.0.0",
"@glint/core": "unstable",
"@glint/environment-ember-loose": "unstable",
"@glint/environment-ember-template-imports": "unstable",
"@glint/template": "unstable",
"@nullvoxpopuli/eslint-configs": "^4.3.0",
"@rollup/plugin-babel": "^6.0.4",
"@tsconfig/ember": "^3.0.3",
"@types/qunit": "^2.19.10",
"broccoli-asset-rev": "^3.0.0",
"@embroider/broccoli-side-watch": "^1.0.1",
"concurrently": "^8.2.2",
"decorator-transforms": "^2.2.2",
"ember-auto-import": "^2.7.0",
Expand All @@ -70,15 +70,15 @@
"ember-load-initializers": "^2.1.2",
"ember-modifier": "^4.2.0",
"ember-page-title": "^8.1.0",
"ember-primitives": "^0.21.0",
"ember-primitives": "^0.25.0",
"ember-qunit": "^8.0.2",
"ember-resolver": "^13.0.2",
"ember-resources": "^7.0.0",
"ember-resources": "^7.0.3",
"ember-source": "^5.12.0",
"ember-template-imports": "^4.0.0",
"ember-template-lint": "^6.0.0",
"ember-welcome-page": "^7.0.2",
"eslint": "^8.55.0",
"eslint": "^8.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.0.0",
"eslint-plugin-n": "^17.3.1",
Expand All @@ -97,6 +97,7 @@
"tracked-built-ins": "^3.3.0",
"typescript": "^5.3.3",
"vite": "^5.1.3",
"vite-plugin-wasm": "^3.3.0",
"webpack": "^5.90.3"
},
"engines": {
Expand All @@ -118,13 +119,13 @@
},
"dependencies": {
"@shikijs/rehype": "^1.1.7",
"@universal-ember/kolay-ui": "workspace:^",
"@universal-ember/test-support": "^0.2.0",
"change-case": "^5.4.3",
"content-tag": "^2.0.2",
"ember-async-data": "^1.0.3",
"ember-cached-decorator-polyfill": "^1.0.2",
"ember-mobile-menu": "^5.1.0",
"ember-repl": "^4.1.1",
"ember-repl": "4.3.4",
"ember-route-template": "^1.0.3",
"kolay": "workspace:^",
"reactiveweb": "^1.2.1",
Expand Down
8 changes: 4 additions & 4 deletions docs-app/public/docs/plugins/helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ These utilities can be imported and used within your own projects, as they are a
This should allow users to build their own specific set of outputs using the same underying tools that `kolay` uses.

```hbs live no-shadow
<APIDocs @module="declarations/plugins" @name="gitRef" @package="kolay" />
<APIDocs @module="declarations/build/plugins" @name="gitRef" @package="kolay" />
```

```hbs live no-shadow
<APIDocs @module="declarations/plugins" @name="packageTypes" @package="kolay" />
<APIDocs @module="declarations/build/plugins" @name="packageTypes" @package="kolay" />
```

```hbs live no-shadow
<APIDocs @module="declarations/plugins" @name="virtualFile" @package="kolay" />
<APIDocs @module="declarations/build/plugins" @name="virtualFile" @package="kolay" />
```

```hbs live no-shadow
<APIDocs @module="declarations/plugins" @name="generateTypeDocJSON" @package="kolay" />
<APIDocs @module="declarations/build/plugins" @name="generateTypeDocJSON" @package="kolay" />
```
2 changes: 1 addition & 1 deletion docs-app/public/docs/plugins/kolay.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ return require("@embroider/compat").compatBuild(app, Webpack, {
```

```hbs live no-shadow
<APIDocs @package="kolay" @module="declarations/plugins/types" @name="Options" />
<APIDocs @package="kolay" @module="declarations/types" @name="Options" />
```

## Conventions
Expand Down
2 changes: 1 addition & 1 deletion docs-app/public/docs/usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Documentation system for the the `@universal-ember` family of projects.
## Install[^type-module]

```bash
pnpm add kolay @universal-ember/kolay-ui
pnpm add kolay
```

### Use Markdown
Expand Down
6 changes: 2 additions & 4 deletions docs-app/public/docs/usage/setup.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
## Install[^type-module]
## Install

```bash
pnpm add kolay @universal-ember/kolay-ui
pnpm add kolay
```

[^type-module]: `@universal-ember/kolay-ui` is only needed because due to a temporary technical problem. Once the ember ecosystem has broader `package.json#type=module` support for its own ember using libraries, `@universal-ember/kolay-ui` can be removed and there will only be `kolay`. Note that `package.json#type=module` support is already working and has worked for a good number of years for non-Ember libraries.

## Setup

There are two areas of configuration needed: buildtime, and runtime[^runtime-optional].
Expand Down
2 changes: 1 addition & 1 deletion docs-app/tests/kolay/components/api-docs-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module('<APIDocs>', function (hooks) {
test('it works', async function (assert) {
await render(
<template>
<APIDocs @package="kolay" @module="src/browser/re-exports" @name="Manifest" />
<APIDocs @package="kolay" @module="declarations/browser" @name="Manifest" />
</template>
);

Expand Down
2 changes: 1 addition & 1 deletion docs-app/tests/kolay/components/comment-query-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module('<CommentQuery>', function (hooks) {
test('it works', async function (assert) {
await render(
<template>
<CommentQuery @package="kolay" @module="src/browser/re-exports" @name="CommentQuery" />
<CommentQuery @package="kolay" @module="declarations/browser" @name="CommentQuery" />
</template>
);

Expand Down
Loading

0 comments on commit fe390b8

Please sign in to comment.