Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
15 changes: 0 additions & 15 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,6 @@
"type": "reactnative",
"cwd": "${workspaceFolder}/apps/win32"
},
{
"name": "Debug test",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
"cwd": "${workspaceFolder}/packages/just-scripts",
"args": ["-i", "--runInBand"],
"runtimeArgs": ["--nolazy"],
"env": {
"NODE_ENV": "development"
},
"console": "integratedTerminal",
"sourceMaps": true,
"outFiles": []
},
{
"name": "Debug current folder test",
"type": "node",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "tune lage.config and fix @types/node version",
"packageName": "@fluentui-react-native/framework-base",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "tune lage.config and fix @types/node version",
"packageName": "@fluentui-react-native/immutable-merge",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "tune lage.config and fix @types/node version",
"packageName": "@fluentui-react-native/memo-cache",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "tune lage.config and fix @types/node version",
"packageName": "@uifabricshared/themed-settings",
"email": "[email protected]",
"dependentChangeType": "patch"
}
38 changes: 30 additions & 8 deletions lage.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
module.exports = {
npmClient: 'yarn',
pipeline: {
build: ['^build'],
buildci: ['build', 'test', 'depcheck'],
bundle: ['build'],
clean: [],
depcheck: [],
lint: [],
prettier: [],
build: {
dependsOn: ['^build'],
inputs: ['*', 'src/**/*', 'assets/**/*'],
outputs: ['lib/**/*', 'lib-commonjs/**/*'],
},
buildci: ['build', 'test', 'lint', 'depcheck'],
bundle: {
inputs: ['**/*', '!node_modules/**/*', '!dist/**/*', '!lib/**/*', '!lib-commonjs/**/*'],
outputs: ['dist/**/*'],
},
clean: {
cache: false,
},
depcheck: {
inputs: ['**/*', '!node_modules/**/*', '!dist/**/*', '!lib/**/*', '!lib-commonjs/**/*'],
outputs: [],
},
lint: {
inputs: ['*', 'src/**/*'],
outputs: [],
},
prettier: {
inputs: ['*', 'src/**/*'],
outputs: [],
},
['prettier-fix']: [],
test: ['build', 'lint'],
test: {
dependsOn: ['build'],
inputs: [],
outputs: [],
},
},
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"bundle": "lage bundle",
"clean": "lage clean",
"change": "beachball change",
"check-for-changed-files": "cd scripts && yarn fluentui-scripts checkForModifiedFiles",
"check-for-changed-files": "cd scripts && yarn fluentui-scripts check-changes",
"checkchange": "beachball check --changehint \"Run 'yarn change' to generate a change file\"",
"align-deps": "rnx-align-deps --no-unmanaged --requirements [email protected]",
"depcheck": "lage depcheck",
Expand Down
2 changes: 1 addition & 1 deletion packages/deprecated/themed-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@react-native/babel-preset": "^0.74.0",
"@react-native/metro-config": "^0.74.0",
"@types/jest": "^29.0.0",
"@types/node": "^10.3.5",
"@types/node": "^22.0.0",
"react": "18.2.0",
"react-native": "^0.74.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/framework-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
"@fluentui-react-native/eslint-config-rules": "workspace:*",
"@fluentui-react-native/scripts": "workspace:*",
"@types/jest": "^29.0.0",
"@types/node": "^10.3.5"
"@types/node": "^22.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/framework/immutable-merge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
"@fluentui-react-native/eslint-config-rules": "workspace:*",
"@fluentui-react-native/scripts": "workspace:*",
"@types/jest": "^29.0.0",
"@types/node": "^10.3.5"
"@types/node": "^22.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/framework/memo-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@fluentui-react-native/eslint-config-rules": "workspace:*",
"@fluentui-react-native/scripts": "workspace:*",
"@types/jest": "^29.0.0",
"@types/node": "^10.3.5",
"@types/node": "^22.0.0",
"tslib": "^2.3.1"
}
}
59 changes: 0 additions & 59 deletions scripts/configs/just.config.js

This file was deleted.

15 changes: 7 additions & 8 deletions scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"main": "./src/index.js",
"type": "module",
"bin": {
"fluentui-scripts": "./src/cli.cjs"
"fluentui-scripts": "./src/cli.mjs"
},
"scripts": {
"build": "tsc",
"build": "node ./src/cli.mjs build",
"bundlesize": "bundlesize --debug",
"depcheck": "node ./src/cli.cjs check-publishing",
"depcheck": "node ./src/cli.mjs check-publishing",
"lint": "eslint",
"prettier": "node ./src/cli.cjs prettier",
"prettier-fix": "node ./src/cli.cjs prettier --fix true"
"prettier": "node ./src/cli.mjs prettier",
"prettier-fix": "node ./src/cli.mjs prettier --fix true"
},
"repository": {
"type": "git",
Expand All @@ -40,11 +40,12 @@
"@types/es6-collections": "^0.5.29",
"@types/es6-promise": "0.0.32",
"@types/jest": "^29.0.0",
"@types/node": "^12.11.2",
"@types/node": "^22.0.0",
"@types/react-test-renderer": "16.9.0",
"@typescript-eslint/eslint-plugin": "^8.36.0",
"@typescript-eslint/parser": "^8.36.0",
"@uifabric/prettier-rules": "^7.0.3",
"clipanion": "^4.0.0-rc.4",
"depcheck": "^1.0.0",
"eslint": "^9.0.0",
"find-up": "^5.0.0",
Expand All @@ -53,8 +54,6 @@
"jest": "^29.2.1",
"jest-diff": "^27.0.0",
"jsdom": "^25.0.0",
"just-scripts": "^2.3.2",
"just-task": "^1.4.2",
"metro-config": "^0.80.3",
"metro-react-native-babel-transformer": "^0.76.5",
"prettier": "^2.4.1",
Expand Down
7 changes: 0 additions & 7 deletions scripts/src/cli.cjs

This file was deleted.

33 changes: 33 additions & 0 deletions scripts/src/cli.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env node
// @ts-check

import { Builtins, Cli } from 'clipanion';
import { BuildCommand } from './tasks/build.js';
import { CleanCommand } from './tasks/clean.js';
import { PrettierCommand } from './tasks/prettier.js';
import { LintCommand } from './tasks/eslint.js';
import { JestCommand } from './tasks/jest.js';
import { CheckChangesCommand } from './tasks/checkForModifiedFilesTask.js';
import { CheckPublishingCommand } from './tasks/checkPublishingTask.js';
import { DepcheckCommand } from './tasks/depcheck.js';

const cli = new Cli({
binaryLabel: 'fluentui-scripts CLI',
binaryName: '@fluentui-react-native/scripts',
binaryVersion: '0.0.0',
});

cli.register(BuildCommand);
cli.register(CleanCommand);
cli.register(PrettierCommand);
cli.register(LintCommand);
cli.register(JestCommand);
cli.register(CheckChangesCommand);
cli.register(CheckPublishingCommand);
cli.register(DepcheckCommand);

cli.register(Builtins.DefinitionsCommand);
cli.register(Builtins.HelpCommand);
cli.register(Builtins.VersionCommand);

cli.runExit(process.argv.slice(2));
62 changes: 34 additions & 28 deletions scripts/src/tasks/build.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,46 @@
// @ts-check

import { Command } from 'clipanion';
import { findNativeComponents, codegenNativeComponents } from '../utils/codegenNativeComponents.js';
import path from 'path';
import fs from 'fs';
import { runScript } from '../utils/runScript.js';
import { readTypeScriptConfig } from '@rnx-kit/tools-typescript';
import { getPackageInfoFromPath } from '@rnx-kit/tools-packages';
import { JsxEmit, ModuleKind } from 'typescript';
import { cleanFolder } from './clean.js';

export class BuildCommand extends Command {
/** @override */
static paths = [['build']];

/** @override */
static usage = Command.Usage({
description: 'Builds the current package using TypeScript compiler',
details: 'This command builds the current package based on the tsconfig.json and package.json configuration.',
examples: [['Build the current package', '$0 build']],
});

async execute() {
const cwd = process.cwd();
const targets = getBuildTargets(cwd);
if (targets.length === 0) {
console.log('No build targets found. Skipping build.');
return 0;
}

// Clean the output directories before building
cleanFolder();
const buildPromises = targets.map((target) => buildTarget(target, cwd));
const results = await Promise.all(buildPromises);
for (const result of results) {
if (result !== 0) {
throw new Error(`Build failed with exit code: ${result}`);
}
}
return 0;
}
}

/**
* Get the module string for a given module kind.
Expand Down Expand Up @@ -94,31 +128,3 @@ async function buildTarget(target, cwd) {

return result;
}

/**
* Task to check the matrix of packages for publishing errors. In particular this checks for published packages that
* have a dependency on a private package
*
* @returns {import('just-scripts').TaskFunction}
*/
export function build() {
return async function (done) {
const cwd = process.cwd();
const targets = getBuildTargets(cwd);
if (targets.length === 0) {
console.log('No build targets found. Skipping build.');
done();
return;
}

const buildPromises = targets.map((target) => buildTarget(target, cwd));
const results = await Promise.all(buildPromises);
for (const result of results) {
if (result !== 0) {
done(new Error(`Build failed with exit code: ${result}`));
return;
}
}
done();
};
}
Loading
Loading