Skip to content
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

Continue updating infrastructure #1419

Merged
merged 3 commits into from
May 3, 2023
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
38 changes: 25 additions & 13 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:qunit/recommended",
"plugin:node/recommended",
"plugin:n/recommended",
"plugin:import/errors",
"prettier"
],
"plugins": ["@typescript-eslint", "prettier", "qunit"],
Expand All @@ -27,6 +28,7 @@
},
"ignorePatterns": ["dist", "ts-dist", "node_modules", "tmp"],
"rules": {
"n/no-missing-import": "off",
// disabled because we still have a few commented tests
"qunit/no-commented-tests": "off",
// disabled due to false positives
Expand All @@ -37,7 +39,7 @@
"qunit/no-global-stop-start": "off",
"import/no-extraneous-dependencies": ["error"],
// this is handled by import/no-extraneous-dependencies
"node/no-extraneous-import": "off",
"n/no-extraneous-import": "off",
"prettier/prettier": "error",
"accessor-pairs": "error",
"array-callback-return": "error",
Expand Down Expand Up @@ -119,7 +121,7 @@
"no-path-concat": "off",
"no-plusplus": "off",
"no-process-env": "off",
"no-process-exit": "error",
"no-process-exit": "off",
"no-proto": "error",
"no-restricted-globals": "error",
"no-restricted-imports": "error",
Expand Down Expand Up @@ -209,7 +211,6 @@
"plugin:import/errors",
"plugin:import/typescript",
"plugin:qunit/recommended",
"plugin:node/recommended",
"prettier"
],
"plugins": ["simple-import-sort"],
Expand All @@ -225,7 +226,7 @@
"import/export": "off",
"qunit/no-global-expect": ["off"],
// this is handled by import/errors
"node/no-extraneous-import": "off",
"n/no-extraneous-import": "off",
"@typescript-eslint/unbound-method": [
"error",
{
Expand Down Expand Up @@ -255,7 +256,8 @@
"sourceType": "module"
},
"rules": {
"no-useless-constructor": "off"
"no-useless-constructor": "off",
"n/no-missing-import": "off"
}
},
// node files
Expand All @@ -266,6 +268,7 @@
"testem.js",
"testem-browserstack.js",
"bin/**/*.js",
"bin/**/*.mjs",
"build/**/*.js",
"server/**/*.js"
],
Expand All @@ -281,8 +284,15 @@
{
"files": ["bin/**/*.js"],
"rules": {
"n/no-unsupported-features/es-syntax": [
"error",
{
"version": ">=16.0.0",
"ignores": []
}
],
"no-process-exit": "off",
"node/shebang": "off"
"n/shebang": "off"
}
},
{
Expand All @@ -291,11 +301,12 @@
"browser": true
},
"files": ["benchmark/**/*.js", "benchmark/**/*.d.ts"],
"extends": ["plugin:import/errors"],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"node/no-unsupported-features/es-syntax": "off",
"n/no-unsupported-features/es-syntax": "off",
"no-console": "off"
}
},
Expand All @@ -307,8 +318,8 @@
"mocha": true
},
"rules": {
"node/no-unsupported-features/es-syntax": "off",
"node/no-unpublished-import": "off",
"n/no-unsupported-features/es-syntax": "off",
"n/no-unpublished-import": "off",
"no-console": "off"
}
},
Expand All @@ -328,8 +339,9 @@
// "tsconfigRootDir": __dirname
// },
"rules": {
"node/no-unsupported-features/es-syntax": "off",
"node/no-unsupported-features/node-builtins": "off",
"n/no-missing-import": "off",
"n/no-unsupported-features/es-syntax": "off",
"n/no-unsupported-features/node-builtins": "off",
"@typescript-eslint/naming-convention": [
"error",
{
Expand Down Expand Up @@ -417,7 +429,7 @@
"packages/@glimmer/reference/test/template-test.ts"
],
"rules": {
"node/no-extraneous-import": "warn"
"n/no-extraneous-import": "warn"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:


test-node:
name: Chrome
name: Node
runs-on: ubuntu-latest
needs: ["install_dependencies"]
timeout-minutes: 10
Expand Down
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignore-workspace-root-check=true
auto-install-peers=true
strict-peer-dependencies=true
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,11 @@
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[properties]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"[shellscript]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
}
}
2 changes: 1 addition & 1 deletion benchmark/benchmarks/krausest/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Row from './components/Row';
import buildData from './utils/data';

/**
* @param {HTMLElement | import('@glimmer/interfaces').SimpleElement} element
* @param {HTMLElement | import('@simple-dom/interface').SimpleElement} element
* @param {boolean} isInteractive
*/
export default async function render(element, isInteractive) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/bin/control.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line node/no-unpublished-require
// eslint-disable-next-line n/no-unpublished-require
const express = require('express');

const app = express();
Expand Down
2 changes: 1 addition & 1 deletion benchmark/bin/experiment.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line node/no-unpublished-require
// eslint-disable-next-line n/no-unpublished-require
const express = require('express');

const app = express();
Expand Down
4 changes: 2 additions & 2 deletions benchmark/lib/build.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable node/no-unpublished-require */
/* eslint-disable n/no-unpublished-require */
const rollup = require('rollup');
const sourcemap = require('rollup-plugin-sourcemaps');
const { terser } = require('rollup-plugin-terser');
const terser = require('@rollup/plugin-terser');
const strip = require('@rollup/plugin-strip');
const path = require('path');
const fs = require('fs-extra');
Expand Down
14 changes: 7 additions & 7 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"@simple-dom/void-map": "^1.4.0"
},
"devDependencies": {
"@rollup/plugin-strip": "^2.0.1",
"express": "^4.0.0",
"fs-extra": "*",
"rollup": "^2.24.0",
"rollup-plugin-sourcemaps": "^0.6.2",
"rollup-plugin-terser": "^7.0.0",
"symlink-or-copy": "*"
"@rollup/plugin-strip": "^3.0.2",
"express": "^4.18.2",
"fs-extra": "^11.1.1",
"rollup": "^3.21.3",
"rollup-plugin-sourcemaps": "^0.6.3",
"@rollup/plugin-terser": "^0.4.1",
"symlink-or-copy": "^1.3.1"
}
}
8 changes: 4 additions & 4 deletions bin/run-node-tests.js → bin/run-node-tests.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import path from 'node:path';
import { execaSync } from 'execa';

const path = require('path');
const execa = require('execa');
const __dirname = new URL('.', import.meta.url).pathname;

const PROJECT_ROOT = path.resolve(__dirname, '..');
const EMBER_BIN = 'ember';
Expand Down Expand Up @@ -32,7 +32,7 @@ if ('EMBER_CLI_TEST_OUTPUT' in process.env) {

// Executes a command and pipes stdout back to the user.
function exec(command, args) {
execa.sync(command, args, {
execaSync(command, args, {
stdio: 'inherit',
preferLocal: true,
});
Expand Down
8 changes: 3 additions & 5 deletions bin/run-types-tests.js → bin/run-types-tests.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env node

const execa = require('execa');
const yaml = require('js-yaml');
import { execa } from 'execa';
import yaml from 'js-yaml';

async function main() {
/**
Expand All @@ -22,7 +20,7 @@ async function main() {
let { message } = err;
console.log('not ok 1 - types failed smoke test');
console.log(` ---
${yaml.safeDump({ message })}
${yaml.dump({ message })}
...`);

process.exitCode = 1;
Expand Down
21 changes: 12 additions & 9 deletions bin/sync-npm-owners.js → bin/sync-npm-owners.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/usr/bin/env node

// This script fetches the npm owners of the root package (glimmer-engine) and
// makes them owners of all of individual subpackages. Note that the script will
// add new people, but won't remove anyone who has been removed from
// glimmer-engine.

const execSync = require('child_process').execSync;
const globSync = require('glob').sync;
import { execSync } from 'node:child_process';
import { globSync } from 'glob';
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';

let name = require('../package.json').name;
const __dirname = new URL('.', import.meta.url).pathname;
const manifest = resolve(__dirname, '../package.json');
let name = JSON.parse(readFileSync(manifest)).name;

console.log('Looking for existing owners on ' + name + ' on npm...');

Expand All @@ -24,19 +26,20 @@ console.log('\nLooking for packages...');

let packages = globSync('@glimmer/*/package.json', {
cwd: __dirname + '/../dist',
}).map((package) => package.replace('/package.json', ''));
}).map((pkg) => pkg.replace('/package.json', ''));

if (!packages.length) {
console.log('No packages found. Did you do a build first?');
// eslint-disable-next-line n/no-process-exit
process.exit(1);
}

console.log(packages.join('\n') + '\n');

owners.forEach((owner) => {
packages.forEach((package) => {
console.log(`Adding ${owner} to ${package}...`);
execSync(`npm owner add "${owner}" "${package}"`);
packages.forEach((pkg) => {
console.log(`Adding ${owner} to ${pkg}...`);
execSync(`npm owner add "${owner}" "${pkg}"`);
});
});

Expand Down
58 changes: 0 additions & 58 deletions bin/yarn-link-all.js

This file was deleted.

Loading